Within Odoo source code, all translatable terms (master terms) are written in international English (language code en_US). The administrator of an Odoo instance can load additional languages from the official translations. As a result, the corresponding translations of all installed modules will be loaded in the database, and used to replace the default English terms in the application interface for users changing their preferred language.
The easiest way to translate Odoo is to use the dedicated Translation interface on Transifex.
Gengo, its another web based translation interface for Odoo which helps to translate the terms of Website portion.
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
Translation engine in odoo
1. Translation Engine in Odoo
Ranjit Pillai (rpi-odoo)
Jr. Application Engineer
Tiny ERP Pvt. Ltd.
2. Agenda
● Architecture of Translation Engine
● Load Translation from po file
● Export Translation into pot file
● About Transifex
● Integrate Translation Web Service: Gengo
3. Architecture of Translation Engine
Odoo
Translation
Engine
(ir.translation)
po file pot file
Webpage/View
Transifex
(Translator)
Import/Load Export
Template FileTranslated File
Language
in context
Translated
View
UTW
TW
❖ UTW - Untranslated Words
❖ TW - Translated Words
4. Load Translation
● Load the particular language Settings>Translation>Load a Translation
● Change the user’s language Preferences>Language
Odoo
Translation
Engine
(ir.translation)
po file
Import/Load
Webpage/View
Language
in context
Translated
View
5. Export Translation into POT file
● To generate .pot file go to Settings>Translation>Import/Export>Export
Translation
Odoo
Translation
Engine
(ir.translation)
pot file
Export
6. Translation Export Types
Implicit exports
● Odoo automatically exports translatable strings like:
○ In non-QWeb views, all text nodes are exported as well as the content of the “string”, “help”,
“sum”, “confirm” and “placeholder” attributes.
○ In QWeb templates, all text nodes are exported except inside t-translation=’off’ blocks, the
content of the “title”, “alt”, “label” and “placeholder” attributes are also exported.
○ for class:`openerp.fields.Field`, unless their field is marked with “translate = False”: their “string”
and “help” attributes are exported.
○ If “selection” is present and a list (or tuple), it is exported.
○ help/error messages of `openerp.models.Model._constraints` and `openerp.models.Model.
_sql_constraints` are exported.
7. Translation Export Types(Cont.)
Explicit exports
● When it comes to more "imperative" situations in Python code or
Javascript code, Odoo cannot automatically export translatable terms so
they must be marked explicitly for export. This is done by wrapping a
literal string in a function call.
○ In Python, the wrapping function is :`openerp._`
■ title = _("Bank Accounts")
○ In JavaScript, the wrapping function is generally :`openerp.web._t`
■ title = _t("Bank Accounts")
8. Structure of translation terms
Note.pot
fr.po (inside note/i18n)
ir.translation
model
● Example of type = model:
9. Structure of translation terms(cont.)
Stock.pot
fr.po (inside stock/i18n)
ir.translation
model
● Example of type = code:
● Other types are selection, constraint and sql_constraint
10. Directory Structure of i18n in Odoo
POT files are basically the template files for PO files. It
will have all the translation strings (the msgstr parts) left
empty.
PO files are the files which contain the actual
translations. Each language will have its own PO file, for
example, for French there would be a fr.po file, for
german there would be a de.po and so on..
11. Translating Odoo with Transifex
● The easiest way to translate Odoo is to use the dedicated Translation
interface on Transifex.
● Transifex provides a web-based translation interface, which can be used
to translate.
● Translation Teams on Transifex
○ Every language is managed by a dedicated translation team. Anyone is free to join any translation
team at any point. Within each team, members can have different roles:
■ Translator: free to join, can submit translation suggestions (this is your role when you initially join a
team)
■ Reviewer: can approve translation suggestions from Translators.
■ Coordinator: can manage the members of the team and appoint Reviewers.
12. Translating Odoo with Transifex(cont.)
● Architecture of Transifex
<module>.pot Transifex
<lang>.po
<lang>.po
<lang>.po
<lang>.po
13. Gengo Translation
● Gengo is a web-based human translation platform.
● In Odoo, Gengo is used to translate the text of the Website.
Send Words
Receive Translated
Words