How to translate ModulesCreate the language- You must first create the language in "Administration>Localization>Languages" if it doesn't exist.
We follow the RFC 4646 for the code naming.
Here is a validator.
Set the language translatable- You must check the translatable checkbox of the language to be able to translate it.
Update installed modules- You must update the installed modules if you are not working on a new language.
Update report translations- You must update the translations records for the reports with the wizard "Administration>Localization>Set Report Translations".
Clean translations- You must clean the translations that are no longer needed with the wizard "Administration>Localization>Clean Translations".
Synchronize translations for the language- You must synchronize the translations records for the language with the wizard "Administration>Localization>Synchronize Translations".
This may take some time depending on the number of modules you have installed.
- Now you can translate the terms.
The fuzzy field is checked when the source term have been changed since the last update, so you must verify that the translation is always correct and uncheck the fuzzy field.
Hint:
- The task can be facilitated by filtering on various fields - module, src, value...
- For a convenient display of multiline items just click on "Form>Switch View". You simply move between the items using "Form>Next" / "Form>Previous".
Export translations- You must now export the translation with the wizard "Administration>Localization>Export Translations" and save the file in the module directory.
- Select language and module name to export
- Click on icon "Save as..." and select module's repository
- The name of the file must be the language code with the extension ".csv" (e.g. de_DE.csv).
- You must also declare the fileneme in the __tryton__.py of the module using the key 'translation' (see for an example in ir module).
Before updating a module or the whole database, changes should be exported, because otherwise your changes can be overwritten with old values from old csv file.
Submit translationsHow to translate Tryton clientFor the client translation we use Babel. Change directory- Change to the tryton client directory.
Prepare po file- Extract translation strings into the translation template file:
python ./setup.py extract_messages --output-file share/locale/tryton.pot Update the translation file with the generated translation template: python ./setup.py update_catalog -l de_DE -i share/locale/tryton.pot -o share/locale/de_DE/LC_MESSAGES/tryton.po Edit po file- Translate the missing and fuzzy terms in the translation file (share/locale/de_DE/LC_MESSAGES/tryton.po) with your favorite editor (example: poedit).
Generate mo filepython ./setup.py compile_catalog -v --directory share/locale/ --locale de_DE Hint:
if you are using poedit, this is already done automatically
Submit translationsHow to translate DocumentationFor the documentation translation we use translate-toolkit Change directory- Change to the doc directory of the repository.
Prepare po files- For each rst file extract translation strings into translation template file:
txt2po index.rst index.pot -P - Update the translation files with the generated translation templates:
pot2po index.pot de_DE/index.po -t de_DE/index.po Edit po files- Translate the missing and fuzzy terms in each translation files (de_DE/index.po) with your favorite editor.
Generate rst filespo2txt de_DE/index.po de_DE/index.rst -t index.rst Never edit directly the *.rst files
Submit translations- the files to submit are *.pot, de_DE/*.po and de_DE/*.rst
- see HowtoContribute
|