Skip to content

localize hardcoded strings in provider settings UI#8931

Open
delkc wants to merge 1 commit intomainfrom
clay/localize-provider-settings-strings
Open

localize hardcoded strings in provider settings UI#8931
delkc wants to merge 1 commit intomainfrom
clay/localize-provider-settings-strings

Conversation

@delkc
Copy link
Copy Markdown
Collaborator

@delkc delkc commented Apr 30, 2026

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 both en and es. Error messages landed in a new providers.errors namespace in settings.json; general action labels (add, connect, saved, saving) were added to common.json where 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}}") with t() calls. Updated useTranslation to include the common namespace so the Retry/Connect button can use common:actions.retry and common:actions.connect. Added t to the useCallback dependency array for loadConfig.

ui/goose2/src/features/settings/ui/ModelProviderPanels.tsx
Replaced hardcoded "Edit" / "Add" button labels with t("common:actions.edit") / t("common:actions.add"). Replaced AsyncButton string props (idleLabel="Save", pendingLabel="Saving...", successLabel="Saved") with t() calls.

ui/goose2/src/shared/i18n/locales/en/settings.json
Added providers.errors block with six keys: fieldRequired, fieldsMissing, loadFailed, removeFailed, saveFailed, signInFailed.

ui/goose2/src/shared/i18n/locales/es/settings.json
Spanish translations for the same providers.errors block.

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

  1. Run the app and open Settings → Providers.
  2. Switch the app language to Spanish (Settings → General → Language).
  3. Expand a provider that requires an API key (e.g. OpenAI).
  4. Try saving without entering a value — the validation error should appear in Spanish.
  5. Try connecting a provider that uses native OAuth — the Connect/Retry button label should appear in Spanish.
  6. Confirm that "Edit", "Add", "Save", "Saving…", and "Saved" button states all render in Spanish.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@delkc delkc requested a review from tulsi-builder April 30, 2026 13:37
@delkc
Copy link
Copy Markdown
Collaborator Author

delkc commented Apr 30, 2026

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant