← Back to PRs

#19966: feat: add language support for browser profiles

by cyfrit open 2026-02-18 10:45 View on GitHub →
docs size: XS
Add language configuration support for browser profiles. ## Changes - Add `browser.language` for global browser UI language configuration - Add `profiles[].language` for per-profile language override (profile language overrides global) - Pass `--lang` flag to Chrome when launching browser - Support BCP 47 language tags (e.g., zh-CN, en-US, ja-JP) ## Example Usage ```json5 { browser: { language: "zh-CN", // Global default profiles: { work: { cdpPort: 18801, language: "en-US" // Override for this profile } } } } ``` <!-- greptile_comment --> <h3>Greptile Summary</h3> This PR adds `browser.language` (global) and `profiles[].language` (per-profile override) configuration options that pass `--lang` to Chrome on launch, allowing users to set browser UI language via BCP 47 tags. The implementation across the runtime code (`chrome.ts`, `config.ts`, `profiles-service.ts`, `routes/basic.ts`) is clean and follows existing patterns. The profile-overrides-global resolution logic is correct. - **Critical**: The `language` field was not added to the Zod validation schema in `src/config/zod-schema.ts`. Both the top-level `browser` object and per-profile objects use `.strict()`, so any config containing `language` will fail validation during gateway startup or config operations. This must be fixed before merging. - Documentation updates (English and zh-CN) correctly show the new field in config examples. <h3>Confidence Score: 2/5</h3> - This PR has a blocking issue: the Zod schema was not updated, so the new `language` config field will be rejected by validation. - The runtime code changes are well-structured and follow existing patterns, but the missing Zod schema update means the feature will not work in practice — any config containing `browser.language` or per-profile `language` will fail strict Zod validation during gateway startup or config set/apply operations. - `src/config/zod-schema.ts` needs `language: z.string().optional()` added to both the browser object schema and the profile object schema. <sub>Last reviewed commit: 442a8b0</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs