diff options
author | Andras Timar <andras.timar@collabora.com> | 2017-12-27 22:17:22 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-01-26 13:05:35 +0100 |
commit | 791fb5670b802cb4f3ad09973344d14fce18f620 (patch) | |
tree | 00f181f81f90c1adc7086e0479ad8e4afbe807eb | |
parent | 1a77a657aa17ccef0643c8c722d29435131af262 (diff) |
localize StateTableCell status bar string (Sum, Average, Count, etc.)
Change-Id: Ie4d6197115f8f8290f1d6f8608acf2e3e3642c79
Reviewed-on: https://gerrit.libreoffice.org/47107
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit 84bd0d7e5ebe1814eaecc973dedd9f66ee2881d8)
Reviewed-on: https://gerrit.libreoffice.org/47296
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
-rw-r--r-- | loleaflet/dist/toolbar/toolbar.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js index cb0b51a7f..953917c24 100644 --- a/loleaflet/dist/toolbar/toolbar.js +++ b/loleaflet/dist/toolbar/toolbar.js @@ -712,6 +712,20 @@ var userJoinedPopupMessage = '<div>' + _('%user has joined') + '</div>'; var userLeftPopupMessage = '<div>' + _('%user has left') + '</div>'; var userPopupTimeout = null; +function localizeStateTableCell (text) { + var stateArray = text.split(';'); + var stateArrayLength = stateArray.length; + var localizedText = ''; + for (var i = 0; i < stateArrayLength; i++) { + var labelValuePair = stateArray[i].split(':'); + localizedText += _(labelValuePair[0].trim()) + ':' + labelValuePair[1]; + if (stateArrayLength > 1 && i < stateArrayLength - 1) { + localizedText += '; '; + } + } + return localizedText; +} + function toLocalePattern (pattern, regex, text, sub1, sub2) { var matches = new RegExp(regex, 'g').exec(text); if (matches) { @@ -1279,7 +1293,7 @@ map.on('commandstatechanged', function (e) { updateToolbarItem(statusbar, 'StatusSelectionMode', $('#StatusSelectionMode').html(state ? L.Styles.selectionMode[state].toLocaleString() : '  ').parent().html()); } else if (commandName == '.uno:StateTableCell') { - updateToolbarItem(statusbar, 'StateTableCell', $('#StateTableCell').html(state ? state : '  ').parent().html()); + updateToolbarItem(statusbar, 'StateTableCell', $('#StateTableCell').html(state ? localizeStateTableCell(state) : '  ').parent().html()); } else if (commandName === '.uno:StatusBarFunc') { if (state) { |