The simplest way to translate is to use the translation feature provided by the web client. These translation strings are stored in the database and can later be exported to a .po
file, either to be included in an addon module or just to later be imported back manually.
Text fields can have translatable content, meaning that their value will depend on the current user's language. We will also see how to set the language-dependent values on these fields.
We need to have the Developer Mode activated. If it's not, activate it in the Odoo About dialog.
We will demonstrate how to use translate terms through the web client using the User Groups feature as an example:
The Group name is a translatable field. Let's translate a record's value to the several languages installed:
Translated terms are stored in the database table for the model ir.translation
. The Technical Translation option in the Debug menu provides a quick access to those terms, in context with the currently selected view.
Similarly, the model fields with translatable content feature an icon to access the list of the installed languages and to set the appropriate value for each language.
Alternatively, the translation terms can be accessed from the Settings top menu, using the Translations | Application Terms | Translated Terms menu option. Here we can see all the terms available for our instance, but should need to use data filters to locate the terms we might be interested in.
Alongside the Translated Terms menu option, we also find the Synchronize Terms option. Selecting it will display a dialog window to provide the desired language, and will then launch the process to extract translatable strings from the installed addon modules and add any new ones to the Translated Terms table. It is equivalent to performing the Export Translation followed by the Import Translation steps described earlier.
This can be useful after changing some models or views, to have the new strings added so that we can translate them.
It can also be used to populate the strings from the en_US
default language. We can then make use of the translation terms to replace the original English texts with new ones, better for the end user's specific business vocabulary.