Skip to content
Snippets Groups Projects
Commit 2be83cae authored by Louis Wicket (wil)'s avatar Louis Wicket (wil)
Browse files

[FIX] website: lazy load translations


`_lt` must be used instead of `_t` for `gettext`s that are called when
the file is loaded.

closes odoo/odoo#125538

Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
parent ffcfb2e9
Branches
Tags
No related merge requests found
......@@ -2,9 +2,10 @@
import { useAutofocus, useService } from '@web/core/utils/hooks';
import { Dialog } from '@web/core/dialog/dialog';
import { _lt } from '@web/core/l10n/translation';
import { Switch } from '@website/components/switch/switch';
import {unslugHtmlDataObject} from '../../services/website_service';
import {csrf_token, _t} from 'web.core';
import { csrf_token } from 'web.core';
const { xml, useState, Component, onWillStart } = owl;
......@@ -64,9 +65,9 @@ WebsiteDialog.props = {
};
WebsiteDialog.defaultProps = {
...Dialog.defaultProps,
title: _t("Confirmation"),
primaryTitle: _t("Ok"),
secondaryTitle: _t("Cancel"),
title: _lt("Confirmation"),
primaryTitle: _lt("Ok"),
secondaryTitle: _lt("Cancel"),
showSecondaryButton: true,
size: "md",
closeOnClick: true,
......
/** @odoo-module **/
import {CheckBox} from '@web/core/checkbox/checkbox';
import { _lt } from "@web/core/l10n/translation";
import {useService, useAutofocus} from "@web/core/utils/hooks";
import {sprintf} from "@web/core/utils/strings";
import {useWowlService} from '@web/legacy/utils';
import {WebsiteDialog} from './dialog';
import {FormViewDialog} from "@web/views/view_dialogs/form_view_dialog";
import {qweb, _t} from 'web.core';
import { qweb } from 'web.core';
const {Component, onWillStart, useState, xml, useRef} = owl;
......@@ -190,7 +191,7 @@ PagePropertiesDialog.props = {
PagePropertiesDialog.defaultProps = {
...FormViewDialog.defaultProps,
resModel: 'website.page',
title: _t("Page Properties"),
title: _lt("Page Properties"),
size: 'md',
context: {
form_view_ref: 'website.website_page_properties_view_form',
......
......@@ -10,10 +10,8 @@ return new Registry();
odoo.define('website.send_mail_form', function (require) {
'use strict';
var core = require('web.core');
var FormEditorRegistry = require('website.form_editor_registry');
var _t = core._t;
const { _lt } = require('@web/core/l10n/translation');
FormEditorRegistry.add('send_mail', {
formFields: [{
......@@ -57,7 +55,7 @@ FormEditorRegistry.add('send_mail', {
name: 'email_to',
type: 'char',
required: true,
string: _t('Recipient Email'),
string: _lt('Recipient Email'),
defaultValue: 'info@yourcompany.example.com',
}],
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment