[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/dist

Pranav Kant pranavk at collabora.co.uk
Sun Feb 4 21:45:30 UTC 2018


 loleaflet/dist/toolbar/toolbar.js |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 198f3e7356684b97a658ab51a7553ca8319dd761
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Fri Feb 2 21:37:58 2018 +0530

    loleaflet: Don't try to translate command names
    
    Command names are sent to loleaflet in already translated form when
    there are appropriate langpacks installed in the system.
    
    Only translate when we can.
    
    Change-Id: I92dc5865da85c76bd5a2529b0e6df994937c4c28
    (cherry picked from commit 34aed93d839f99f46874ae744fa95c269f086d9e)
    Reviewed-on: https://gerrit.libreoffice.org/49157
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index 47b3ef88..fc6cb8dc 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -1375,7 +1375,12 @@ function updateCommandValues() {
 			data = data.concat({text: '\u2500\u2500\u2500\u2500\u2500\u2500', disabled: true});
 
 			commands.forEach(function (command) {
-				data = data.concat({id: command.id, text: L.Styles.styleMappings[command.text].toLocaleString()});
+				var translated = command.text;
+				if (L.Styles.styleMappings[command.text]) {
+					// if it's in English, translate it
+					translated = L.Styles.styleMappings[command.text].toLocaleString();
+				}
+				data = data.concat({id: command.id, text: translated });
 			}, this);
 		}
 


More information about the Libreoffice-commits mailing list