diff --git a/addons/account/static/src/components/account_move_service/account_move_service.js b/addons/account/static/src/components/account_move_service/account_move_service.js
index 99494fcab7c..aac36e55355 100644
--- a/addons/account/static/src/components/account_move_service/account_move_service.js
+++ b/addons/account/static/src/components/account_move_service/account_move_service.js
@@ -1,5 +1,6 @@
/** @odoo-module **/
+import { _t } from "@web/core/l10n/translation";
import { ConfirmationDialog } from "@web/core/confirmation_dialog/confirmation_dialog";
import { escape } from "@web/core/utils/strings";
import { markup } from "@odoo/owl";
@@ -13,7 +14,7 @@ export const accountMove = {
async addDeletionDialog(component, moveIds) {
const isMoveEndOfChain = await orm.call('account.move', 'check_move_sequence_chain', [moveIds]);
if (!isMoveEndOfChain) {
- const message = env._t("This operation will create a gap in the sequence.");
+ const message = _t("This operation will create a gap in the sequence.");
const confirmationDialogProps = component.deleteConfirmationDialogProps;
confirmationDialogProps.body = markup(`
${escape(message)}
${escape(confirmationDialogProps.body)}`);
dialog.add(ConfirmationDialog, confirmationDialogProps);
diff --git a/addons/account/static/src/components/account_payment_field/account_payment_field.js b/addons/account/static/src/components/account_payment_field/account_payment_field.js
index e130ae874c4..a38a11615aa 100644
--- a/addons/account/static/src/components/account_payment_field/account_payment_field.js
+++ b/addons/account/static/src/components/account_payment_field/account_payment_field.js
@@ -1,5 +1,6 @@
/** @odoo-module **/
+import { _t } from "@web/core/l10n/translation";
import { registry } from "@web/core/registry";
import { usePopover } from "@web/core/popover/popover_hook";
import { useService } from "@web/core/utils/hooks";
@@ -53,7 +54,7 @@ export class AccountPaymentField extends Component {
onInfoClick(ev, idx) {
this.popover.open(ev.currentTarget, {
- title: this.env._t("Journal Entry Info"),
+ title: _t("Journal Entry Info"),
...this.lines[idx],
_onRemoveMoveReconcile: this.removeMoveReconcile.bind(this),
_onOpenMove: this.openMove.bind(this),
diff --git a/addons/account/static/src/components/account_type_selection/account_type_selection.js b/addons/account/static/src/components/account_type_selection/account_type_selection.js
index a2b79d82c19..5b695790ca6 100644
--- a/addons/account/static/src/components/account_type_selection/account_type_selection.js
+++ b/addons/account/static/src/components/account_type_selection/account_type_selection.js
@@ -1,5 +1,6 @@
/** @odoo-module **/
+import { _t } from "@web/core/l10n/translation";
import { registry } from "@web/core/registry";
import { SelectionField, selectionField } from "@web/views/fields/selection/selection_field";
@@ -7,14 +8,14 @@ export class AccountTypeSelection extends SelectionField {
get hierarchyOptions() {
const opts = this.options;
return [
- { name: this.env._t('Balance Sheet') },
- { name: this.env._t('Assets'), children: opts.filter(x => x[0] && x[0].startsWith('asset')) },
- { name: this.env._t('Liabilities'), children: opts.filter(x => x[0] && x[0].startsWith('liability')) },
- { name: this.env._t('Equity'), children: opts.filter(x => x[0] && x[0].startsWith('equity')) },
- { name: this.env._t('Profit & Loss') },
- { name: this.env._t('Income'), children: opts.filter(x => x[0] && x[0].startsWith('income')) },
- { name: this.env._t('Expense'), children: opts.filter(x => x[0] && x[0].startsWith('expense')) },
- { name: this.env._t('Other'), children: opts.filter(x => x[0] && x[0] === 'off_balance') },
+ { name: _t('Balance Sheet') },
+ { name: _t('Assets'), children: opts.filter(x => x[0] && x[0].startsWith('asset')) },
+ { name: _t('Liabilities'), children: opts.filter(x => x[0] && x[0].startsWith('liability')) },
+ { name: _t('Equity'), children: opts.filter(x => x[0] && x[0].startsWith('equity')) },
+ { name: _t('Profit & Loss') },
+ { name: _t('Income'), children: opts.filter(x => x[0] && x[0].startsWith('income')) },
+ { name: _t('Expense'), children: opts.filter(x => x[0] && x[0].startsWith('expense')) },
+ { name: _t('Other'), children: opts.filter(x => x[0] && x[0] === 'off_balance') },
];
}
}
diff --git a/addons/account/static/src/components/bills_upload/bills_upload.js b/addons/account/static/src/components/bills_upload/bills_upload.js
index 31c99596653..9b7fd07fd3a 100644
--- a/addons/account/static/src/components/bills_upload/bills_upload.js
+++ b/addons/account/static/src/components/bills_upload/bills_upload.js
@@ -105,7 +105,7 @@ export class AccountDropZone extends Component {
uploadInput.dispatchEvent(new Event("change"));
} else {
this.notificationService.add(
- this.env._t("Could not upload files"),
+ _t("Could not upload files"),
{
type: "danger",
});
diff --git a/addons/account/static/src/components/journal_dashboard_activity/journal_dashboard_activity.js b/addons/account/static/src/components/journal_dashboard_activity/journal_dashboard_activity.js
index 4d88cd6be2b..586ac44e09a 100644
--- a/addons/account/static/src/components/journal_dashboard_activity/journal_dashboard_activity.js
+++ b/addons/account/static/src/components/journal_dashboard_activity/journal_dashboard_activity.js
@@ -1,5 +1,6 @@
/** @odoo-module **/
+import { _t } from "@web/core/l10n/translation";
import { registry } from "@web/core/registry";
import { useService } from "@web/core/utils/hooks";
import { standardFieldProps } from "@web/views/fields/standard_field_props";
@@ -27,7 +28,7 @@ export class JournalDashboardActivity extends Component {
async openActivity(activity) {
this.action.doAction({
type: 'ir.actions.act_window',
- name: this.env._t('Journal Entry'),
+ name: _t('Journal Entry'),
target: 'current',
res_id: activity.res_id,
res_model: 'account.move',
@@ -38,7 +39,7 @@ export class JournalDashboardActivity extends Component {
openAllActivities(e) {
this.action.doAction({
type: 'ir.actions.act_window',
- name: this.env._t('Journal Entries'),
+ name: _t('Journal Entries'),
res_model: 'account.move',
views: [[false, 'kanban'], [false, 'form']],
search_view_id: [false],
diff --git a/addons/account/static/src/components/mail_attachments/mail_attachments.js b/addons/account/static/src/components/mail_attachments/mail_attachments.js
index 3e68a8f0111..2e845c1132a 100644
--- a/addons/account/static/src/components/mail_attachments/mail_attachments.js
+++ b/addons/account/static/src/components/mail_attachments/mail_attachments.js
@@ -1,5 +1,6 @@
/** @odoo-module **/
+import { _t } from "@web/core/l10n/translation";
import { registry } from "@web/core/registry";
import { useService } from "@web/core/utils/hooks";
import { FileInput } from "@web/core/file_input/file_input";
@@ -37,7 +38,7 @@ export class MailAttachments extends Component {
for (const file of files) {
if (file.error) {
return this.notification.add(file.error, {
- title: this.env._t("Uploading error"),
+ title: _t("Uploading error"),
type: "danger",
});
}
diff --git a/addons/account_peppol/static/src/components/res_config_settings_buttons/res_config_settings_buttons.js b/addons/account_peppol/static/src/components/res_config_settings_buttons/res_config_settings_buttons.js
index 5c44af9cbcf..f956936ca3f 100644
--- a/addons/account_peppol/static/src/components/res_config_settings_buttons/res_config_settings_buttons.js
+++ b/addons/account_peppol/static/src/components/res_config_settings_buttons/res_config_settings_buttons.js
@@ -1,5 +1,6 @@
-/** @odoo-module */
+/** @odoo-module **/
+import { _t } from "@web/core/l10n/translation";
import { escape } from "@web/core/utils/strings";
import { registry } from "@web/core/registry";
import { pick } from "@web/core/utils/objects";
@@ -55,8 +56,8 @@ class PeppolSettingsButtons extends Component {
}
showConfirmation(warning, methodName) {
- const message = this.env._t(warning);
- const confirmMessage = this.env._t("You will not be able to send or receive Peppol documents in Odoo anymore. Are you sure you want to proceed?");
+ const message = _t(warning);
+ const confirmMessage = _t("You will not be able to send or receive Peppol documents in Odoo anymore. Are you sure you want to proceed?");
this.dialogService.add(ConfirmationDialog, {
body: markup(
`${escape(message)}
@@ -90,7 +91,7 @@ class PeppolSettingsButtons extends Component {
// changes on both the client side and the iap side need to be saved within one method
await this._callConfigMethod("button_update_peppol_user_data", true);
this.notification.add(
- this.env._t("Contact details were updated."),
+ _t("Contact details were updated."),
{ type: "success" }
);
}
diff --git a/addons/analytic/static/src/components/analytic_distribution/analytic_distribution.js b/addons/analytic/static/src/components/analytic_distribution/analytic_distribution.js
index af21cafd195..22a6077137b 100644
--- a/addons/analytic/static/src/components/analytic_distribution/analytic_distribution.js
+++ b/addons/analytic/static/src/components/analytic_distribution/analytic_distribution.js
@@ -69,7 +69,7 @@ export class AnalyticDistribution extends Component {
onClose: () => {
this.mainRef.el.focus();
},
- fieldString: this.env._t("Analytic Distribution Template"),
+ fieldString: _t("Analytic Distribution Template"),
});
this.allPlans = [];
this.lastAccount = this.props.account_field && this.props.record.data[this.props.account_field] || false;
@@ -202,7 +202,7 @@ export class AnalyticDistribution extends Component {
optionsSourceAnalytic(groupId) {
return {
- placeholder: this.env._t("Loading..."),
+ placeholder: _t("Loading..."),
options:(searchTerm) => this.loadOptionsSourceAnalytic(groupId, searchTerm),
};
}
@@ -249,7 +249,7 @@ export class AnalyticDistribution extends Component {
if (records.length) {
options.push({
- label: this.env._t("View all"),
+ label: _t("View all"),
action: (editedTag) => this.onViewAll(searchTerm, editedTag),
classList: "o_m2o_dropdown_option o_m2o_dropdown_option_view_all",
});
@@ -257,7 +257,7 @@ export class AnalyticDistribution extends Component {
else {
options.push({
- label: this.env._t("No Analytic Accounts for this plan"),
+ label: _t("No Analytic Accounts for this plan"),
classList: "o_m2o_no_result",
unselectable: true,
});
@@ -271,14 +271,14 @@ export class AnalyticDistribution extends Component {
if (searchTerm.length) {
dynamicFilters = [
{
- description: this.env._t("Quick search: %s", searchTerm),
+ description: _t("Quick search: %s", searchTerm),
domain: this.searchAnalyticDomain(searchTerm),
},
];
}
this.selectCreateIsOpen = true;
this.addDialog(SelectCreateDialog, {
- title: this.env._t("Search: Analytic Account"),
+ title: _t("Search: Analytic Account"),
noCreate: true,
multiSelect: true,
resModel: 'account.analytic.account',
diff --git a/addons/auth_password_policy/static/src/password_meter.js b/addons/auth_password_policy/static/src/password_meter.js
index 13e128a4f15..26de9d76db5 100644
--- a/addons/auth_password_policy/static/src/password_meter.js
+++ b/addons/auth_password_policy/static/src/password_meter.js
@@ -1,14 +1,15 @@
/** @odoo-module **/
+import { _t } from "@web/core/l10n/translation";
import { computeScore } from "./password_policy";
const { Component, xml } = owl;
export class Meter extends Component {
get title() {
- return this.env._t(
+ return _t(
"Required: %s\n\nHint: to increase password strength, increase length, use multiple words, and use non-letter characters.",
- String(this.props.required) || this.env._t("no requirements")
+ String(this.props.required) || _t("no requirements")
);
}
diff --git a/addons/barcodes/static/src/barcode_handlers.js b/addons/barcodes/static/src/barcode_handlers.js
index 98b5f41cbf1..02f62178109 100644
--- a/addons/barcodes/static/src/barcode_handlers.js
+++ b/addons/barcodes/static/src/barcode_handlers.js
@@ -1,5 +1,6 @@
/** @odoo-module **/
+import { _t } from "@web/core/l10n/translation";
import { registry } from "@web/core/registry";
import { getVisibleElements } from "@web/core/utils/ui";
import { MacroEngine } from "@web/core/macro";
@@ -78,8 +79,8 @@ export const barcodeGenericHandlers = {
if (fn) {
fn();
} else {
- notification.add(env._t("Barcode: ") + `'${barcode}'`, {
- title: env._t("Unknown barcode command"),
+ notification.add(_t("Barcode: ") + `'${barcode}'`, {
+ title: _t("Unknown barcode command"),
type: "danger"
});
}
diff --git a/addons/barcodes/static/src/components/barcode_scanner.js b/addons/barcodes/static/src/components/barcode_scanner.js
index acebb585da4..da765214bed 100644
--- a/addons/barcodes/static/src/components/barcode_scanner.js
+++ b/addons/barcodes/static/src/components/barcode_scanner.js
@@ -1,5 +1,6 @@
/** @odoo-module **/
+import { _t } from "@web/core/l10n/translation";
import { isBarcodeScannerSupported, scanBarcode } from "@web/webclient/barcode/barcode_scanner";
import { Component } from "@odoo/owl";
import { useService } from "@web/core/utils/hooks";
@@ -29,7 +30,7 @@ export class BarcodeScanner extends Component {
window.navigator.vibrate(100);
}
} else {
- this.notification.add(error || this.env._t("Please, Scan again!"), {
+ this.notification.add(error || _t("Please, Scan again!"), {
type: "warning",
});
}
diff --git a/addons/base_import/static/src/import_action/import_action.js b/addons/base_import/static/src/import_action/import_action.js
index 599e35f44b9..d9bca2afc20 100644
--- a/addons/base_import/static/src/import_action/import_action.js
+++ b/addons/base_import/static/src/import_action/import_action.js
@@ -1,5 +1,6 @@
/** @odoo-module **/
+import { _t } from "@web/core/l10n/translation";
import { Component, onWillStart, onMounted, useState } from "@odoo/owl";
import { registry } from "@web/core/registry";
import { useService } from "@web/core/utils/hooks";
@@ -26,7 +27,7 @@ export class ImportAction extends Component {
this.router = useService("router");
this.user = useService("user");
- this.env.config.setDisplayName(this.props.action.name || this.env._t("Import a File"));
+ this.env.config.setDisplayName(this.props.action.name || _t("Import a File"));
this.resModel = this.props.action.params.model;
this.model = useImportModel({
env: this.env,
@@ -124,7 +125,7 @@ export class ImportAction extends Component {
this.state.filename = files[0].name;
this.state.importMessages = [];
- this.model.block(this.env._t("Loading file..."));
+ this.model.block(_t("Loading file..."));
const { res, error } = await this.model.updateData(true);
if (error) {
@@ -137,7 +138,7 @@ export class ImportAction extends Component {
}
async handleImport(isTest = true) {
- const message = isTest ? this.env._t("Testing") : this.env._t("Importing");
+ const message = isTest ? _t("Testing") : _t("Importing");
let blockComponent;
if (this.isBatched) {
@@ -170,7 +171,7 @@ export class ImportAction extends Component {
}
if (!isTest && res.ids.length) {
- this.notification.add(this.env._t("%s records successfully imported", res.ids.length), {
+ this.notification.add(_t("%s records successfully imported", res.ids.length), {
type: "success",
});
this.exit();
diff --git a/addons/board/static/src/add_to_board/add_to_board.js b/addons/board/static/src/add_to_board/add_to_board.js
index f581b83ed0c..fb35cb5f8fc 100644
--- a/addons/board/static/src/add_to_board/add_to_board.js
+++ b/addons/board/static/src/add_to_board/add_to_board.js
@@ -1,5 +1,6 @@
/** @odoo-module **/
+import { _t } from "@web/core/l10n/translation";
import { Dropdown } from "@web/core/dropdown/dropdown";
import { registry } from "@web/core/registry";
import { useAutofocus, useService } from "@web/core/utils/hooks";
@@ -35,12 +36,8 @@ export class AddToBoard extends Component {
async addToBoard() {
const { domain, globalContext } = this.env.searchModel;
- const {
- comparison,
- context,
- groupBys,
- orderBy,
- } = this.env.searchModel.getPreFavoriteValues();
+ const { comparison, context, groupBys, orderBy } =
+ this.env.searchModel.getPreFavoriteValues();
const contextToSave = {
...globalContext,
...context,
@@ -60,15 +57,15 @@ export class AddToBoard extends Component {
if (result) {
this.notification.add(
- this.env._t("Please refresh your browser for the changes to take effect."),
+ _t("Please refresh your browser for the changes to take effect."),
{
- title: this.env._t("“%s” added to dashboard", this.state.name),
+ title: _t("“%s” added to dashboard", this.state.name),
type: "warning",
}
);
this.state.name = this.env.config.getDisplayName();
} else {
- this.notification.add(this.env._t("Could not add filter to dashboard"), {
+ this.notification.add(_t("Could not add filter to dashboard"), {
type: "danger",
});
}
diff --git a/addons/board/static/src/board_controller.js b/addons/board/static/src/board_controller.js
index 1fd4b9d2c9b..7af779e6022 100644
--- a/addons/board/static/src/board_controller.js
+++ b/addons/board/static/src/board_controller.js
@@ -1,5 +1,6 @@
/** @odoo-module **/
+import { _t } from "@web/core/l10n/translation";
import { browser } from "@web/core/browser/browser";
import { ConfirmationDialog } from "@web/core/confirmation_dialog/confirmation_dialog";
import { Dropdown } from "@web/core/dropdown/dropdown";
@@ -92,7 +93,7 @@ export class BoardController extends Component {
closeAction(column, action) {
this.dialogService.add(ConfirmationDialog, {
- body: this.env._t("Are you sure that you want to remove this item?"),
+ body: _t("Are you sure that you want to remove this item?"),
confirm: () => {
const index = column.actions.indexOf(action);
column.actions.splice(index, 1);
diff --git a/addons/bus/static/src/services/assets_watchdog_service.js b/addons/bus/static/src/services/assets_watchdog_service.js
index 8ac2fda7152..8850006fbc5 100644
--- a/addons/bus/static/src/services/assets_watchdog_service.js
+++ b/addons/bus/static/src/services/assets_watchdog_service.js
@@ -1,5 +1,6 @@
/** @odoo-module **/
+import { _t } from "@web/core/l10n/translation";
import { browser } from "@web/core/browser/browser";
import { registry } from "@web/core/registry";
import { session } from "@web/session";
@@ -28,13 +29,13 @@ export const assetsWatchdogService = {
// We wait until things settle down
browser.clearTimeout(bundleNotifTimerID);
bundleNotifTimerID = browser.setTimeout(() => {
- notification.add(env._t("The page appears to be out of date."), {
- title: env._t("Refresh"),
+ notification.add(_t("The page appears to be out of date."), {
+ title: _t("Refresh"),
type: "warning",
sticky: true,
buttons: [
{
- name: env._t("Refresh"),
+ name: _t("Refresh"),
primary: true,
onClick: () => {
browser.location.reload();
diff --git a/addons/calendar/static/src/js/services/calendar_notification_service.js b/addons/calendar/static/src/js/services/calendar_notification_service.js
index 11594cf4aa6..f45a762dc00 100644
--- a/addons/calendar/static/src/js/services/calendar_notification_service.js
+++ b/addons/calendar/static/src/js/services/calendar_notification_service.js
@@ -1,5 +1,6 @@
/** @odoo-module **/
+import { _t } from "@web/core/l10n/translation";
import { browser } from "@web/core/browser/browser";
import { ConnectionLostError } from "@web/core/network/rpc_service";
import { registry } from "@web/core/registry";
@@ -44,7 +45,7 @@ export const calendarNotificationService = {
},
buttons: [
{
- name: env._t("OK"),
+ name: _t("OK"),
primary: true,
onClick: async () => {
await rpc("/calendar/notify_ack");
@@ -52,7 +53,7 @@ export const calendarNotificationService = {
},
},
{
- name: env._t("Details"),
+ name: _t("Details"),
onClick: async () => {
await action.doAction({
type: 'ir.actions.act_window',
@@ -65,7 +66,7 @@ export const calendarNotificationService = {
},
},
{
- name: env._t("Snooze"),
+ name: _t("Snooze"),
onClick: () => {
notificationRemove();
},
diff --git a/addons/calendar/static/src/views/ask_recurrence_update_policy_dialog.js b/addons/calendar/static/src/views/ask_recurrence_update_policy_dialog.js
index 333f1e60522..62ec5d94911 100644
--- a/addons/calendar/static/src/views/ask_recurrence_update_policy_dialog.js
+++ b/addons/calendar/static/src/views/ask_recurrence_update_policy_dialog.js
@@ -1,5 +1,6 @@
/** @odoo-module **/
+import { _t } from "@web/core/l10n/translation";
import { Dialog } from "@web/core/dialog/dialog";
const { Component } = owl;
@@ -9,15 +10,15 @@ export class AskRecurrenceUpdatePolicyDialog extends Component {
this.possibleValues = {
self_only: {
checked: true,
- label: this.env._t("This event"),
+ label: _t("This event"),
},
future_events: {
checked: false,
- label: this.env._t("This and following events"),
+ label: _t("This and following events"),
},
all_events: {
checked: false,
- label: this.env._t("All events"),
+ label: _t("All events"),
},
};
}
diff --git a/addons/calendar/static/src/views/ask_recurrence_update_policy_dialog.xml b/addons/calendar/static/src/views/ask_recurrence_update_policy_dialog.xml
index 43ef8a36677..8f6c3671ba0 100644
--- a/addons/calendar/static/src/views/ask_recurrence_update_policy_dialog.xml
+++ b/addons/calendar/static/src/views/ask_recurrence_update_policy_dialog.xml
@@ -1,7 +1,8 @@
-