Skip to content

feat(i18n): add Bahasa Indonesia (id-ID) locale support - #21

Draft
mteguhfh wants to merge 7 commits into
OpenBMB:mainfrom
mteguhfh:feat/add-indonesian-locale
Draft

feat(i18n): add Bahasa Indonesia (id-ID) locale support#21
mteguhfh wants to merge 7 commits into
OpenBMB:mainfrom
mteguhfh:feat/add-indonesian-locale

Conversation

@mteguhfh

@mteguhfh mteguhfh commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Bahasa Indonesia as a third language option, enabling Chinese -> English -> Indonesian locale switching.

Changes

  • i18n/index.tsx: Extended AppLocale type to include id-ID, imported id.json, made catalog building locale-aware with buildCatalog(), updated initialLocale / toggleLocale (zh->en->id->zh cycle) / getDateLocale
    • LanguageSwitcher.tsx: Added Bahasa Indonesia option to dropdown
    • i18n/id.json: Indonesian catalog with all 1906 keys fully translated
    • i18n/en.json: Updated with 59 previously hardcoded Chinese strings + 9 upstream strings
    • scripts/check-i18n.cjs: Added id.json coverage validation
    • scripts/gen-id.cjs: Utility script to regenerate translations

Notes

  • All 1906 keys are fully translated in both en.json and id.json (0 placeholders remaining)
    • check-i18n.cjs passes clean: 1906 English, 1906 Indonesian
    • Merged with upstream main and resolved en.json conflict
    • TypeScript compiles with zero errors

@fadeoreo

Copy link
Copy Markdown
Collaborator

Thanks for the Indonesian translation work. The translation asset itself is valuable, but I would like to align on the language-pack architecture before merging this PR.

Our intended direction is:

  • Chinese and English remain bundled as the base languages.
  • Optional locales such as id-ID are published as installable language packs.
  • Selecting an uninstalled locale downloads and caches the pack.
  • Language packs can be updated independently from the StaffDeck application.
  • Missing entries fall back through selected locale -> English -> Chinese source.
  • Each pack carries a catalog version, compatible app version, and checksum.

The core downloader and cache can be implemented separately; this PR does not need to own the complete installer. Ideally, the Indonesian translations from this PR would become the first standalone language pack.

There are also two concrete issues to resolve:

  1. The branch currently conflicts with the latest main in en.json.
  2. Running node scripts/gen-id.cjs reports 1810 translated, 96 fallback (English), while i18n:check still passes. The generator therefore cannot reproduce the checked-in fully translated catalog, and English fallbacks are currently treated as valid Indonesian translations.

Would you be comfortable preserving the translation work, rebasing it after the language-pack loader is ready, and contributing id-ID as the first installable language pack?

@mteguhfh

Copy link
Copy Markdown
Contributor Author

@fadeoreo Thanks for the thoughtful feedback — the language-pack architecture makes a lot of sense and I'm happy to align with that direction.

I'll do the following:

  1. Preserve the full id-ID translations on the current branch
    1. Wait for the language-pack loader to land on main
    1. Rebase and restructure id-ID as the first installable language pack
      A couple of quick questions:
  • Is there an existing issue or rough design for the loader I can reference?
    • Should the pack format live under a language-packs/ directory in the repo, or is there a preferred structure?
      Ready to contribute to the loader itself if that's helpful.

@fadeoreo

Copy link
Copy Markdown
Collaborator

Thanks for aligning with the downloadable language-pack direction.

There is no tracking issue yet. I suggest creating one before implementation with the scope: feat(i18n): downloadable language-pack infrastructure.

The proposed source layout is:

  • language-packs/manifest.json
  • language-packs/<locale>/manifest.json
  • language-packs/<locale>/catalog.json

Each pack manifest should include at least:

  • locale
  • name and nativeName
  • version
  • minAppVersion
  • sourceCatalogHash
  • sha256

At runtime, StaffDeck should download packs through the backend, verify compatibility and checksum, and cache them in the application data directory. The fallback order should be selected locale -> English -> Chinese source.

Please convert this PR to Draft and preserve the existing translations, but avoid repeatedly merging main into this branch while the loader is not ready. Once the loader contract lands, please rebase cleanly and restructure id-ID as the first installable pack.

You are welcome to contribute to the loader. It would be best to agree on the manifest and storage contract in the tracking issue before starting the implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants