loleaflet/js/l10n.js | 9 ++++++++- loleaflet/src/errormessages.js | 7 +------ 2 files changed, 9 insertions(+), 7 deletions(-)
New commits: commit 668b837c70b1d2e8d13d97c173b7a8131fc75a04 Author: Henry Castro <hcas...@collabora.com> AuthorDate: Thu Jan 31 15:35:59 2019 -0400 Commit: Henry Castro <hcas...@collabora.com> CommitDate: Tue Mar 5 15:11:33 2019 -0400 loleaflet: load l10n files according to parameter "lang" Change-Id: I28e6aafa7446b2ea1edbb42bddb77d6d36e68983 diff --git a/loleaflet/js/l10n.js b/loleaflet/js/l10n.js index 0057eed74..d9ca75506 100644 --- a/loleaflet/js/l10n.js +++ b/loleaflet/js/l10n.js @@ -18,6 +18,7 @@ var undef_type = "undefined" , string_type = "string" , nav = {} +, lang = {} , String_ctr = String , has_own_prop = Object.prototype.hasOwnProperty , load_queues = {} @@ -188,6 +189,7 @@ var try { nav = self.navigator; + lang = self.getParameterByName('lang'); } catch(selfNotFoundException) { @@ -240,7 +242,7 @@ if (!browserless && typeof XMLHttpRequest === undef_type && typeof ActiveXObject } String_ctr[$default_locale] = String_ctr[$default_locale] || ""; -String_ctr[$locale] = nav && (nav.language || nav.userLanguage) || ""; +String_ctr[$locale] = nav && lang && (lang) || "en"; if (!browserless || typeof document !== undef_type) { var @@ -268,6 +270,11 @@ if (!browserless || typeof document !== undef_type) { } } } + + load(self.__globalL10n); + load(self.__locoreL10n); + load(self.__helpL10n); + load(self.__unoL10n); } else { diff --git a/loleaflet/src/errormessages.js b/loleaflet/src/errormessages.js index 3381b9126..c2ac2dd74 100644 --- a/loleaflet/src/errormessages.js +++ b/loleaflet/src/errormessages.js @@ -1,15 +1,10 @@ /* -*- js-indent-level: 8 -*- */ -/* global vex _ getParameterByName */ +/* global vex _ */ var errorMessages = {}; vex.defaultOptions.className = 'vex-theme-plain'; -var lang = getParameterByName('lang'); -if (lang) { - String.locale = lang; -} - errorMessages.diskfull = _('No disk space left on server, please contact the server administrator to continue.'); errorMessages.emptyhosturl = _('The host URL is empty. The loolwsd server is probably misconfigured, please contact the administrator.'); errorMessages.limitreached = _('This is an unsupported version of {productname}. To avoid the impression that it is suitable for deployment in enterprises, this message appears when more than {docs} documents or {connections} connections are in use concurrently'); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits