This question has been flagged
2 Replies
2816 Views

When I run Generate missing terms, Odoo generates text strings with HTML tags around them.

For example, I have a template

<div>
    <span>Invoice</span>
</div>

I would expect Odoo to generate Invoice as translation source, but it generates entire <span>Invoice</span>. It confuses our translator and makes it more difficult to translate.

If I attempt to correct the translation source value to clean text without tags, the translation does not work any more - Odoo does not recognize it.

How to prevent this from happening? How to get clean text strings as translation sources for view templates?

Odoo is v13, by the way.

Avatar
Discard
Best Answer

You can do the following

1. in report templates (you don't have t-directives), but you can use divs with inline class or style="display: inline-block;"

(Note: I try to edit this over and over again, but < and > keep disappearing)

< div >
< div class="oe_inline" >Invoice< /div>
< /div >

In qweb templates and reports, you can add a t-if="True"

< div >
< span t-if="True" >Invoice< /span>
< /div >
This works, too: < span t-attf-class="" >Invoice< /span>


Avatar
Discard
Best Answer

Hello,

for html fields there is no possibility to get Source without html tags.
What you could do: switch your language in user to specific language and edit the html field in the editor.

If you have trnaslation sources from report or qweb views, there is also no way to get source without html tags.

Avatar
Discard