summaryrefslogtreecommitdiff
path: root/addons/web/static/src/xml
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2019-09-20 12:46:07 +0000
committerMartin Trigaux <mat@odoo.com>2019-09-24 15:52:55 +0000
commit2471ee506f38f5ca54d7bd54084b0ac3d74abeae (patch)
tree0f40dc99590d0c4d93da16e57ef3e170cb1de23b /addons/web/static/src/xml
parent5a9cb644147ee891e1afb3ddf88e052cdda7fb04 (diff)
[FIX] web: translate html fields
This commit fixes: - body of a email.template in a small field - translation of website_description of a product does not show the source of the translation - translation of website_description of a product shows the full content for the current language HTML fields are typically fields with longer of content. If the field is an HTML field, it should be displayed in a textarea, like the text fields. Most of HTML fields are split in meaningful chunks of content (using xml_translate or html_translate method). For these fields, the source must be displayed. Also sort the entries on the source to have a consistent order closes odoo/odoo#37215 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Diffstat (limited to 'addons/web/static/src/xml')
-rw-r--r--addons/web/static/src/xml/translation_dialog.xml9
1 files changed, 6 insertions, 3 deletions
diff --git a/addons/web/static/src/xml/translation_dialog.xml b/addons/web/static/src/xml/translation_dialog.xml
index 32e2a036e45..7ee3e2f4a8b 100644
--- a/addons/web/static/src/xml/translation_dialog.xml
+++ b/addons/web/static/src/xml/translation_dialog.xml
@@ -2,10 +2,13 @@
<templates id="template" xml:space="preserve">
<div t-name="TranslationDialog" class="o_translation_dialog">
<div class="row" t-foreach="widget.data" t-as="term">
- <div t-att-class="widget.currentInterfaceLanguage == term.lang ? 'col-12 col-lg-3 o_language_current' : 'col-12 col-lg-3'">
+ <div t-attf-class="col-12 #{widget.showSrc ? 'col-lg-2' : 'col-lg-3'} #{widget.currentInterfaceLanguage == term.lang ? 'o_language_current' : ''}">
<t t-esc="term.langName"></t>
</div>
- <div class="col-12 col-lg-9 translation">
+ <div t-if="widget.showSrc" class="col-12 col-lg-3 source">
+ <t t-esc="term.source"></t>
+ </div>
+ <div t-attf-class="col-12 #{widget.showSrc ? 'col-lg-7' : 'col-lg-9'} translation">
<input t-if="!widget.isText" type="text"
class="o_field_char o_input"
t-att-value="term.value"
@@ -14,7 +17,7 @@
<textarea t-if="widget.isText"
t-esc="term.value"
t-att-data-id="term.id"
- rows="5"
+ t-att-rows="widget.showSrc ? 2 : 5"
class="o_field_text o_field_translate o_field_widget o_input">
</textarea>
</div>