[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) <wil@odoo.com>
Signed-off-by: Mohammed Basioni (basm) <basm@odoo.com>
This commit is contained in:
Mohammed Basioni
2024-04-18 16:38:22 +00:00
parent cc541f9935
commit 02461534d2
9 changed files with 78 additions and 89 deletions
+13 -14
View File
@@ -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
@@ -1,5 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-name="web.DefaultFooter" owl="1">
<span>
<span class="fw-bolder text-primary">TIP</span> — search for
<t t-foreach="elements" t-as="element" t-key="element.namespace">
<t t-if="!(element_first || element_last)">, </t>
<t t-if="element_last and !element_first"> and </t>
<span class="o_namespace btn-link text-primary cursor-pointer" t-on-click="() => this.onClick(element.namespace)">
<span t-out="element.namespace" class="fw-bolder text-primary"/><t t-out="element.name"/>
</span>
</t>
</span>
</t>
<t t-name="web.DefaultCommandItem">
<div class="o_command_default d-flex align-items-center justify-content-between px-4 py-2 cursor-pointer">
@@ -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`
<span>
<span class="fw-bolder text-primary">TIP</span> — search for
<t t-foreach="elements" t-as="element" t-key="element.namespace">
<t t-if="!(element_first || element_last)">, </t>
<t t-if="element_last and !element_first"> and </t>
<span class="o_namespace btn-link text-primary cursor-pointer" t-on-click="() => this.onClick(element.namespace)">
<span t-out="element.namespace" class="fw-bolder text-primary"/><t t-out="element.name"/>
</span>
</t>
</span>
`;
DefaultFooter.template = "web.DefaultFooter";
export const commandService = {
dependencies: ["dialog", "hotkey", "ui"],
+1
View File
@@ -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/*',
+18 -45
View File
@@ -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 <body> 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"
@@ -133,18 +133,7 @@ export class DuplicatePageDialog extends Component {
}
}
DuplicatePageDialog.components = {WebsiteDialog};
DuplicatePageDialog.template = xml`
<WebsiteDialog close="props.close" primaryClick="() => this.duplicate()">
<div class="mb-3 row">
<label class="col-form-label col-md-3">
Page Name
</label>
<div class="col-md-9">
<input type="text" t-model="state.name" class="form-control" required="required" t-ref="autofocus"/>
</div>
</div>
</WebsiteDialog>
`;
DuplicatePageDialog.template = "website.DuplicatePageDialog";
DuplicatePageDialog.props = {
onDuplicate: Function,
close: Function,
@@ -1,6 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates>
<t t-name="website.DuplicatePageDialog">
<WebsiteDialog close="props.close" primaryClick="() => this.duplicate()">
<div class="mb-3 row">
<label class="col-form-label col-md-3">
Page Name
</label>
<div class="col-md-9">
<input type="text" t-model="state.name" class="form-control" required="required" t-ref="autofocus"/>
</div>
</div>
</WebsiteDialog>
</t>
<t t-name="website.PageDependencies">
<t t-if="!!Object.keys(state.dependencies).length">
<t t-if="props.mode === 'popover'">
@@ -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")), "<span>esc</span>"));
}
}
FullscreenIndication.props = {
bus: EventBus,
};
FullscreenIndication.template = xml`
<div class="o_fullscreen_indication" t-att-class="{ o_visible: state.isVisible }">
<p>Press <span>esc</span> to exit full screen</p>
</div>`;
FullscreenIndication.template = "website.FullscreenIndication";
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<templates>
<t t-name="website.FullscreenIndication" owl="1">
<div class="o_fullscreen_indication" t-att-class="{ o_visible: state.isVisible }">
<p t-esc="fullScreenIndicationText"/>
</div>
</t>
</templates>