The console uses i18next and react-i18next. English is the fallback language and the source for TypeScript key inference. Simplified Chinese uses the BCP 47 tag zh-CN.
Translations are split by namespace, registered in resources.ts:
locales/en/*.tsandlocales/zh-CN/*.tshold one file per feature namespace:common(reusable actions and labels, with the Core error messages ofcore-errors.tsnested inside it),navigation(the shell),pages,agents,templates,vaults,files,skills,keys,sessions,diagnostics,dashboard,overview,metrics,system,sandbox-navigation(registered assandboxNavigation) andonboarding.- The
sandboxandfirstRunnamespaces come fromsrc/lib/locale-strings.tsandsrc/lib/console-auth-strings.ts. Their keys are the English text and their values the Chinese translation. Sandbox status and node diagnostic formatting insrc/lib/sandbox-labels.tsandsrc/lib/sandbox-diagnostic.tsreads the same strings.
Add a namespace when a feature grows beyond page-level labels; do not grow one application-wide translation object.
When adding or changing copy:
- Add the English key and the
zh-CNtranslation in matching namespace files. - Consume the key with
useTranslation(namespace)in React components. - Use interpolation for dynamic values instead of concatenating translated text.
- Keep API values, identifiers, paths, commands and user-provided content out of translation resources.
- Run the Web tests. The resource parity test rejects keys missing from either language.
The initial language follows the browser preference (zh* selects zh-CN) unless the user has chosen a language in the console menu. The choice is stored in local storage; the console still works when browser storage is unavailable.