Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
4746 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
4
jul 24
6451
2
jul 24
2136
4
jun 24
24949
3
abr 24
2037
1
feb 24
2424