[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-cd-3-2' - loleaflet/unocommands.js scripts/unocommands.py
Andras Timar
andras.timar at collabora.com
Tue Jul 17 18:07:07 UTC 2018
loleaflet/unocommands.js | 8 +++++++-
scripts/unocommands.py | 8 +++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
New commits:
commit 5e9c10b732b59402ef10449f633e088b58db84f6
Author: Andras Timar <andras.timar at collabora.com>
Date: Tue Jul 17 10:21:12 2018 +0200
loleaflet: remove latin access keys in parentheses (in case of CJK, Indian, etc. langs)
Change-Id: I15763165535771511a4871882dd067fc689baaa3
Reviewed-on: https://gerrit.libreoffice.org/57548
Reviewed-by: Jan Holesovsky <kendy at collabora.com>
Tested-by: Jan Holesovsky <kendy at collabora.com>
diff --git a/loleaflet/unocommands.js b/loleaflet/unocommands.js
index 51dd80c61..83ae47c08 100644
--- a/loleaflet/unocommands.js
+++ b/loleaflet/unocommands.js
@@ -276,5 +276,11 @@ global._UNO = function(string, component, isContext) {
}
}
- return text.replace('~', '');
+ // Remove access key markers from translated strings
+ // 1. access key in parenthesis in case of non-latin scripts
+ text = text.replace(/\(~[A-Za-z]\)/, '');
+ // 2. remove normal access key
+ text = text.replace('~', '');
+
+ return text;
}
diff --git a/scripts/unocommands.py b/scripts/unocommands.py
index d3b7a887d..46cb866c0 100755
--- a/scripts/unocommands.py
+++ b/scripts/unocommands.py
@@ -243,7 +243,13 @@ global._UNO = function(string, component, isContext) {
\t\t}
\t}
-\treturn text.replace('~', '');
+\t// Remove access key markers from translated strings
+\t// 1. access key in parenthesis in case of non-latin scripts
+\ttext = text.replace(/\(~[A-Za-z]\)/, '');
+\t// 2. remove normal access key
+\ttext = text.replace('~', '');
+
+\treturn text;
}\n''')
return descriptions
More information about the Libreoffice-commits
mailing list