How it works...

Users can have their own language and time zone preferences. The former is used to translate user interface text into the chosen language and apply local conventions for float and monetary fields.

Before a language is made available for the user to select, it must be installed with the Load a Translation feature. The list of available languages can be seen with the Settings|Translations|Languages menu option. The ones with the active flag set are installed.

Each Odoo add-on module is responsible for providing its own translation resources that should be placed inside an i18n subdirectory. Each language's data should be in a .po file. In our example, for the Spanish language, the translation data is loaded from the es_ES.po data file.

Odoo also supports the notion of base language. For example, if we have an es.po file for Spanish and an es_MX.po file for Mexican Spanish, then es.po is detected as the base language for es_MX.po. When the Mexican Spanish language is installed, both data files are loaded; first the one for the base language and then the specific language. Thus, the specific language translation file only needs to contain the strings that are specific to the language variant, which is Mexican Spanish in our example.

The i18n subdirectory is also expected to have a <module_name>.pot file, providing a template for translations and containing all the translatable strings. The Exporting translation strings to a file recipe of this chapter explains how to export the translatable strings to generate this file.

When an additional language is installed, the corresponding resources are loaded from all installed add-on modules and stored in the Translated Terms model. Its data can be viewed (and edited) within the Settings|Translations|Application Terms|Translated Terms menu option (note that this menu is only visible in developer mode).

Translation files for the installed languages are also loaded when a new add-on module is installed or an existing add-on module is upgraded.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset