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

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 9 13:47:17 UTC 2020


 loleaflet/util/create-l10n-all-js.pl |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 8166a0edaf93ab030af68ddac52910d7a93a2e0a
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Thu Jul 9 15:55:03 2020 +0300
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Thu Jul 9 15:46:57 2020 +0200

    Fix create-l10n-all-js.pl for languages that include script and territory
    
    On Android and iOS, the window.LANG gets set to a value that uses
    hyphens as separators, not underscores. Also, the script is included
    for the Chinese variants. While at it, make the code more lenient:
    Accept either separator and with script or not.
    
    Change-Id: I5a5319572ec96892d22eb3b30586b5b8203bdee1
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98434
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

diff --git a/loleaflet/util/create-l10n-all-js.pl b/loleaflet/util/create-l10n-all-js.pl
index eb88af715..4cb151fde 100644
--- a/loleaflet/util/create-l10n-all-js.pl
+++ b/loleaflet/util/create-l10n-all-js.pl
@@ -53,7 +53,7 @@ if (false) {
     window.LOCALIZATIONS = " . insert('de') . ";
 } else if (onlylang == 'el') {
     window.LOCALIZATIONS = " . insert('el') . ";
-} else if (window.LANG == 'en_GB') {
+} else if (window.LANG == 'en-GB' || window.LANG == 'en_GB') {
     window.LOCALIZATIONS = " . insert('en_GB') . ";
 } else if (onlylang == 'es') {
     window.LOCALIZATIONS = " . insert('es') . ";
@@ -77,7 +77,7 @@ if (false) {
     window.LOCALIZATIONS = " . insert('nn') . ";
 } else if (onlylang == 'pl') {
     window.LOCALIZATIONS = " . insert('pl') . ";
-} else if (window.LANG == 'pt_BR') {
+} else if (window.LANG == 'pt-BR' || window.LANG == 'pt_BR') {
     window.LOCALIZATIONS = " . insert('pt_BR') . ";
 } else if (onlylang == 'pt') {
     window.LOCALIZATIONS = " . insert('pt') . ";
@@ -91,7 +91,9 @@ if (false) {
     window.LOCALIZATIONS = " . insert('tr') . ";
 } else if (onlylang == 'uk') {
     window.LOCALIZATIONS = " . insert('uk') . ";
-} else if (window.LANG == 'zh_TW') {
+} else if (window.LANG == 'zh-CN' || window.LANG == 'zh-Hans-CN' || window.LANG == 'zh_CN' || window.LANG == 'zh_Hans_CN'  ) {
+    window.LOCALIZATIONS = " . insert('zh_CN') . ";
+} else if (window.LANG == 'zh-TW' || window.LANG == 'zh-Hant-TW' || window.LANG == 'zh_TW' || window.LANG == 'zh_Hant_TW') {
     window.LOCALIZATIONS = " . insert('zh_TW') . ";
 } else {
     window.LOCALIZATIONS = {};


More information about the Libreoffice-commits mailing list