summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Perais (lpe) <lpe@odoo.com>2019-07-25 13:03:48 +0000
committerLucas Perais (lpe) <lpe@odoo.com>2019-07-25 13:03:48 +0000
commita6f66f8bcf3657d70ba850a17d8d6d436b048524 (patch)
tree1a126c935445c3ddfb332c14c54b219ec7600341
parent3d397f208a69566eca3d64856700a0ab51461311 (diff)
[FIX] web: translatable size of binary fields
Before this commit, the string containing all size units for binary fields was comma separated. The problem with this is that comma got also translated into the language's specific comma-like, whereas in this case it is obviously a technical separator which shouldn't be translated After this commit, we separate unit size with pipes (|), hoping that this character - is easy to find on any keyboard - has no language specific equivalent OPW 2041975 closes odoo/odoo#35183 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
-rw-r--r--addons/web/i18n/web.pot2
-rw-r--r--addons/web/static/src/js/core/utils.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/addons/web/i18n/web.pot b/addons/web/i18n/web.pot
index c492c516f9a..61d6abeec46 100644
--- a/addons/web/i18n/web.pot
+++ b/addons/web/i18n/web.pot
@@ -720,7 +720,7 @@ msgstr ""
#. openerp-web
#: code:addons/web/static/src/js/core/utils.js:332
#, python-format
-msgid "Bytes,Kb,Mb,Gb,Tb,Pb,Eb,Zb,Yb"
+msgid "Bytes|Kb|Mb|Gb|Tb|Pb|Eb|Zb|Yb"
msgstr ""
#. module: web
diff --git a/addons/web/static/src/js/core/utils.js b/addons/web/static/src/js/core/utils.js
index e3911752aaa..bf312dfd905 100644
--- a/addons/web/static/src/js/core/utils.js
+++ b/addons/web/static/src/js/core/utils.js
@@ -351,7 +351,7 @@ var utils = {
* @param {Number} size number of bytes
*/
human_size: function (size) {
- var units = _t("Bytes,Kb,Mb,Gb,Tb,Pb,Eb,Zb,Yb").split(',');
+ var units = _t("Bytes|Kb|Mb|Gb|Tb|Pb|Eb|Zb|Yb").split('|');
var i = 0;
while (size >= 1024) {
size /= 1024;