تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
4963 أدوات العرض

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.

الصورة الرمزية
إهمال
أفضل إجابة

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>


الصورة الرمزية
إهمال
أفضل إجابة

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.

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
4
يوليو 24
6765
2
يوليو 24
3641
4
يونيو 24
25418
3
أبريل 24
2347
1
فبراير 24
3687