Odoo Help


How to fill a .po file properly ?

on 1/14/14, 11:19 AM 1,920 views

Hi !

I'm trying to translate my own module. Some sentences are in the code, and aren't included in the output file while I do Settings > Import/Export > Export Translation. So I'm trying to include these sentences manually.

So far, I've just achieved including them in the database. But something is wrong, because they are not used by openERP. I mean, the sentences are not translated when I use my module, but I can see the sentences in the ir_translation table.

A sample of my i18n/fr.po file:

#. module: shipping
#: view:shipping_rule:0
msgid "Shipping rule error"
msgstr "Erreur de règle de frais de port"

I think the second line can do the trick, but I don't know the syntax. Someone know how to do that ?

Thanks !


Getting the translations to update and show up seems to be a bit hit or miss, but this is how I have got everything to show up, except for new states:

  1. Save all your module's xml and py files, and remember to use from tools.translate import _ in python
  2. If you haven't already, enable the language you want to translate to from Settings -> Load a translation
  3. Restart the server with the --update=my_module_name flag
  4. Go to Settings->Export translation. Choose the language you want to translate to, select PO as the file format, and pick the module you want to translate.
  5. Save the result to my_module_name/i18n/fi.po (replace fi with your proper language code)
  6. Edit the .po file with a text editor and add the translations there, don't touch anything else than just the msgstr rows. Save the file.
  7. After you have translated everything, restart the server with --update=all flag. Sometimes doing this twice has been required.
  8. Enable the new language for your user at Settings -> Users -> (username) -> Language
  9. Switch to that user and press Ctrl+R to refresh the UI

Hopefully this works for you as well.

Hi ! thanks for your answer. 1. In fact, I use from openerp.tools.translate import _ 2. I'm setting my language at the database creation, so I think I don't need it. But perhaps I'm wrong. 3. Again, I do not use this method. Instead, I use sudo service openerp-server restart , then in the interface I just update my module with the button. 4.5. I do exactly the same. 6. Here ! The problem is here ! When I do that, all the sentences are not in the file.

on 1/15/14, 9:30 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 1/14/14, 11:19 AM
Seen: 1920 times
Last updated: 8/15/16, 4:49 AM