#19966: feat: add language support for browser profiles
docs
size: XS
Cluster:
Browser Enhancements and Fixes
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
#15304: feat(browser): add browser-use no-relay profile driver
by rajanrengasamy · 2026-02-13
74.3%
#22952: fix(browser): suggest remote profile when local Chrome is not insta...
by dashed · 2026-02-21
73.5%
#23189: feat(browser): add custom userDataDir support for Chrome profiles
by delta8z · 2026-02-22
71.5%
#20207: fix(browser): use profile driver instead of hardcoded name
by mahsumaktas · 2026-02-18
71.2%
#14944: fix(browser): prefer openclaw profile in headless/noSandbox environ...
by BenediktSchackenberg · 2026-02-12
71.2%
#9728: fix(gateway): browser.snapshot ignores profile parameter (#9723)
by divol89 · 2026-02-05
70.4%
#6193: fix(browser): default to openclaw profile instead of chrome extensi...
by mikezaoldyeck · 2026-02-01
69.9%
#10943: fix(config): resolve Control UI "Unsupported schema node" for confi...
by kraftbj · 2026-02-07
68.7%
#16110: feat(browser): add browser.profiles.openclaw.userDataDir config
by chengcyber · 2026-02-14
68.6%
#20578: feat(browser): add proxy configuration option
by illusivejosiah · 2026-02-19
68.4%