localize hardcoded strings in provider settings UI#8931
Open
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
Author
|
@tulsi-builder added you because this didn't change any of the string text/UX, just caught a few strings that were hardcoded. Feel free to keep or ignore anything that might break. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Category: improvement
User Impact: Provider settings now displays error messages and button labels in the user's selected language, consistent with the rest of the settings UI.
Problem: Several user-facing strings in the provider settings panels were hardcoded in English — error messages like "Failed to save", validation messages like "Enter a value for API Key", and button labels like "Connect", "Edit", and "Add". These strings were invisible to the i18n system and would always appear in English regardless of the user's language setting.
Solution: Replaced all hardcoded strings with
t()calls backed by new locale keys in bothenandes. Error messages landed in a newproviders.errorsnamespace insettings.json; general action labels (add,connect,saved,saving) were added tocommon.jsonwhere they can be reused across the app.File changes
ui/goose2/src/features/settings/ui/ModelProviderRow.tsx
Replaced six hardcoded error strings (
"Failed to load provider settings","Failed to save"×2,"Failed to remove","Failed to complete sign-in","Enter a value for {{label}}","Fill in {{fields}}") witht()calls. UpdateduseTranslationto include thecommonnamespace so the Retry/Connect button can usecommon:actions.retryandcommon:actions.connect. Addedtto theuseCallbackdependency array forloadConfig.ui/goose2/src/features/settings/ui/ModelProviderPanels.tsx
Replaced hardcoded
"Edit"/"Add"button labels witht("common:actions.edit")/t("common:actions.add"). ReplacedAsyncButtonstring props (idleLabel="Save",pendingLabel="Saving...",successLabel="Saved") witht()calls.ui/goose2/src/shared/i18n/locales/en/settings.json
Added
providers.errorsblock with six keys:fieldRequired,fieldsMissing,loadFailed,removeFailed,saveFailed,signInFailed.ui/goose2/src/shared/i18n/locales/es/settings.json
Spanish translations for the same
providers.errorsblock.ui/goose2/src/shared/i18n/locales/en/common.json
Added four action keys:
add,connect,saved,saving.ui/goose2/src/shared/i18n/locales/es/common.json
Spanish translations for the same four action keys.
ui/goose2/scripts/check-file-sizes.mjs
Added a narrowly scoped exception for
ModelProviderRow.tsx(508 lines), which grew marginally past the 500-line limit due to multi-line i18n interpolation calls.Reproduction Steps
🤖 Generated with Claude Code