[Libreoffice-commits] online.git: loleaflet/dist

Andras Timar andras.timar at collabora.com
Tue Nov 8 13:26:32 UTC 2016


 loleaflet/dist/toolbar/toolbar.js |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 127b39d5b61b522594654fbfd5e52daaf9d789ab
Author: Andras Timar <andras.timar at collabora.com>
Date:   Tue Nov 8 14:25:08 2016 +0100

    fix l10n of word count (thousand separator!)

diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index d0fbb98..470d39b 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -542,7 +542,7 @@ function disableButton(toolbar, state, command)
 function toLocalePattern (pattern, regex, text, sub1, sub2) {
 	var matches = new RegExp(regex, 'g').exec(text);
 	if (matches) {
-		text = pattern.toLocaleString().replace(sub1, matches[1]).replace(sub2, matches[2]);
+		text = pattern.toLocaleString().replace(sub1, parseInt(matches[1].replace(',','')).toLocaleString(String.locale)).replace(sub2, parseInt(matches[2].replace(',','')).toLocaleString(String.locale));
 	}
 	return text;
 }
@@ -974,7 +974,7 @@ map.on('commandstatechanged', function (e) {
 		$('#StatePageNumber').html(state ? state : '    &nbsp');
 	}
 	else if (commandName === '.uno:StateWordCount') {
-		state = toLocalePattern('%1 words, %2 characters', '(\\d+) words, (\\d+) characters', state, '%1', '%2');
+		state = toLocalePattern('%1 words, %2 characters', '([\\d,]+) words, ([\\d,]+) characters', state, '%1', '%2');
 		$('#StateWordCount').html(state ? state : '    &nbsp');
 	}
 	else if (commandName === '.uno:PageStatus') {


More information about the Libreoffice-commits mailing list