🙌 OpenHands: AI-Driven Development
Translate hardcoded settings strings (#134, ports OpenHands#14286) (#143)
Graham Neubigc8959713b2e5
diff --git a/.pr/issue-134/01-app-settings-en.png b/.pr/issue-134/01-app-settings-en.pngnew file mode 100644index 0000000000..8cbd83bc92Binary files /dev/null and b/.pr/issue-134/01-app-settings-en.png differdiff --git a/.pr/issue-134/03-mcp-timeout-label.png b/.pr/issue-134/03-mcp-timeout-label.pngnew file mode 100644index 0000000000..02a4335cdbBinary files /dev/null and b/.pr/issue-134/03-mcp-timeout-label.png differdiff --git a/.pr/issue-134/demo.gif b/.pr/issue-134/demo.gifnew file mode 100644index 0000000000..7010ef17aeBinary files /dev/null and b/.pr/issue-134/demo.gif differdiff --git a/.pr/issue-134/visual-verification.md b/.pr/issue-134/visual-verification.mdnew file mode 100644index 0000000000..85a9e10968--- /dev/null+++ b/.pr/issue-134/visual-verification.md@@ -0,0 +1,41 @@+# Visual verification — Issue #134 (app-settings polish)++## Frames in `demo.gif`++1. **`01-app-settings-en.png`** — `Settings → Application` page rendered by+ `npm run dev`. The Git Username and Git Email inputs are emptied so+ their placeholders are visible. Both placeholders now resolve through+ `t(I18nKey.SETTINGS$GIT_USERNAME_PLACEHOLDER)` and+ `t(I18nKey.SETTINGS$GIT_EMAIL_PLACEHOLDER)` instead of the previous+ hardcoded English strings.+2. **`03-mcp-timeout-label.png`** — `Settings → MCP` with the "Add MCP+ Server" form open and `Server Type = SHTTP`. The "Timeout (seconds)"+ label now resolves through `t(I18nKey.SETTINGS$MCP_TIMEOUT_LABEL)`+ instead of the previous hardcoded English label.++The page boots, all related queries succeed, and the new keys round-trip+through `make-i18n`'s declaration generator with no missing translations.++## Functional verification++- `npm run typecheck` — clean.+- `npm run build` — clean (`build/server/index.js 1,136.20 kB`).+- `npx vitest run __tests__/routes/app-settings.test.tsx __tests__/routes/mcp-settings.test.tsx __tests__/components/features/settings/mcp-settings/` — **10 / 10 passed**.+- `make-i18n` regenerates `src/i18n/declaration.ts` with the three new+ enum entries (`SETTINGS$GIT_USERNAME_PLACEHOLDER`,+ `SETTINGS$GIT_EMAIL_PLACEHOLDER`, `SETTINGS$MCP_TIMEOUT_LABEL`).++## On the sandbox-grouping half (#14291)++Upstream PR #14291 drops the `ENABLE_SANDBOX_GROUPING()` feature-flag+gate around the sandbox-grouping-strategy dropdown in+`app-settings.tsx`. That dropdown — and the `sandbox_grouping_strategy`+setting it edits — was already stripped from agent-canvas during the+original OSS port (the field is not present in `src/types/settings.ts`,+not exposed by either `/api/settings/agent-schema` or+`/api/settings/conversation-schema` on `openhands-agent-server` 1.20.1,+and `feature-flags.ts` no longer carries the `SANDBOX_GROUPING` flag).++Per the issue's own acceptance criteria ("if the field isn't part of+the schema, gate on schema presence rather than re-introducing the+flag"), this PR is a no-op for #14291: there is nothing to ungate.diff --git a/src/components/features/settings/mcp-settings/mcp-server-form.tsx b/src/components/features/settings/mcp-settings/mcp-server-form.tsxindex 6836fb97ba..19a7c7de9b 100644--- a/src/components/features/settings/mcp-settings/mcp-server-form.tsx+++ b/src/components/features/settings/mcp-settings/mcp-server-form.tsx@@ -325,7 +325,7 @@ export function MCPServerForm({testId="timeout-input"name="timeout"type="number"- label="Timeout (seconds)"+ label={t(I18nKey.SETTINGS$MCP_TIMEOUT_LABEL)}className="w-full max-w-[680px]"showOptionalTagdefaultValue={server?.timeout?.toString() || ""}diff --git a/src/i18n/translation.json b/src/i18n/translation.jsonindex 5594dc8856..3f3d24a78d 100644--- a/src/i18n/translation.json+++ b/src/i18n/translation.json@@ -16903,6 +16903,40 @@"uk": "Електронна пошта Git","ca": "Correu electrònic de Git"},+ "SETTINGS$GIT_USERNAME_PLACEHOLDER": {+ "en": "Username for git commits",+ "ja": "Gitコミット用のユーザー名",+ "zh-CN": "Git提交的用户名",+ "zh-TW": "Git提交的使用者名稱",+ "ko-KR": "Git 커밋용 사용자 이름",+ "no": "Brukernavn for git-commits",+ "it": "Nome utente per i commit Git",+ "pt": "Nome de usuário para commits Git",+ "es": "Nombre de usuario para commits de Git",+ "ar": "اسم المستخدم لإيداعات Git",+ "fr": "Nom d'utilisateur pour les commits Git",+ "tr": "Git commit'leri için kullanıcı adı",+ "de": "Benutzername für Git-Commits",+ "uk": "Ім'я користувача для git-комітів",+ "ca": "Nom d'usuari per als commits de Git"+ },+ "SETTINGS$GIT_EMAIL_PLACEHOLDER": {+ "en": "Email for git commits",+ "ja": "Gitコミット用のメールアドレス",+ "zh-CN": "Git提交的电子邮件",+ "zh-TW": "Git提交的電子郵件",+ "ko-KR": "Git 커밋용 이메일",+ "no": "E-post for git-commits",+ "it": "Email per i commit Git",+ "pt": "Email para commits Git",+ "es": "Correo electrónico para commits de Git",+ "ar": "البريد الإلكتروني لإيداعات Git",+ "fr": "Email pour les commits Git",+ "tr": "Git commit'leri için e-posta",+ "de": "E-Mail für Git-Commits",+ "uk": "Електронна пошта для git-комітів",+ "ca": "Correu electrònic per als commits de Git"+ },"PROJECT_MANAGEMENT$TITLE": {"en": "Project Management","ja": "プロジェクト管理",@@ -17685,6 +17719,23 @@"uk": "Введіть API ключ (необов'язково)","ca": "Introduïu la clau d'API (opcional)"},+ "SETTINGS$MCP_TIMEOUT_LABEL": {+ "en": "Timeout (seconds)",+ "ja": "タイムアウト(秒)",+ "zh-CN": "超时(秒)",+ "zh-TW": "超時(秒)",+ "ko-KR": "타임아웃(초)",+ "no": "Timeout (sekunder)",+ "it": "Timeout (secondi)",+ "pt": "Timeout (segundos)",+ "es": "Timeout (segundos)",+ "ar": "المهلة الزمنية (ثوانٍ)",+ "fr": "Timeout (secondes)",+ "tr": "Zaman aşımı (saniye)",+ "de": "Timeout (Sekunden)",+ "uk": "Таймаут (секунди)",+ "ca": "Temps d'espera (segons)"+ },"SETTINGS$MCP_COMMAND_ARGUMENTS": {"en": "Command Arguments","ja": "コマンド引数",diff --git a/src/routes/app-settings.tsx b/src/routes/app-settings.tsxindex 145b94157a..c97d149a28 100644--- a/src/routes/app-settings.tsx+++ b/src/routes/app-settings.tsx@@ -208,7 +208,7 @@ export function AppSettingsScreen() {label={t(I18nKey.SETTINGS$GIT_USERNAME)}defaultValue={settings.git_user_name || ""}onChange={checkIfGitUserNameHasChanged}- placeholder="Username for git commits"+ placeholder={t(I18nKey.SETTINGS$GIT_USERNAME_PLACEHOLDER)}className="w-full max-w-[680px]"/><SettingsInput@@ -218,7 +218,7 @@ export function AppSettingsScreen() {label={t(I18nKey.SETTINGS$GIT_EMAIL)}defaultValue={settings.git_user_email || ""}onChange={checkIfGitUserEmailHasChanged}- placeholder="Email for git commits"+ placeholder={t(I18nKey.SETTINGS$GIT_EMAIL_PLACEHOLDER)}className="w-full max-w-[680px]"/></div>