Translations · odoo/odoo Wiki · GitHub
Skip to content

Translations

Martin Trigaux edited this page Apr 15, 2024 · 46 revisions

Translating Odoo

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. Please read the general Transifex Documentation before writing your first translation, as it includes very important advice for new translators.

Translating with Transifex

Transifex provides a web-based translation interface, which can be used to translate. Its main features are:

  • Web-based, accessible everywhere for anyone, and does not require any developer skill
  • Offers a Translation Memory that automatically translates similar terms present in other versions and modules
  • Provides collaborative reviewing features, and allows marking the terms that one thinks should be reviewed by other translators
  • Automatically synchronized with the source code files (.pot) containing the translations, removing the the need for manual updates

transifex-join

After registering on Transifex, you can access the translations for any Odoo project on the organisation page

Links to the current Odoo translations:

transifex-project

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

Translators submit translation suggestions for any language and need the validation of reviewers before their translations are used in Odoo.

If your language is not yet present in the list of languages and you are motivated enough to manage the team, you can request the addition of this language (link on the list of languages). Do not request the addition of a localized version for the main country (e.g. no need for a fr_FR or de_DE) or localized version of a language (e.g. fr_BE). We accept localized versions of a language but only to store the terms different than the master language (e.g. fr) and this should be submitted through a pull request on this repository.

If no Coordinator is assigned to a language team, contact us to require the appointment of a coordinator.

How to determine where a term comes from when in Odoo?

Install the module named Transifex Integration in your Odoo database. This adds a column Transifex in the tree view of the translations.

odoo-translate-transifex-fs8

If a specific term from a view (e.g. a label) can not be found, use the action Technical Translation from the view where the term is present to access the list of translations from the displayed fields.

technical-translation-fs8

How to determine where a term comes from when in Transifex?

For a better translation, it is often useful to know the context in which a term is used. While this part requires more technical knowledge of Odoo, it can be useful to check Transifex indicates the source of the term. For this, check the More info section in the interface.

transifex-occurence

Resource: the module the term comes from, in above example, the "sale" module.

Occurrence: the reference (or list of references) where this term is used. Here is a few example of references used in Odoo 9.0:

  • model:ir.model.fields,field_description:purchase.field_purchase_order_date_order the label of the field date_order from a purchase order
  • model:ir.ui.view,arch_db:sale.view_order_form the content of the view of the sale order
  • model:ir.ui.menu,name:account.menu_finance_entries: the name of the finance menu
  • model:ir.filters,name:crm.filter_usa_lead: the search filter for leads from USA
  • model:ir.model.fields.selection,crm.selection__crm_lead2opportunity_partner__name__convert one the possible value in a selection field of CRM
  • code:addons/hr/models/hr .py:0: a text inside the python code (e.g. an error message for the user). The path addons/hr/models/hr.py:119 indicates the file of hr module
  • code:addons/project/static/src/js/project_form .js:0 _a text inside a javascript file (e.g. button labels, dynamic content).

But in the end, the best way is often to check on a Odoo instance directly. To do so, the easiest is probably to use the Runbot, where you can test the different Odoo installations with all modules installed.

Can I use my own translation software?

Yes! You can use Transifex Client to sync your .po files with our sample .tx/config file. This will allow you to get and send the translations of all resources (modules) at once.

Typical commands:

  • tx pull -r "odoo-8.*" -l fr --mode reviewed # get all reviewed translations for Odoo 8.0 in French
  • tx pull -s -r "odoo-7.*" # get all source terms (.pot) for Odoo 7.0
  • tx push -s -r "odoo-8.crm" -l es # send my Spanish translation suggestions for the crm module for Odoo 8.0

Please refer to the Transifex client documentation for more information.

When will my translations appear in the software (or in GitHub)?

The translations are synchronised from Transifex to Github every Sunday. The availibility of the translation depends of the way your Odoo instance is installed:

  • Hosted on odoo.com: automatically done on Monday or Tuesday
  • Source install: fetch the latest source from github
  • Packaged install: download the latest nightly builds on Monday

After updating the installation, an administrator has to reload the language in the menu Settings > Languages > Add Language. update-translation

Is it possible to modify source terms in Odoo?

We prefer not to do it for stable Odoo versions at all. Changing the source terms (even a simple typo) would discard every existing translation for this term. It is okay to make a Pull Request on GitHub for changing source terms in the development version (master), however.

Adding new terms when suggesting fixes in stable versions

As part of a fix, it is sometimes necessary to introduce new error messages or terms that will appear in the UI of Odoo (e.g. automatic emails, etc.).

For such cases, the internationalization files should be manually updated to include the new terms. This should be ideally done manually to avoid a large diff in the master terms file of the module(s) in question.

For example, if you modify the sale module through a bugfix that raises a new error message:

# some code
if order.state == 'draft':
    raise UserError(_('Sorry, this is not allowed for draft orders.'))

then that same bugfix pull request should include the following modification in the sale/i18n/sale.pot terms file:

#. module: sale
#: code:addons/sale/models/sale.py:456
#, python-format
msgid "Sorry, this is not allowed for draft orders."
msgstr ""

Note that source terms are sorted alphabetically in the .pot file and should remain so to avoid duplicates. Make sure to include your term at the correct place.

How to translate my chart of account into multiple languages?

A localization module (named l10n_*) contains the list of accounts, journals, taxes in a defined country. Most terms (journals, taxes names...) present into the localizations are not translatable and the remaining ones (e.g. report names) are usually not in English and not translated (it's ok to just copy the source in your translation).

Some countries (e.g. Belgium or Switzerland) have multiple official languages and these objects can be translated in some defined languages (check l10n_be or l10n_ch for practical implementation detail). The translations are however not published on Transifex as should be translatable only in the country's official languages. The translations files are located inside a i18n_extra/ folder in the module tree.

  • Find or create the translation inside the localization i18n_extrafolder (e.g. the Dutch translations of l10n_be will be in addons/l10n_be/i18n_extra/nl_BE.po). If not present a template file (.pot) should be present to create the new translation.
  • Open the file using an external translation tool (e.g. Poedit) and start translating
  • Once the translation done, create a Pull Request to submit your translations

Translations License

As was the case on Launchpad previously, Odoo translations are contributed and published under the Simplified BSD License. By contributing translations to the Odoo project you agree to publish them under the terms of the license. This does not affect your original copyright on the translations. The text of the license is as follows:

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of Odoo S.A.