mirror of
https://github.com/penpot/penpot.git
synced 2026-11-27 13:32:28 +00:00
📚 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:
parent
8490d2a18a
commit
7082d7bd61
@ -1,6 +1,8 @@
|
|||||||
# Frontend translations
|
# 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`.
|
- `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
|
## Keys and catalog sync
|
||||||
|
|
||||||
|
|||||||
@ -26,9 +26,7 @@
|
|||||||
## I18n
|
## 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.
|
- 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.
|
- For catalog edits, locale registration and generated translation assets see `mem:frontend/translations`.
|
||||||
- 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`).
|
|
||||||
|
|
||||||
## Performance
|
## Performance
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user