diff --git a/addons/website/i18n/website.pot b/addons/website/i18n/website.pot index 36425e25623..ca7fa4c4a86 100644 --- a/addons/website/i18n/website.pot +++ b/addons/website/i18n/website.pot @@ -9377,6 +9377,13 @@ msgstr "" msgid "Translate Attribute" msgstr "" +#. module: website +#. odoo-javascript +#: code:addons/website/static/src/components/translator/translator.js:0 +#, python-format +msgid "Translate Selection Option" +msgstr "" + #. module: website #. odoo-javascript #: code:addons/website/static/src/components/translator/translator.js:0 diff --git a/addons/website/static/src/components/translator/translator.js b/addons/website/static/src/components/translator/translator.js index 873319afe59..20b6144d45e 100644 --- a/addons/website/static/src/components/translator/translator.js +++ b/addons/website/static/src/components/translator/translator.js @@ -4,7 +4,7 @@ import { WebsiteEditorComponent } from '../editor/editor'; import { WebsiteDialog } from '../dialog/dialog'; import localStorage from 'web.local_storage'; -const { useEffect, useRef, Component } = owl; +const { useEffect, useRef, Component, xml } = owl; const localStorageNoDialogKey = 'website_translator_nodialog'; @@ -45,6 +45,37 @@ export class AttributeTranslateDialog extends Component { AttributeTranslateDialog.components = { WebsiteDialog }; AttributeTranslateDialog.template = 'website.AttributeTranslateDialog'; +// Used to translate the text of ` + +`; + export class TranslatorInfoDialog extends Component { setup() { this.strongOkButton = this.env._t("Ok, never show me this again"); @@ -187,6 +218,23 @@ export class WebsiteTranslator extends WebsiteEditorComponent { } }); + // Hack: we add a temporary element to handle option's text + // translations from the linked `s since we use `.o_translation_select` + // elements to handle translations. + + select { + display: none !important; + } + > div:not(:last-child) { + border-bottom: inherit; + } + } +} //------------------------------------------------------------------------------ // Website Animate diff --git a/addons/website/static/src/scss/website.wysiwyg.scss b/addons/website/static/src/scss/website.wysiwyg.scss index d64292ea0a8..1c7fa607db1 100644 --- a/addons/website/static/src/scss/website.wysiwyg.scss +++ b/addons/website/static/src/scss/website.wysiwyg.scss @@ -22,13 +22,17 @@ } html[lang] > body.editor_enable [data-oe-translation-state] { - background: rgba($o-we-content-to-translate-color, 0.5) !important; - - &[data-oe-translation-state="translated"] { - background: rgba($o-we-translated-content-color, 0.5) !important; + &, .o_translation_select_option { + background: rgba($o-we-content-to-translate-color, 0.5) !important; } - &.o_dirty { + &[data-oe-translation-state="translated"] { + &, .o_translation_select_option { + background: rgba($o-we-translated-content-color, 0.5) !important; + } + } + + &.o_dirty, .o_option_translated { background: rgba($o-we-translated-content-color, 0.25) !important; } } diff --git a/odoo/tools/translate.py b/odoo/tools/translate.py index dbc1f9b0208..b88854c9ac5 100644 --- a/odoo/tools/translate.py +++ b/odoo/tools/translate.py @@ -147,7 +147,7 @@ TRANSLATED_ELEMENTS = { 'abbr', 'b', 'bdi', 'bdo', 'br', 'cite', 'code', 'data', 'del', 'dfn', 'em', 'font', 'i', 'ins', 'kbd', 'keygen', 'mark', 'math', 'meter', 'output', 'progress', 'q', 'ruby', 's', 'samp', 'small', 'span', 'strong', 'sub', - 'sup', 'time', 'u', 'var', 'wbr', 'text', + 'sup', 'time', 'u', 'var', 'wbr', 'text', 'select', 'option', } # Which attributes must be translated. This is a dict, where the value indicates