-
Notifications
You must be signed in to change notification settings - Fork 0
Developer I18n
BLXCode keeps UI strings and EULA content in explicit locale sources so translations are checked at compile time.
-
src/i18n/keys.rs:I18nKeyenum. -
src/i18n/locale.rs: locale metadata and parsing. -
src/i18n/locales/en_us.rs: English source strings. -
src/i18n/locales/*.rs: translated locale tables. -
src/i18n/eula.rs: compiled EULA markdown lookup. -
content/eula/*.md: localized EULA markdown. -
scripts/tools/render_i18n_locales_from_en.py: helper script for rendering non-English tables from English.
- Add a new variant to
I18nKey. - Add the English string to
src/i18n/locales/en_us.rs. - Add the translated string to every other locale file.
- Use
i18n.tr(I18nKey::YourKey)()from Leptos views. - Run a frontend check.
Appearance theme strings use paired keys per catalog id (ThemeNameBlxcodeDark, ThemeDescBlxcodeDark, …) wired through src/theme/i18n.rs. UI chrome keys (AppearanceHeroTitle, AppearanceFilterDark, …) live beside other settings strings in en_us.rs.
cargo check -p blxcode-ui --target wasm32-unknown-unknownThe locale match tables are intentionally exhaustive. Missing strings should fail compilation instead of silently falling back.
The helper script fills non-English locale files from en_us.rs. It requires deep-translator in a Python environment.
Default (safe): only translates I18nKey rows that are missing from a locale file (new keys you added to en_us.rs).
python scripts/tools/render_i18n_locales_from_en.pySpecific keys only:
python scripts/tools/render_i18n_locales_from_en.py --keys GitignorePromptTitle,GitignorePromptBodyAlso replace rows that still match English verbatim (use sparingly — can re-translate many rows):
python scripts/tools/render_i18n_locales_from_en.py --patch-english-matchesParallel workers (-j N runs up to N concurrent translate requests per locale, with shared rate limiting):
python scripts/tools/render_i18n_locales_from_en.py --patch-english-matches -j 4Full rewrite (every string in every locale — slow, overwrites good translations):
python scripts/tools/render_i18n_locales_from_en.py --fullMachine translation should be reviewed before release.
EULA content is Markdown under content/eula/. The frontend compiles these files through include_str! in src/i18n/eula.rs.
When adding a new locale, add both:
- A locale enum/metadata entry.
- A matching EULA Markdown file.
The selected UI locale is stored in local storage under blxcode_locale_v1.
EULA acceptance is stored under blxcode_eula_v2. Bump that key when materially changing content/eula/*.md so existing installs see the updated terms.
- User-Agent-Harness
- User-Agent-Providers
- User-Appearance-Themes
- User-Building
- User-File-Preview
- User-Getting-Started
- User-Image
- User-Keyboard-Shortcuts
- User-Language
- User-Memory-And-Tasks
- User-Plans
- User-Rules-And-Skills
- User-Settings
- User-Subagents
- User-Troubleshooting
- User-Voice
- User-Workspaces
- Developer-Agent-Harness
- Developer-Architecture
- Developer-Contributing
- Developer-I18n
- Developer-Setup
- Developer-Subagents
- Developer-Tauri-Ipc
- Developer-Themes
- Developer-Voice