@@ -126,11 +126,52 @@ Workspace Scripts
126126Internationalization
127127====================
128128
129- Please see refer to the ` frontend-base i18n howto `_ for documentation on
130- internationalization .
129+ For general information on how internationalization works in Open edX frontends,
130+ refer to the ` frontend-base i18n howto `_ .
131131
132132.. _frontend-base i18n howto : https://github.com/openedx/frontend-base/blob/master/docs/how_tos/i18n.rst
133133
134+ Pulling Translations
135+ --------------------
136+
137+ Translated strings for each package listed under ``atlasTranslations `` in
138+ ``package.json `` are hosted in the `openedx-translations `_ repository. To fetch
139+ them before building the site, run::
140+
141+ npm run translations:pull
142+
143+ This downloads the message files into ``src/i18n/messages/ `` (one subdirectory
144+ per package) and then generates ``src/i18n/messages.ts ``, which aggregates
145+ everything for the runtime. Both the downloaded files and the generated module
146+ are gitignored, so translations must be pulled as part of any build or deploy
147+ pipeline.
148+
149+ If translations have not been pulled, the build still succeeds because the
150+ webpack i18n fallback plugin supplies an empty module at build time. The site
151+ will simply use the default English strings baked into each component.
152+
153+ .. _openedx-translations : https://github.com/openedx/openedx-translations
154+
155+ Site-level Translation Overrides
156+ --------------------------------
157+
158+ To override or supplement translations provided by packages, add JSON files to
159+ ``src/i18n/site-messages/ ``. Each file is named after a locale
160+ (e.g., ``es_419.json ``, ``fr.json ``) and contains key-value pairs where the key
161+ is a message ID and the value is the replacement string::
162+
163+ src/i18n/site-messages/
164+ es_419.json
165+ fr.json
166+
167+ When ``translations:pull `` runs, it regenerates ``src/i18n/messages.ts `` with
168+ site-messages included *last * in the array. At runtime, all message sources are
169+ merged in order, so site-messages entries take precedence over the corresponding
170+ package translations.
171+
172+ The ``translations:pull `` command never deletes ``src/i18n/site-messages/ `` -
173+ only ``src/i18n/messages/ `` is cleared and re-fetched each time.
174+
134175License
135176*******
136177
0 commit comments