Skip to content

feat(i18n): downloadable language-pack infrastructure #38

Description

@mteguhfh

Overview

Implement a downloadable language-pack system that allows optional locales (such as id-ID) to be installed independently from the StaffDeck application, while Chinese and English remain bundled as the base languages.

Proposed Directory Layout

language-packs/
  manifest.json                # Root manifest listing all available packs
  <locale>/
    manifest.json              # Per-pack metadata
    catalog.json               # Translation key-value pairs

Pack Manifest Fields (language-packs/<locale>/manifest.json)

Field Description
locale BCP 47 locale code (e.g., id-ID)
name English name (e.g., Indonesian)
nativeName Native name (e.g., Bahasa Indonesia)
version Pack version (semver)
minAppVersion Minimum StaffDeck version this pack is compatible with
sourceCatalogHash SHA-256 hash of the source en.json used to generate this pack
sha256 SHA-256 checksum of the catalog.json file

Runtime Behavior

  1. Application starts with zh-CN and en-US bundled as base
    1. User selects an uninstalled locale (e.g., id-ID) from the LanguageSwitcher
    1. Frontend requests the pack from the backend endpoint (e.g., GET /api/v1/language-packs/<locale>)
    1. Backend serves the pack only if minAppVersion matches the running version
    1. Frontend verifies the SHA-256 checksum of the downloaded catalog
    1. Pack is cached in the application data directory for offline use
    1. Fallback order: selected locale → English → Chinese source

First Language Pack: id-ID

The id-ID pack will be the first standalone language pack built from the existing translations at PR #21. Once the loader infrastructure is merged, the translations will be rebased and restructured as the first installable pack.

Out of Scope (separate follow-ups)

  • Language pack update/auto-update mechanism
    • Language pack CDN distribution
      • Community-contributed pack submission process

Tasks

  • Agree on manifest and storage contract
  • - [ ] Implement backend endpoint: list available packs + download pack
  • - [ ] Implement frontend loader: download, verify, cache, load
  • - [ ] Implement fallback mechanism: selected locale → English → Chinese
  • - [ ] Restructure id-ID as the first installable pack
  • - [ ] Update check-i18n.cjs to validate pack format

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions