Files
RustProxy/langs
2026-10-17 22:33:00 +02:00
..
2026-10-17 22:33:00 +02:00
2026-10-17 22:33:00 +02:00
2026-10-14 21:36:19 +02:00

Language packs

Add de_DE.json (or another safe unique filename) here and rebuild with Cargo. build.rs discovers all *.json files; there is no frontend language allowlist. The binary embeds the bundle at /assets/langs.json, which is accessible before login. No runtime network dependency or external translation service is required.

{
  "meta": {
    "locale": "de-DE",
    "name": "German",
    "native_name": "Deutsch",
    "direction": "ltr"
  },
  "translations": {
    "overview": "Ubersicht",
    "settings": "Einstellungen"
  }
}

Use UTF-8 and a BCP-47 locale accepted by browser Intl. Filenames may use letters, numbers, _ and -. en_US.json is the required fallback. pl_pl.json preserves the requested filename; its metadata locale is pl-PL. Missing keys fall back to English; an explicitly empty string is retained. Unknown keys are permitted for future extensions. rtl enables right-to-left layout. HTML is never evaluated: translations and metadata labels are rendered using textContent.

The saved selection is matched by ID or locale. Browser language preferences are used when no saved language matches. Short legacy selections such as pl are matched through metadata, not language-specific code. Adding or removing a file triggers a Cargo rebuild. Duplicate locales, invalid metadata, non-string values and oversized packs cause a build error. Limits: 128 packs, 256 KiB per pack, 4096 keys per pack, 8 MiB total bundle.

Validate pack JSON locally (python3 -m json.tool langs/en_US.json > /dev/null, repeating for custom packs). The Rust build validates translation metadata and bundle limits. Ensure static UI keys have an English fallback. Extra JSON packs survive the managed updater when the new release does not contain the same filename. Keep a separate backup too; shipped filenames are replaced and the previous bytes are retained in the source backup.