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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Mar 7 14:23:00 UTC 2019


 loleaflet/js/global.js |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 52b03a2d1a3a5ad817722da0662ac89e35545e01
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Thu Mar 7 10:10:22 2019 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Thu Mar 7 10:22:12 2019 -0400

    loleaflet: verify if "toLocaleString" function exists
    
    This API has not been standarized yet
    
    Change-Id: I63e1ac88dc660675420af266766163dbe13d31ce

diff --git a/loleaflet/js/global.js b/loleaflet/js/global.js
index 709935b33..f46f68a26 100644
--- a/loleaflet/js/global.js
+++ b/loleaflet/js/global.js
@@ -76,10 +76,14 @@
 		global._ = function (string) {
 			return string;
 		}
-	} else {
+	} else if (typeof String.prototype.toLocaleString === 'function') {
 		global._ = function (string) {
 			return string.toLocaleString();
 		}
+	} else {
+		global._ = function (string) {
+			return string;
+		}
 	}
 
 	var docParams, wopiParams;


More information about the Libreoffice-commits mailing list