From 69a62c5b6dcf372840171418a371da174ccab321 Mon Sep 17 00:00:00 2001 From: "Touati Djamel (otd)" Date: Tue, 3 Aug 2021 10:10:52 +0000 Subject: [PATCH] [FIX] point_of_sale: Translate the popup number buttons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to reproduce the bug: - Change the language in odoo preferences (e.g: FR) - Go to pos app > Configuration > Point of sale - Choose anyone > Edit > Enable “Global discounts” option - Open new session with the same pos - Click on “Discount” - The button "cancel", “confirm” and "ok" are not translated opw-2615309 closes odoo/odoo#74641 X-original-commit: ace4ac0568c63aef2bcb41f7c613a7f1275a092a Signed-off-by: pimodoo Signed-off-by: Djamel Touati --- addons/point_of_sale/i18n/point_of_sale.pot | 7 +++++++ addons/point_of_sale/static/src/js/Popups/NumberPopup.js | 8 +++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/addons/point_of_sale/i18n/point_of_sale.pot b/addons/point_of_sale/i18n/point_of_sale.pot index 63e2217ef67..8d9fab6adbe 100644 --- a/addons/point_of_sale/i18n/point_of_sale.pot +++ b/addons/point_of_sale/i18n/point_of_sale.pot @@ -1059,6 +1059,13 @@ msgstr "" msgid "Confirm" msgstr "" +#. module: point_of_sale +#. openerp-web +#: code:addons/point_of_sale/static/src/js/Popups/NumberPopup.js:0 +#, python-format +msgid "Confirm ?" +msgstr "" + #. module: point_of_sale #: model_terms:ir.ui.view,arch_db:point_of_sale.pos_config_view_form msgid "Connect devices to your PoS directly without an IoT Box" diff --git a/addons/point_of_sale/static/src/js/Popups/NumberPopup.js b/addons/point_of_sale/static/src/js/Popups/NumberPopup.js index 080e56f22f3..0e4b7861285 100644 --- a/addons/point_of_sale/static/src/js/Popups/NumberPopup.js +++ b/addons/point_of_sale/static/src/js/Popups/NumberPopup.js @@ -1,5 +1,7 @@ odoo.define('point_of_sale.NumberPopup', function(require) { 'use strict'; + var core = require('web.core'); + var _t = core._t; const { useState } = owl; const AbstractAwaitablePopup = require('point_of_sale.AbstractAwaitablePopup'); @@ -62,9 +64,9 @@ odoo.define('point_of_sale.NumberPopup', function(require) { } NumberPopup.template = 'NumberPopup'; NumberPopup.defaultProps = { - confirmText: 'Ok', - cancelText: 'Cancel', - title: 'Confirm ?', + confirmText: _t('Ok'), + cancelText: _t('Cancel'), + title: _t('Confirm ?'), body: '', cheap: false, startingValue: null,