[FIX] pos_*: add missing translation flag
closes odoo/odoo#79448 X-original-commit: 1ace6a4a51a86922c9632614c4043e85f6ef1d6e Related: odoo/enterprise#22146 Signed-off-by: Pierre Paridans (app) <app@odoo.com> Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com> Co-authored-by: Adrien Dieudonné <adr@odoo.com>
This commit is contained in:
co-authored by
Adrien Dieudonné
parent
9c6cda791e
commit
477a535e03
@@ -3,14 +3,15 @@ odoo.define('point_of_sale.ConfirmPopup', function(require) {
|
||||
|
||||
const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup');
|
||||
const Registries = require('point_of_sale.Registries');
|
||||
const { _lt } = require('@web/core/l10n/translation');
|
||||
|
||||
// formerly ConfirmPopupWidget
|
||||
class ConfirmPopup extends AbstractAwaitablePopup {}
|
||||
ConfirmPopup.template = 'ConfirmPopup';
|
||||
ConfirmPopup.defaultProps = {
|
||||
confirmText: 'Ok',
|
||||
cancelText: 'Cancel',
|
||||
title: 'Confirm ?',
|
||||
confirmText: _lt('Ok'),
|
||||
cancelText: _lt('Cancel'),
|
||||
title: _lt('Confirm ?'),
|
||||
body: '',
|
||||
};
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ odoo.define('point_of_sale.EditListPopup', function(require) {
|
||||
const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup');
|
||||
const Registries = require('point_of_sale.Registries');
|
||||
const { useAutoFocusToLast } = require('point_of_sale.custom_hooks');
|
||||
const { _lt } = require('@web/core/l10n/translation');
|
||||
|
||||
/**
|
||||
* Given a array of { id, text }, we show the user this popup to be able to modify this given array.
|
||||
@@ -93,8 +94,8 @@ odoo.define('point_of_sale.EditListPopup', function(require) {
|
||||
}
|
||||
EditListPopup.template = 'EditListPopup';
|
||||
EditListPopup.defaultProps = {
|
||||
confirmText: 'Ok',
|
||||
cancelText: 'Cancel',
|
||||
confirmText: _lt('Ok'),
|
||||
cancelText: _lt('Cancel'),
|
||||
array: [],
|
||||
isSingleItem: false,
|
||||
};
|
||||
|
||||
@@ -3,6 +3,7 @@ odoo.define('point_of_sale.ErrorBarcodePopup', function(require) {
|
||||
|
||||
const ErrorPopup = require('point_of_sale.ErrorPopup');
|
||||
const Registries = require('point_of_sale.Registries');
|
||||
const { _lt } = require('@web/core/l10n/translation');
|
||||
|
||||
// formerly ErrorBarcodePopupWidget
|
||||
class ErrorBarcodePopup extends ErrorPopup {
|
||||
@@ -12,12 +13,12 @@ odoo.define('point_of_sale.ErrorBarcodePopup', function(require) {
|
||||
}
|
||||
ErrorBarcodePopup.template = 'ErrorBarcodePopup';
|
||||
ErrorBarcodePopup.defaultProps = {
|
||||
confirmText: 'Ok',
|
||||
cancelText: 'Cancel',
|
||||
title: 'Error',
|
||||
confirmText: _lt('Ok'),
|
||||
cancelText: _lt('Cancel'),
|
||||
title: _lt('Error'),
|
||||
body: '',
|
||||
message:
|
||||
'The Point of Sale could not find any product, client, employee or action associated with the scanned barcode.',
|
||||
_lt('The Point of Sale could not find any product, client, employee or action associated with the scanned barcode.'),
|
||||
};
|
||||
|
||||
Registries.Component.add(ErrorBarcodePopup);
|
||||
|
||||
@@ -3,6 +3,7 @@ odoo.define('point_of_sale.ErrorPopup', function(require) {
|
||||
|
||||
const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup');
|
||||
const Registries = require('point_of_sale.Registries');
|
||||
const { _lt } = require('@web/core/l10n/translation');
|
||||
|
||||
// formerly ErrorPopupWidget
|
||||
class ErrorPopup extends AbstractAwaitablePopup {
|
||||
@@ -12,9 +13,9 @@ odoo.define('point_of_sale.ErrorPopup', function(require) {
|
||||
}
|
||||
ErrorPopup.template = 'ErrorPopup';
|
||||
ErrorPopup.defaultProps = {
|
||||
confirmText: 'Ok',
|
||||
cancelText: 'Cancel',
|
||||
title: 'Error',
|
||||
confirmText: _lt('Ok'),
|
||||
cancelText: _lt('Cancel'),
|
||||
title: _lt('Error'),
|
||||
body: '',
|
||||
};
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ odoo.define('point_of_sale.ErrorTracebackPopup', function(require) {
|
||||
|
||||
const ErrorPopup = require('point_of_sale.ErrorPopup');
|
||||
const Registries = require('point_of_sale.Registries');
|
||||
const { _lt } = require('@web/core/l10n/translation');
|
||||
|
||||
// formerly ErrorTracebackPopupWidget
|
||||
class ErrorTracebackPopup extends ErrorPopup {
|
||||
@@ -29,12 +30,12 @@ odoo.define('point_of_sale.ErrorTracebackPopup', function(require) {
|
||||
}
|
||||
ErrorTracebackPopup.template = 'ErrorTracebackPopup';
|
||||
ErrorTracebackPopup.defaultProps = {
|
||||
confirmText: 'Ok',
|
||||
cancelText: 'Cancel',
|
||||
title: 'Error with Traceback',
|
||||
confirmText: _lt('Ok'),
|
||||
cancelText: _lt('Cancel'),
|
||||
title: _lt('Error with Traceback'),
|
||||
body: '',
|
||||
exitButtonIsShown: false,
|
||||
exitButtonText: 'Exit Pos',
|
||||
exitButtonText: _lt('Exit Pos'),
|
||||
exitButtonTrigger: 'close-pos'
|
||||
};
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ odoo.define('point_of_sale.OfflineErrorPopup', function(require) {
|
||||
|
||||
const ErrorPopup = require('point_of_sale.ErrorPopup');
|
||||
const Registries = require('point_of_sale.Registries');
|
||||
const { _lt } = require('@web/core/l10n/translation');
|
||||
|
||||
/**
|
||||
* This is a special kind of error popup as it introduces
|
||||
@@ -17,10 +18,10 @@ odoo.define('point_of_sale.OfflineErrorPopup', function(require) {
|
||||
OfflineErrorPopup.template = 'OfflineErrorPopup';
|
||||
OfflineErrorPopup.dontShow = false;
|
||||
OfflineErrorPopup.defaultProps = {
|
||||
confirmText: 'Ok',
|
||||
cancelText: 'Cancel',
|
||||
title: 'Offline Error',
|
||||
body: 'Either the server is inaccessible or browser is not connected online.',
|
||||
confirmText: _lt('Ok'),
|
||||
cancelText: _lt('Cancel'),
|
||||
title: _lt('Offline Error'),
|
||||
body: _lt('Either the server is inaccessible or browser is not connected online.'),
|
||||
};
|
||||
|
||||
Registries.Component.add(OfflineErrorPopup);
|
||||
|
||||
@@ -3,6 +3,7 @@ odoo.define('point_of_sale.OrderImportPopup', function(require) {
|
||||
|
||||
const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup');
|
||||
const Registries = require('point_of_sale.Registries');
|
||||
const { _lt } = require('@web/core/l10n/translation');
|
||||
|
||||
// formerly OrderImportPopupWidget
|
||||
class OrderImportPopup extends AbstractAwaitablePopup {
|
||||
@@ -16,8 +17,8 @@ odoo.define('point_of_sale.OrderImportPopup', function(require) {
|
||||
}
|
||||
OrderImportPopup.template = 'OrderImportPopup';
|
||||
OrderImportPopup.defaultProps = {
|
||||
confirmText: 'Ok',
|
||||
cancelText: 'Cancel',
|
||||
confirmText: _lt('Ok'),
|
||||
cancelText: _lt('Cancel'),
|
||||
body: '',
|
||||
};
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ odoo.define('point_of_sale.SelectionPopup', function (require) {
|
||||
const { useState } = owl.hooks;
|
||||
const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup');
|
||||
const Registries = require('point_of_sale.Registries');
|
||||
const { _lt } = require('@web/core/l10n/translation');
|
||||
|
||||
// formerly SelectionPopupWidget
|
||||
class SelectionPopup extends AbstractAwaitablePopup {
|
||||
@@ -44,9 +45,9 @@ odoo.define('point_of_sale.SelectionPopup', function (require) {
|
||||
}
|
||||
SelectionPopup.template = 'SelectionPopup';
|
||||
SelectionPopup.defaultProps = {
|
||||
confirmText: 'Confirm',
|
||||
cancelText: 'Cancel',
|
||||
title: 'Select',
|
||||
confirmText: _lt('Confirm'),
|
||||
cancelText: _lt('Cancel'),
|
||||
title: _lt('Select'),
|
||||
body: '',
|
||||
list: [],
|
||||
};
|
||||
|
||||
@@ -4,6 +4,7 @@ odoo.define('point_of_sale.TextAreaPopup', function(require) {
|
||||
const { useState, useRef } = owl.hooks;
|
||||
const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup');
|
||||
const Registries = require('point_of_sale.Registries');
|
||||
const { _lt } = require('@web/core/l10n/translation');
|
||||
|
||||
// formerly TextAreaPopupWidget
|
||||
// IMPROVEMENT: This code is very similar to TextInputPopup.
|
||||
@@ -27,8 +28,8 @@ odoo.define('point_of_sale.TextAreaPopup', function(require) {
|
||||
}
|
||||
TextAreaPopup.template = 'TextAreaPopup';
|
||||
TextAreaPopup.defaultProps = {
|
||||
confirmText: 'Ok',
|
||||
cancelText: 'Cancel',
|
||||
confirmText: _lt('Ok'),
|
||||
cancelText: _lt('Cancel'),
|
||||
title: '',
|
||||
body: '',
|
||||
};
|
||||
|
||||
@@ -4,6 +4,7 @@ odoo.define('point_of_sale.TextInputPopup', function(require) {
|
||||
const { useState, useRef } = owl.hooks;
|
||||
const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup');
|
||||
const Registries = require('point_of_sale.Registries');
|
||||
const { _lt } = require('@web/core/l10n/translation');
|
||||
|
||||
// formerly TextInputPopupWidget
|
||||
class TextInputPopup extends AbstractAwaitablePopup {
|
||||
@@ -21,8 +22,8 @@ odoo.define('point_of_sale.TextInputPopup', function(require) {
|
||||
}
|
||||
TextInputPopup.template = 'TextInputPopup';
|
||||
TextInputPopup.defaultProps = {
|
||||
confirmText: 'Ok',
|
||||
cancelText: 'Cancel',
|
||||
confirmText: _lt('Ok'),
|
||||
cancelText: _lt('Cancel'),
|
||||
title: '',
|
||||
body: '',
|
||||
startingValue: '',
|
||||
|
||||
@@ -229,7 +229,7 @@ odoo.define('point_of_sale.PaymentScreen', function (require) {
|
||||
if (!result) {
|
||||
await this.showPopup('ErrorPopup', {
|
||||
title: this.env._t('Error: no internet connection.'),
|
||||
body: this.env._t('Some, if not all, post-processing after syncing order failed.')
|
||||
body: this.env._t('Some, if not all, post-processing after syncing order failed.'),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ odoo.define('pos_mercury.PaymentTransactionPopup', function(require) {
|
||||
const { useState } = owl.hooks;
|
||||
const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup');
|
||||
const Registries = require('point_of_sale.Registries');
|
||||
const { _lt } = require('@web/core/l10n/translation');
|
||||
|
||||
class PaymentTransactionPopup extends AbstractAwaitablePopup {
|
||||
constructor() {
|
||||
@@ -25,9 +26,9 @@ odoo.define('pos_mercury.PaymentTransactionPopup', function(require) {
|
||||
}
|
||||
PaymentTransactionPopup.template = 'PaymentTransactionPopup';
|
||||
PaymentTransactionPopup.defaultProps = {
|
||||
confirmText: 'Ok',
|
||||
cancelText: 'Cancel',
|
||||
title: 'Online Payment',
|
||||
confirmText: _lt('Ok'),
|
||||
cancelText: _lt('Cancel'),
|
||||
title: _lt('Online Payment'),
|
||||
body: '',
|
||||
};
|
||||
|
||||
|
||||
@@ -340,8 +340,8 @@ odoo.define('pos_restaurant.FloorScreen', function (require) {
|
||||
} catch (error) {
|
||||
if (error.message.code < 0) {
|
||||
await this.showPopup('OfflineErrorPopup', {
|
||||
title: 'Offline',
|
||||
body: 'Unable to get orders count',
|
||||
title: this.env._t('Offline'),
|
||||
body: this.env._t('Unable to get orders count'),
|
||||
});
|
||||
} else {
|
||||
throw error;
|
||||
|
||||
+2
-2
@@ -32,8 +32,8 @@ odoo.define('pos_restaurant.SubmitOrderButton', function(require) {
|
||||
order.saveChanges();
|
||||
} else {
|
||||
await this.showPopup('ErrorPopup', {
|
||||
title: 'Printing failed',
|
||||
body: 'Failed in printing the changes in the order',
|
||||
title: this.env._t('Printing failed'),
|
||||
body: this.env._t('Failed in printing the changes in the order'),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,8 +42,8 @@ odoo.define('pos_restaurant.TipScreen', function (require) {
|
||||
|
||||
if (!serverId) {
|
||||
this.showPopup('ErrorPopup', {
|
||||
title: 'Unsynced order',
|
||||
body: 'This order is not yet synced to server. Make sure it is synced then try again.',
|
||||
title: this.env._t('Unsynced order'),
|
||||
body: this.env._t('This order is not yet synced to server. Make sure it is synced then try again.'),
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user