Skip to Content
Menu
This question has been flagged
1 Reply
3587 Views

Dear all,

I have a custom module and would like to translate the terms of a report.
Unfortunately formatting is always included.

So in Odoo my translated terms looks like this as source: <span style="font-weight:bold">Tier Price</span>

Now I am wondering if this is the right way of doing this, or if I did something wrong?


Thanks in advance!



Avatar
Discard
Best Answer

Hi Christian,

If you have an element in your report that is within a span you will indeed see the <span></span> element itself being included in the translation terms. This is normal and desired behaviour. You can actually see examples of this in the official Odoo code too. Have a look at the "Disc %" span on the sale order report at https://github.com/odoo/odoo/blob/8f9e1e40a32748e576084320b4f9a4c1165b7a10/addons/sale/report/sale_report_templates.xml#L79 and then look at the source terms at https://github.com/odoo/odoo/blob/8f9e1e40a32748e576084320b4f9a4c1165b7a10/addons/sale/i18n/nl.po#L325-L328

You'll see that the term also has the <span> in the translation term set:

#. module: sale
#: model_terms:ir.ui.view,arch_db:sale.report_saleorder_document
msgid "Disc.(%)"
msgstr "Krt.(%)"

In your example you've added your CSS style into the element itself though. It is cleaner to create a SCSS file, adding the CSS in there and setting a class on the element. You're doing translations correct anyways.

Regards,

Yenthe

Avatar
Discard
Related Posts Replies Views Activity
4
Jul 24
5041
2
Jul 24
492
4
Jun 24
22353
3
Apr 24
591
1
Feb 24
845