Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I made several reports using webkit in Odoo 7 and packaged them in a module. In these reports I inserted literal strings like this:
I now would like to translate all these strings to different languages. If I export the translation for the module using the translation export wizard under "Settings" I just get an empty file (PO or CSV). Am I missing something?
I managed to do it, although I'd be glad if somebody may shed some light on why you have to do it this way and what other possibilities there may be. Anyway, if anybody faces the same problem, here is my solution:
Assuming that your mako templates are stored in your module directory 'my_module' in the subfolder 'reports':
You can create the PO file which holds the translation strings (assuming you are on Linux and that your target language is German) using xgettext.
$ xgettext my_module/reports/*.mako -o de.po -L Python
This will create the file de.po, which you now have to edit further.
- 1. At the top of each entry generated by xgettext, add a line indicating the name of your module as shown below.
- Edit the msgstr to match your target language.
- Prepend 'addons/' to 'my_module' as shown below even if your module won't be placed in an 'addons' directory.
#. module: my_module
msgid "Shipping address"
Include all the files in "my_module/i18n" and they should be imported automatically on installation/upgrade of your module. You can also edit the translations under the 'Translated Terms' section in the web interface.
HI Robin Hafen +1 for you. I have no enoght karma to comment your answer directly. Your approach result for me. I create a new en.po file with the mako terms and then I cut and copy the terms I need to the .pot in my module.
Also, I have to say that I use an extra parameter for the xgettext command "--from-code=UTF-8".
I hope this could be helpfull.
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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 8/31/14, 4:16 PM|
|Seen: 1309 times|
|Last updated: 3/16/15, 8:10 AM|