Odoo Help


2 Answers

Yannick Vaucher Switzerland

--Yannick Vaucher--

| 5 7 11
Lausanne, Switzerland
--Yannick Vaucher--

Yannick Vaucher Switzerland
2/22/13, 10:11 AM

You might need to set the language first if you didn't.

For exemple in invoice_webkit module in account_invoice.mako we take the invoice partner language.

%for inv in objects:
<% setLang(inv.partner_id.lang) %>

And then you use the ${_("my text")} format.

For your translations, I'm not sure OpenERP add automatically those in the database when synchronizing it.

If you make them in a .po file, it should look like this:

#. module: invoice_webkit
#: report:addons/invoice_webkit/report/account_invoice.mako:129
msgid "PRO-FORMA"
msgstr "PRO-FORMA"

Otherwise, you might have to add them by hand in the translations.

  • Source: PRO-FORMA
  • Translation Value: PRO-FORMA
  • Translated field: addons/invoice_webkit/report/account_invoice.mako
  • Language: French
  • Type: Report / Template
Max Belgium
2/22/13, 10:12 AM

Hi, thanks for your reply. I should have said that I have already done this (I have updated my answer with this information)

Camptocamp SA Switzerland
2/22/13, 10:24 AM

As your translations might not having been added by the synchronise translation wizard, as it certainly ignores ".mako" files I added some more info. Have you that kind of translation in your database or only for fields?

Max Belgium
2/22/13, 10:25 AM

Thanks again for the information. Unfortunately I am doing this on the SaaS, therefore there is no mako file path - I am saving the mako code directly in the report_webkit_mako text field. In this case, what do I put in the "Translated Field" field? Also, I assume Language is the target language, as it is assumed everything has its source as english?

Camptocamp SA Switzerland
2/22/13, 10:26 AM

Yes the Language is the target language, what is in source is always in english.

Max Belgium
2/22/13, 10:30 AM

Thanks, and what goes in the "Translated Field" field when using the report_webkit_mako field instead of a file path?

Camptocamp SA Switzerland
2/22/13, 10:32 AM

On SaaS, okay, try to add the translation by hand but then instead of path in Translated Field try to set the id of the report.

Max Belgium
2/22/13, 11:47 AM

So to sum up, the problem was fixed by manually creating a Translation Term with Type = 'Report/Template', Field Name = 'model_name', Resource_ID = ''. Thanks very much for your help

Agile Business Group sagl, Franco Tampieri Switzerland
3/20/13, 5:41 AM

Hi Yannick, I noticed that in some cases the translated terms of a webkit report and included in the file "po" in the application i18n are not reported in the press, but are either replaced with a generic term related to the object or are not translated. If I go to check out the lines of the translation, however, are present, what would it be?

Camptocamp SA Switzerland
3/20/13, 9:10 AM

Hello User 12396 :)

I'm not sure to understand your question. Could you give me an exemple of an existing line that has a translation line and not being present in po file ?

Agile Business Group sagl, Franco Tampieri Switzerland
3/21/13, 6:24 AM

I'm sorry, maybe I did not explain properly, but I often report on webkit that replace the standard reports such as the sale_order or account_invoice, where po when I export the file and translate terms such as 'VAT' then reloading the translation and do the update of the module and the translation I is again the old translation of the label, in order to get my maybe I should change the label 'VAT' in 'VAT' and after repeating the whole process this work. What could it be? But if you know a better way to make tranlation files please explain to me. Best Regards Franco

Camptocamp SA Switzerland
4/2/13, 10:17 AM

This seems to be a different issue than the one in this question. It can be a bug that you should report on launchpad or you could also open a new question there you will have enough place to explain step by step what the problem is. Here is a question about how to generate po file it might help.

Agile Business Group sagl, Franco Tampieri Switzerland
4/3/13, 10:31 AM

Thank you Yannik, I take a look at your link

Katherine Zaoral Argentina
12/4/14, 11:46 AM

HI Max , Indeed the approach of configuration is the one given in the Yannick Vaucher answer the recall now is how to generate the .po with the terms in the mako file.

Making this by hand is too tedious. To generate the .po file yo can use xgettext command like the example given in https://www.odoo.com/forum/help-1/question/how-to-export-translation-strings-from-mako-templates-61575.

After generate the po you can merge this terms with the .pot of your module to complete them.

I hope It helps.

Ask a Question
Keep Informed
2 follower(s)
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