Support language codes that are redirects

Addressing issue #207

Such language codes were not listed in ULS language list.

Root cause was $.uls.data.getLanguagesByScriptGroup was returning
a map of script groups, which contained only resolved language codes.
And later in append method of jquery.uls.lcd.js, there is a check if
that language code is part of languages list passed as option to uls()
call. This test fails and the language code does not get added to display.

Change-Id: Iec914a9694a46eef5750ef3af7346d66e052ab77
This commit is contained in:
Santhosh Thottingal
2016-04-04 16:29:25 +05:30
parent 1e8c2168f6
commit 8b3d77dae1
3 changed files with 8 additions and 11 deletions

View File

@@ -66,13 +66,13 @@
* Adds language to the language list.
* @param {string} langCode
* @param {string} [regionCode]
* @return {bool} Whether the language was added.
* @return {boolean} Whether the language was added.
*/
append: function ( langCode, regionCode ) {
var lcd = this,
i, regions;
if ( !this.options.languages[ langCode ] ) {
if ( !$.uls.data.languages[ langCode ] ) {
// Language is unknown or not in the list of languages for this context.
return false;
}