From 02461534d2b74410bcdfb5cccaac8157fe806127 Mon Sep 17 00:00:00 2001 From: Mohammed Basioni Date: Tue, 2 Apr 2024 18:54:44 +0000 Subject: [PATCH] [FIX] web, website: convert inline templates with text to regular templates. Strings within inline templates are not translatable, so we convert these templates into standard templates so that they can be. Task-3761551 closes odoo/odoo#162106 X-original-commit: 5b38d58db1bb7cacd2a5ffa195a3799f2645fdbb Signed-off-by: Louis Wicket (wil) Signed-off-by: Mohammed Basioni (basm) --- addons/web/i18n/web.pot | 27 ++++---- .../src/core/commands/command_items.xml | 12 ++++ .../src/core/commands/command_service.js | 15 +---- addons/website/__manifest__.py | 1 + addons/website/i18n/website.pot | 63 ++++++------------- .../src/components/dialog/page_properties.js | 13 +--- .../src/components/dialog/page_properties.xml | 13 ++++ .../fullscreen_indication.js | 13 ++-- .../fullscreen_indication.xml | 10 +++ 9 files changed, 78 insertions(+), 89 deletions(-) create mode 100644 addons/website/static/src/components/fullscreen_indication/fullscreen_indication.xml diff --git a/addons/web/i18n/web.pot b/addons/web/i18n/web.pot index f4bb5e3f63a..a07f7d26b0c 100644 --- a/addons/web/i18n/web.pot +++ b/addons/web/i18n/web.pot @@ -1782,6 +1782,7 @@ msgstr "" #. module: web #. odoo-javascript +#: code:addons/web/static/src/core/datetime/datetime_picker_popover.xml:0 #: code:addons/web/static/src/core/debug/debug_menu_items.xml:0 #: code:addons/web/static/src/core/debug/debug_menu_items.xml:0 #: code:addons/web/static/src/core/dialog/dialog.xml:0 @@ -1792,7 +1793,6 @@ msgstr "" #: code:addons/web/static/src/core/errors/error_dialogs.xml:0 #: code:addons/web/static/src/core/errors/error_dialogs.xml:0 #: code:addons/web/static/src/core/errors/error_dialogs.xml:0 -#: code:addons/web/static/src/core/errors/error_dialogs.xml:0 #: code:addons/web/static/src/core/file_viewer/file_viewer.xml:0 #: code:addons/web/static/src/core/install_prompt/install_prompt.xml:0 #: code:addons/web/static/src/core/model_field_selector/model_field_selector_popover.xml:0 @@ -5856,9 +5856,9 @@ msgstr "" #: code:addons/web/static/src/core/confirmation_dialog/confirmation_dialog.js:0 #, python-format msgid "" -"Ready to make your record disappear into thin air? Are you sure?\n" -"It will be gone forever!\n" -"\n" +"Ready to make your record disappear into thin air? Are you sure?\r\n" +"It will be gone forever!\r\n" +"\r\n" "Think twice before you click that 'Delete' button!" msgstr "" @@ -6810,6 +6810,7 @@ msgstr "" #. module: web #. odoo-javascript +#: code:addons/web/static/src/core/commands/command_items.xml:0 #: code:addons/web/static/src/webclient/user_menu/user_menu_items.xml:0 #, python-format msgid "TIP" @@ -6998,16 +6999,6 @@ msgid "" "browser console or server logs for details." msgstr "" -#. module: web -#. odoo-javascript -#: code:addons/web/static/src/core/errors/error_dialogs.xml:0 -#, python-format -msgid "" -"The style compilation failed, see the error below. This is an administrator " -"or developer error that must be fixed for the entire database before " -"continuing working." -msgstr "" - #. module: web #. odoo-python #: code:addons/web/controllers/export.py:0 @@ -8452,6 +8443,7 @@ msgstr "" #. module: web #. odoo-javascript +#: code:addons/web/static/src/core/commands/command_items.xml:0 #: code:addons/web/static/src/core/domain_selector/utils.js:0 #: code:addons/web/static/src/core/tree_editor/utils.js:0 #, python-format @@ -33431,6 +33423,13 @@ msgstr "" msgid "— press" msgstr "" +#. module: web +#. odoo-javascript +#: code:addons/web/static/src/core/commands/command_items.xml:0 +#, python-format +msgid "— search for" +msgstr "" + #. module: web #. odoo-javascript #: code:addons/web/static/src/core/emoji_picker/emoji_data.js:0 diff --git a/addons/web/static/src/core/commands/command_items.xml b/addons/web/static/src/core/commands/command_items.xml index 59b58904ceb..6a100df5b7f 100644 --- a/addons/web/static/src/core/commands/command_items.xml +++ b/addons/web/static/src/core/commands/command_items.xml @@ -1,5 +1,17 @@ + + + TIP — search for + + , + and + + + + + +
diff --git a/addons/web/static/src/core/commands/command_service.js b/addons/web/static/src/core/commands/command_service.js index 96c41939299..f2575cf7fb9 100644 --- a/addons/web/static/src/core/commands/command_service.js +++ b/addons/web/static/src/core/commands/command_service.js @@ -3,7 +3,7 @@ import { registry } from "@web/core/registry"; import { CommandPalette } from "./command_palette"; -import { Component, xml, EventBus } from "@odoo/owl"; +import { Component, EventBus } from "@odoo/owl"; /** * @typedef {import("./command_palette").CommandPaletteConfig} CommandPaletteConfig @@ -51,18 +51,7 @@ class DefaultFooter extends Component { this.props.switchNamespace(namespace); } } -DefaultFooter.template = xml` - - TIP — search for - - , - and - - - - - -`; +DefaultFooter.template = "web.DefaultFooter"; export const commandService = { dependencies: ["dialog", "hotkey", "ui"], diff --git a/addons/website/__manifest__.py b/addons/website/__manifest__.py index e815f74b3da..ed00569e3a8 100644 --- a/addons/website/__manifest__.py +++ b/addons/website/__manifest__.py @@ -197,6 +197,7 @@ 'website/static/src/components/fields/*', 'website/static/src/components/fullscreen_indication/fullscreen_indication.js', 'website/static/src/components/fullscreen_indication/fullscreen_indication.scss', + 'website/static/src/components/fullscreen_indication/fullscreen_indication.xml', 'website/static/src/components/website_loader/website_loader.js', 'website/static/src/components/website_loader/website_loader.scss', 'website/static/src/components/views/*', diff --git a/addons/website/i18n/website.pot b/addons/website/i18n/website.pot index 9baf6175f6e..b6915e0cc82 100644 --- a/addons/website/i18n/website.pot +++ b/addons/website/i18n/website.pot @@ -244,8 +244,6 @@ msgid "...and switch the timeline contents to fit your needs." msgstr "" #. module: website -#: model:website,contact_us_button_url:website.default_website -#: model:website,contact_us_button_url:website.website2 #: model_terms:ir.ui.view,arch_db:website.layout #: model_terms:ir.ui.view,arch_db:website.snippets msgid "/contactus" @@ -1448,11 +1446,6 @@ msgstr "" msgid "Access to this page" msgstr "" -#. module: website -#: model:ir.model.constraint,message:website.constraint_website_visitor_access_token_unique -msgid "Access token should be unique." -msgstr "" - #. module: website #: model_terms:ir.ui.view,arch_db:website.s_mega_menu_menus_logos #: model_terms:ir.ui.view,arch_db:website.s_mega_menu_odoo_menu @@ -5984,15 +5977,6 @@ msgid "" "or instead." msgstr "" -#. module: website -#. odoo-javascript -#: code:addons/website/static/src/components/resource_editor/resource_editor_warning.xml:0 -#, python-format -msgid "" -"If you need to add analytics or marketing tags, inject code in your header " -"or body instead." -msgstr "" - #. module: website #. odoo-javascript #: code:addons/website/static/src/components/resource_editor/resource_editor.js:0 @@ -6599,7 +6583,6 @@ msgstr "" #. module: website #: model:ir.model.fields,field_description:website.field_ir_asset__key #: model:ir.model.fields,field_description:website.field_ir_attachment__key -#: model:ir.model.fields,field_description:website.field_product_document__key #: model:ir.model.fields,field_description:website.field_theme_ir_asset__key #: model:ir.model.fields,field_description:website.field_theme_ir_attachment__key #: model:ir.model.fields,field_description:website.field_theme_ir_ui_view__key @@ -7936,12 +7919,6 @@ msgstr "" msgid "None" msgstr "" -#. module: website -#: model:website,prevent_zero_price_sale_text:website.default_website -#: model:website,prevent_zero_price_sale_text:website.website2 -msgid "Not Available For Sale" -msgstr "" - #. module: website #: model_terms:ir.ui.view,arch_db:website.website_pages_kanban_view msgid "Not Published" @@ -8486,7 +8463,10 @@ msgid "Page Layout" msgstr "" #. module: website +#. odoo-javascript +#: code:addons/website/static/src/components/dialog/page_properties.xml:0 #: model_terms:ir.ui.view,arch_db:website.website_page_properties_view_form +#, python-format msgid "Page Name" msgstr "" @@ -8827,6 +8807,13 @@ msgstr "" msgid "Preset" msgstr "" +#. module: website +#. odoo-javascript +#: code:addons/website/static/src/components/fullscreen_indication/fullscreen_indication.js:0 +#, python-format +msgid "Press %(key)s to exit full string" +msgstr "" + #. module: website #. odoo-javascript #: code:addons/website/static/src/js/backend/view_hierarchy/view_hierarchy.xml:0 @@ -10971,7 +10958,6 @@ msgstr "" #: model:ir.model.fields,field_description:website.field_ir_asset__theme_template_id #: model:ir.model.fields,field_description:website.field_ir_attachment__theme_template_id #: model:ir.model.fields,field_description:website.field_ir_ui_view__theme_template_id -#: model:ir.model.fields,field_description:website.field_product_document__theme_template_id #: model:ir.model.fields,field_description:website.field_website_controller_page__theme_template_id #: model:ir.model.fields,field_description:website.field_website_menu__theme_template_id #: model:ir.model.fields,field_description:website.field_website_page__theme_template_id @@ -12266,7 +12252,6 @@ msgstr "" #: model:ir.model.fields,field_description:website.field_ir_asset__website_id #: model:ir.model.fields,field_description:website.field_ir_attachment__website_id #: model:ir.model.fields,field_description:website.field_ir_ui_view__website_id -#: model:ir.model.fields,field_description:website.field_product_document__website_id #: model:ir.model.fields,field_description:website.field_res_company__website_id #: model:ir.model.fields,field_description:website.field_res_partner__website_id #: model:ir.model.fields,field_description:website.field_res_users__website_id @@ -12313,11 +12298,6 @@ msgstr "" msgid "Website Domain" msgstr "" -#. module: website -#: model:ir.model.constraint,message:website.constraint_website_domain_unique -msgid "Website Domain should be unique." -msgstr "" - #. module: website #: model:ir.model.fields,field_description:website.field_website__favicon msgid "Website Favicon" @@ -12720,7 +12700,6 @@ msgstr "" #. module: website #. odoo-python #: code:addons/website/models/res_users.py:0 -#: model:ir.model.constraint,message:website.constraint_res_users_login_key #, python-format msgid "You can not have two users with the same login!" msgstr "" @@ -12755,13 +12734,7 @@ msgid "" msgstr "" #. module: website -#. odoo-javascript -#: code:addons/website/static/src/snippets/s_website_form/options.js:0 -#, python-format -msgid "You cannot duplicate this field." -msgstr "" - -#. module: website +#. odoo-python #: code:addons/website/models/website_menu.py:0 #, python-format msgid "" @@ -12769,6 +12742,13 @@ msgid "" "menu for new websites (e.g., /shop, /event, ...)." msgstr "" +#. module: website +#. odoo-javascript +#: code:addons/website/static/src/snippets/s_website_form/options.js:0 +#, python-format +msgid "You cannot duplicate this field." +msgstr "" + #. module: website #. odoo-python #: code:addons/website/models/mixins.py:0 @@ -12792,13 +12772,6 @@ msgid "" " engines." msgstr "" -#. module: website -#. odoo-python -#: code:addons/website/models/res_config_settings.py:0 -#, python-format -msgid "You haven't defined your domain" -msgstr "" - #. module: website #: model_terms:ir.ui.view,arch_db:website.cookie_policy msgid "You may opt-out of a third-party's use of cookies by visiting the" diff --git a/addons/website/static/src/components/dialog/page_properties.js b/addons/website/static/src/components/dialog/page_properties.js index 21f14b1ce45..910671e5587 100644 --- a/addons/website/static/src/components/dialog/page_properties.js +++ b/addons/website/static/src/components/dialog/page_properties.js @@ -133,18 +133,7 @@ export class DuplicatePageDialog extends Component { } } DuplicatePageDialog.components = {WebsiteDialog}; -DuplicatePageDialog.template = xml` - -
- -
- -
-
-
-`; +DuplicatePageDialog.template = "website.DuplicatePageDialog"; DuplicatePageDialog.props = { onDuplicate: Function, close: Function, diff --git a/addons/website/static/src/components/dialog/page_properties.xml b/addons/website/static/src/components/dialog/page_properties.xml index 92d3a782ad3..4f45dbb4413 100644 --- a/addons/website/static/src/components/dialog/page_properties.xml +++ b/addons/website/static/src/components/dialog/page_properties.xml @@ -1,6 +1,19 @@ + + +
+ +
+ +
+
+
+
+ diff --git a/addons/website/static/src/components/fullscreen_indication/fullscreen_indication.js b/addons/website/static/src/components/fullscreen_indication/fullscreen_indication.js index e56896ed652..f1f34243f57 100644 --- a/addons/website/static/src/components/fullscreen_indication/fullscreen_indication.js +++ b/addons/website/static/src/components/fullscreen_indication/fullscreen_indication.js @@ -1,7 +1,9 @@ /** @odoo-module **/ import { useBus } from "@web/core/utils/hooks"; -import { EventBus, Component, xml, useState } from "@odoo/owl"; +import { EventBus, Component, useState, markup} from "@odoo/owl"; +import { sprintf } from "@web/core/utils/strings"; +import { _t } from "@web/core/l10n/translation"; export class FullscreenIndication extends Component { setup() { @@ -21,11 +23,12 @@ export class FullscreenIndication extends Component { clearTimeout(this.autofade); } } + + get fullScreenIndicationText() { + return markup(sprintf(escape(_t("Press %(key)s to exit full string")), "esc")); + } } FullscreenIndication.props = { bus: EventBus, }; -FullscreenIndication.template = xml` -
-

Press esc to exit full screen

-
`; +FullscreenIndication.template = "website.FullscreenIndication"; diff --git a/addons/website/static/src/components/fullscreen_indication/fullscreen_indication.xml b/addons/website/static/src/components/fullscreen_indication/fullscreen_indication.xml new file mode 100644 index 00000000000..5aa056688de --- /dev/null +++ b/addons/website/static/src/components/fullscreen_indication/fullscreen_indication.xml @@ -0,0 +1,10 @@ + + + + +
+

+

+
+ +