Localization for Elm as a pre-build phase
summary
Proposes generating per-language Elm builds at compile time by swapping a translation directory with a symlink trick, so localized strings become Elm constants or tiny functions and incomplete translations fail to compile. Ships an npm helper elm-i18n that switches and compiles quickly by only rebuilding changed translation modules, and exports/imports CSV, PO and PullString files for translators. Requires a page reload to change language but enables phased rollouts, typesafe text, pseudo-language testing and easy collaboration with external translators.
AI-written summary · about
chapters (10)
- 0:00Introduction to Elm localization
- 1:06Runtime language switching drawbacks
- 4:19Compile-time localization approach
- 5:45Symlink trick for language switching
- 8:19Tooling for CSV and PO export
- 11:09Runtime vs compile-time trade-offs
- 12:13Advantages of compile-time localization
- 15:30Future improvements and features
- 16:35Live demo of language switching
- 18:46Q&A and resources
