From 5157c0bf18ea7efd311112296c4f920c8d830445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Kawala?= Date: Thu, 6 Feb 2020 09:21:53 +0100 Subject: [PATCH] fix translations + better alert message. --- pos_barcode_tare/i18n/fr_CH.po | 20 +++++++++---------- pos_barcode_tare/i18n/pos_barcode_tare.pot | 18 ++++++++--------- .../static/src/js/pos_barcode_tare.js | 17 +++++++++++----- 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/pos_barcode_tare/i18n/fr_CH.po b/pos_barcode_tare/i18n/fr_CH.po index 7c432aee..c644d040 100644 --- a/pos_barcode_tare/i18n/fr_CH.po +++ b/pos_barcode_tare/i18n/fr_CH.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 9.0c\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-05 08:11+0000\n" -"PO-Revision-Date: 2020-02-05 08:11+0000\n" +"POT-Creation-Date: 2020-02-05 18:22+0000\n" +"PO-Revision-Date: 2020-02-05 18:22+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -38,8 +38,8 @@ msgstr "Erreur d'unitée de mesure" #. module: pos_barcode_tare #. openerp-web -#: code:addons/addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:83 -#: code:addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:83 +#: code:addons/addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:89 +#: code:addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:89 #, python-format msgid "Negative weight" msgstr "Poids négatif" @@ -89,19 +89,19 @@ msgstr "Tare" #. module: pos_barcode_tare #. openerp-web -#: code:addons/addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:84 -#: code:addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:84 +#: code:addons/addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:90 +#: code:addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:90 #, python-format msgid "The calculated weight is negative. Did you scan the correct tare label?" msgstr "Le poids net calculé est négatif. Avez vous scanné la bonne étiquette de tare?" #. module: pos_barcode_tare #. openerp-web -#: code:addons/addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:73 -#: code:addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:73 +#: code:addons/addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:74 +#: code:addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:74 #, python-format -msgid "You scanned a tare barcode. The tare is applied to the last product in order. We can not apply the tare to this product." -msgstr "Vous avez scanné un code barre de tare. La tare est appliquée au dernier article de la commande. Nous ne pouvons pas appliquer la tare à ce produit." +msgid "You scanned a tare barcode. The tare should apply to \"%s %s of %s\". We do not know how to convert kg to %s. We can not apply the tare to this product." +msgstr "Vous avez scanné une étiquette de tare. La tare devrait être appliquée à \"%s %s de %s\". Nous ne savons pas convertir des kg en %s. La tare ne peut pas être appliqué à ce produit." #. module: pos_barcode_tare #: model:ir.model,name:pos_barcode_tare.model_barcode_rule diff --git a/pos_barcode_tare/i18n/pos_barcode_tare.pot b/pos_barcode_tare/i18n/pos_barcode_tare.pot index 99a0dc35..71b3e135 100644 --- a/pos_barcode_tare/i18n/pos_barcode_tare.pot +++ b/pos_barcode_tare/i18n/pos_barcode_tare.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 9.0c\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-02-05 08:11+0000\n" -"PO-Revision-Date: 2020-02-05 08:11+0000\n" +"POT-Creation-Date: 2020-02-05 18:22+0000\n" +"PO-Revision-Date: 2020-02-05 18:22+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -38,8 +38,8 @@ msgstr "" #. module: pos_barcode_tare #. openerp-web -#: code:addons/addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:83 -#: code:addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:83 +#: code:addons/addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:89 +#: code:addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:89 #, python-format msgid "Negative weight" msgstr "" @@ -89,18 +89,18 @@ msgstr "" #. module: pos_barcode_tare #. openerp-web -#: code:addons/addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:84 -#: code:addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:84 +#: code:addons/addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:90 +#: code:addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:90 #, python-format msgid "The calculated weight is negative. Did you scan the correct tare label?" msgstr "" #. module: pos_barcode_tare #. openerp-web -#: code:addons/addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:73 -#: code:addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:73 +#: code:addons/addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:74 +#: code:addons/pos_barcode_tare/static/src/js/pos_barcode_tare.js:74 #, python-format -msgid "You scanned a tare barcode. The tare is applied to the last product in order. We can not apply the tare to this product." +msgid "You scanned a tare barcode. The tare should apply to \"%s %s of %s\". We do not know how to convert kg to %s. We can not apply the tare to this product." msgstr "" #. module: pos_barcode_tare diff --git a/pos_barcode_tare/static/src/js/pos_barcode_tare.js b/pos_barcode_tare/static/src/js/pos_barcode_tare.js index 2424fe87..cce04abb 100644 --- a/pos_barcode_tare/static/src/js/pos_barcode_tare.js +++ b/pos_barcode_tare/static/src/js/pos_barcode_tare.js @@ -70,9 +70,16 @@ odoo.define('pos_barcode_tare.screens', function (require) { if (typeof tare_in_product_uom === 'undefined') { this.gui.show_popup('error', {'title': _t('Mismatch in units of measure'), - 'body': _t('You scanned a tare barcode. ' + - 'The tare is applied to the last product in order. '+ - 'We can not apply the tare to this product.')}); + 'body': + _.str.sprintf( + _t('You scanned a tare barcode. ' + + 'The tare should apply to "%s %s of %s". '+ + 'We do not know how to convert kg to %s. ' + + 'We can not apply the tare to this product.'), + total_weight, + product_unit.name, + last_order_line.product.display_name, + product_unit.name)}); return; } // Computes the paid (net) weight. @@ -223,9 +230,9 @@ odoo.define('pos_barcode_tare.screens', function (require) { print: function () { // See comment in print function of ReceiptScreenWidget this.lock_screen(true); - + var self = this; setTimeout(function () { - this.lock_screen(false); + self.lock_screen(false); }, 1000); this.print_web();