Odoo Help

Welcome!

This community 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.

2

How to translate strings in RML?

By
Juan Formoso
on 11/6/14, 12:29 PM 682 views

I made a RML report, which is working perfect. In the translation files the strings in the RML are included, so I can translate the content of the report. But there is one case in which strings are not recognized, therefore these can't be translated. I'm going to put an example:

Next line is working, "Category" is recognized by the translation files and I can translate it there.

<para style="terp_tblheader_General_Centre">Category</para>

Next one isn't working:

<para>[[ o.type == 'r' and 'Registration' or 'Deregistration' ]]</para>

That is the unique case in which strings are not being recognized. type is a selection field (which can take the values 'r' or 'd'), and I wrote that line to see in the report Registration (in case of type valueing 'r') or Deregistration (in case of type valueing 'd'). But Registration and Deregistration are not being recognized as words to translate.

I saw this post:

https://www.odoo.com/forum/help-1/question/translation-of-strings-in-python-code-in-rml-reports-1962

And I tried to write _('Registration') / _('Deregistration') and then _(Registration) / _(Deregistration) instead of 'Registration' / 'Deregistration', but in this case the string do not even appear in the report.

Anyone can help me, please?

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/6/14, 12:29 PM
Seen: 682 times
Last updated: 3/16/15, 8:10 AM