Summary
Bring DataLab-Web to feature parity with DataLab Qt on translations: a working i18n pipeline covering the React UI, the Sigima labels surfaced through Pyodide, and the result formatting (units, dates, numbers).
Motivation
DataLab Qt ships French and English translations end-to-end (UI strings via gettext, computation/result labels via Sigima's _() wrapper, documentation via sphinx-intl). DataLab-Web currently has no translation layer: every label is hard-coded in English.
Architectural impact
- Two translation domains to bridge: React/TS strings (probably FormatJS / LinguiJS / a thin
t() helper) and Sigima Python strings already wrapped with _() but with no .mo loader inside Pyodide.
- Bundle strategy: pre-bundle
.mo files in the Vite build vs lazy-loaded per locale; impacts startup size.
- Runtime locale switching: Sigima's
gettext lookup is process-global — switching language at runtime requires re-instantiating translation objects on both sides and re-rendering the React tree (including auto-generated DataSetForms, which currently snapshot labels at mount).
- Result formatting: numbers, units, dates rendered in tables and plot annotations need a locale-aware formatter (probably
Intl.*); coordinate with Sigima's existing formatting helpers.
- Documentation: a separate
sphinx-intl pipeline for the user guide, mirroring DataLab desktop.
Acceptance criteria
References
- DataLab desktop pipeline:
DataLab/.github/copilot-instructions.md → "Translations" section
- Sigima:
Sigima/sigima/locale/
Summary
Bring DataLab-Web to feature parity with DataLab Qt on translations: a working i18n pipeline covering the React UI, the Sigima labels surfaced through Pyodide, and the result formatting (units, dates, numbers).
Motivation
DataLab Qt ships French and English translations end-to-end (UI strings via
gettext, computation/result labels via Sigima's_()wrapper, documentation viasphinx-intl). DataLab-Web currently has no translation layer: every label is hard-coded in English.Architectural impact
t()helper) and Sigima Python strings already wrapped with_()but with no.moloader inside Pyodide..mofiles in the Vite build vs lazy-loaded per locale; impacts startup size.gettextlookup is process-global — switching language at runtime requires re-instantiating translation objects on both sides and re-rendering the React tree (including auto-generatedDataSetForms, which currently snapshot labels at mount).Intl.*); coordinate with Sigima's existing formatting helpers.sphinx-intlpipeline for the user guide, mirroring DataLab desktop.Acceptance criteria
t()helper (or equivalent) covers every user-facing TS string; ESLint rule (or grep guard) flags hard-coded literals insrc/components/..mofiles are loaded inside Pyodide and a language switch in the UI propagates toDataLabRuntime(re-runsbindtextdomainand refreshes cached catalogs)..pofiles.References
DataLab/.github/copilot-instructions.md→ "Translations" sectionSigima/sigima/locale/