📚 Correct translation asset guidance

Document generated locale modules and watcher behavior in the focused
translation memory instead of keeping stale UI instructions.

AI-assisted-by: gpt-6.1-terra
This commit is contained in:
Andrey Antukh 2026-11-24 08:12:52 +00:00
parent 8490d2a18a
commit 7082d7bd61
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,8 @@
# Frontend translations
- `frontend/translations/en.po` defines the keys and English text; `es.po` is a support reference, not the base. Add new keys to both in the same change. Locale conventions: `mem:frontend/translations/ca` and `mem:frontend/translations/ru`.
- Adding a supported locale requires updating both `frontend/src/app/util/i18n.cljs` (`supported-locales`) and `frontend/scripts/_helpers.js` (`langs`).
- `compileTranslations` generates `resources/public/js/translation.<locale>.js` modules from PO files. The app asset build generates them and the asset watcher regenerates them on translation changes; regeneration does not itself guarantee that the browser reloads an already imported module. Refresh the browser when checking changed text. `pnpm run translations` without a subcommand only shows the toolkit help.
## Keys and catalog sync

View File

@ -26,9 +26,7 @@
## I18n
- Translations must be resolved during render or render-time memoization, not at namespace load time. For static option lists, memoize inside render so locale changes still update labels.
- Translation files live in `frontend/translations/*.po`. Translation changes are bundled into `index.html`; refresh the browser after changing translations because there is no hot reload for translation strings.
- Run `pnpm run translations` from `frontend/` after adding/updating translation text.
- Adding a new supported locale requires updates in both `frontend/src/app/util/i18n.cljs` (`supported-locales`) and `frontend/scripts/_helpers.js` (`langs`).
- For catalog edits, locale registration and generated translation assets see `mem:frontend/translations`.
## Performance
@ -54,4 +52,4 @@
- For CLJS app UI, use `mem:frontend/testing`, `mem:frontend/compile-diagnostics`, and live browser/REPL checks when behavior depends on store or canvas state.
- For shared UI package changes, run the package build plus Storybook/component tests when relevant.
- For text editor changes, run `frontend/text-editor` tests and refresh/copy WASM artifacts if render-wasm output is involved.
- For text editor changes, run `frontend/text-editor` tests and refresh/copy WASM artifacts if render-wasm output is involved.