]> _ Git - fluidbook-html5.git/commitdiff
WIP #2170 @2
authorStephen Cameron <stephen@cubedesigners.com>
Wed, 1 Aug 2018 12:24:49 +0000 (14:24 +0200)
committerStephen Cameron <stephen@cubedesigners.com>
Wed, 1 Aug 2018 12:24:49 +0000 (14:24 +0200)
js/libs/fluidbook/fluidbook.l10n.js
js/libs/fluidbook/fluidbook.nav.js

index 4990c81883467e7ba509b1d91e69d85d98aaf0d3..de956fe2cda9857c6290f6f1accfdf3fd62ed5de 100644 (file)
@@ -97,7 +97,8 @@ FluidbookL10N.prototype = {
             var o = {lang: l[0], flag: l[1], url: url, langName: l[3], countryName: l[4]};
 
             // $this.multilang[$this.multilang.length] = o;
-            $this.multilang[l[0]] = o; // Indexed by language code to allow easier lookups later
+            var languageID = l[0] + '_' + l[1];
+            $this.multilang[languageID] = o; // Indexed by language code + flag to allow easier lookups later and allow multiple variations of the same language
         });
     },
     getActiveFlag: function () {
@@ -133,6 +134,9 @@ FluidbookL10N.prototype = {
     // Format the language name according to the settings
     getLanguageName: function (languageCode) {
 
+        // Todo: once we have the Fluidbook country/flag avialble (see ticket #2173), we need to use that to build the language code (ie. language_country)
+        // Todo: check if languageCode passed in includes underscore and if not, append the country to make the full language ID matched in this.multilang
+
         var details = this.multilang[languageCode],
             name = '';
 
@@ -190,4 +194,4 @@ FluidbookL10N.prototype = {
         }
         return this.translations[str];
     }
-};
\ No newline at end of file
+};
index 65c3edb26e0444eb7eda13b9ded3df57e5d9ee7d..c6abc0d3c4f37e83ee35dc0525d658c82300098d 100644 (file)
@@ -434,7 +434,9 @@ FluidbookNav.prototype = {
                 }
             } else if (icon == 'lang' && this.fluidbook.l10n.multilangEnabled) {
                 // Note: the "!" at the beginning of the title/help parameters means that we don't want these strings translated
-                link = this.addLink(navType, 'nav-locales', '#/locales', 'locales', '!' + this.fluidbook.l10n.getCurrentLanguageName(), '!Select Language');
+                //link = this.addLink(navType, 'nav-locales', '#/locales', 'locales', '!' + this.fluidbook.l10n.getCurrentLanguageName(), '!Select Language');
+                // Todo: remove this temporary link and re-instate original link above when ticket #2173 is done so we can display proper language name
+                link = this.addLink(navType, 'nav-locales', '#/locales', 'locales', '!Select Language', '!Select Language'); // Label says "Select Language" until we can have the country code recorded for the Fluidbook
             } else if (icon == 'archives') {
                 if (this.fluidbook.datas.archivesLink != '') {
                     link = this.addLink(navType, 'nav-archives', this.fluidbook.datas.archivesLink, 'archives', '!' + this.fluidbook.datas.archivesLabel, '!' + this.fluidbook.datas.archivesLabel);