This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
4) Translations management
Rémi Dupré edited this page Jul 12, 2022
·
5 revisions
Erdapfel's js and jsx files contain strings that can be translated. The source strings are in English. We translate them in BR (breton), CA (catalan), DE (german), ES (spanish), FR (franch) and IT (italia).
Singular strings are used like this:
const { _ } = useI18n();
_('string', 'context')
Plural strings are used like this:
const { _n } = useI18n();
_n('%d item', '%d items', itemCount, 'context')
Once the source strings have been pushed and merged on the main (master) branch, they can be translated using Poedit.
- Disable MO file generation: File > Settings > disable the MO checkbox
- Add the xgettext
--no-location
parameter in Translation > Settings > Translation Properties > Advanced Extraction Settings
- Check the paths in Translation > Settings > Paths The correct paths are: /src, /views, /public/build/javascript/bundle.js and /public/build/javascript/map.js (they should already be correct, if not you can select the correct folders again)
- Update the PO file by clicking "Update from the code":
- Show the untranslated strings first using the Display > "Errors first" / "Untranslated first" options:
- Fill all the blanks in the PO files (except en.po) using your native tongue or DeepL
- Create a branch with these edits, push the updated PO files, and open a Pull Request on Github
- A teammember will merge the PR.