0
votes

I made a RML report, which is working perfect. In the translation files, the strings which are in the RML file are included, so I can translate the content of the report. But there's one case in which strings aren't 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 be translated.

I saw this post:

Translation of strings in python code in RML reports

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

Anyone can help me, please?

1

1 Answers

0
votes

For translation you must have to insert text in .po file. You check out under i18n folder for core modules like sale, purchase, account.

  1. Load the translation under this path Setting => Translations => Load a Translation

  2. Now assign language to the partner.

  3. Add text value in .po file

  4. Based on partner language it will change the text label like here is sample code of .rml file

    <story>
    <para style="terp_default_8">[[repeatIn(objects,'o')]]</para>
    <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>
    

Hope this will help you.