Language translation in Odoo is useful for translating text strings from one language to another language. Odoo language translation allows us to translate the text in our desired language without customizing the module. Odoo can use different languages for different users and can also can convert website pages into multiple languages. In this article i will explain how to add a translation for a module in Odoo.
Steps to be followed for a language translation in Odoo
- Step 1 :-> For adding a translation for a particular language in Odoo, that language should be installed in Odoo. In order to install a new language in Odoo you need load it in your Odoo, by following the below steps.
Go to Settings -> Translations -> Load a Translation
Click on menu Load a Translation a wizard will open.
Select the language you want to load in your Odoo and click on Load button.
Now that language will be installed in your Odoo. - Step 2 :-> Now you need to add a PO file for this language. PO file contain the actual translation of the module and each language has its own PO file, with the name as country code and extension as .po. In order to create a PO file for a particular language (French in our case) follow the below steps.
Go to Settings -> Import/Export -> Export Translation
Click on Export Translation and a wizard will open.
Select the Language for which you want to create PO file, select the File Format as PO File, select the applications you want to translate (Apps To Export).
Click on Export button.
- Step 3:-> After clicking on the Export button, a wizard will open and there will be a download link for the PO file which have been generated. Click on the link and download the PO file.
- Copy the downloaded file (fr.po) and paste it in the folder i18n (if not present create it) inside your module.
Open the PO file, there will be two keywords msgid and msgstr. msgid contains the actual text and msgstr contains the text you want to display for the translation. - Now the new language is ready and when the user choses a french language he can see the translated text. Similarly you can translate the text, label, words, strings etc to your required language.
- If you want to see the translated text in Odoo fields you can click on the translation icon displayed in the filed. I am considering an example of the Odoo products.
- The product name translated in all the loaded translations can be shown here.
That is it.!!!
If you liked this post, It would be very grateful if you write your opinions, comments and suggestions to keep the post updated and interesting.
Thank you!