1754 lines
78 KiB
JavaScript
1754 lines
78 KiB
JavaScript
/*! jquery.uls - v0.1.0 - 2013-03-06
|
|
* https://github.com/wikimedia/jquery.uls
|
|
* Copyright (c) 2013 Santhosh Thottingal; Licensed GPL, MIT */
|
|
|
|
// Please do not edit. This file is generated from data/langdb.yaml by ulsdata2json.php
|
|
( function ( $ ) {
|
|
'use strict';
|
|
$.uls = $.uls || {};
|
|
$.uls.data = {"languages":{"aa":["Latn",["AF"],"Qaf\u00e1r af"],"ab":["Cyrl",["EU"],"\u0410\u04a7\u0441\u0448\u04d9\u0430"],"ace":["Latn",["AS","PA"],"Ac\u00e8h"],"ady":["Cyrl",["EU","ME"],"\u0410\u0434\u044b\u0433\u044d\u0431\u0437\u044d"],"ady-cyrl":["ady"],"ady-latn":["Latn",["EU","ME"],"Adygabze"],"aeb":["Arab",["AF"],"\u0632\u064e\u0648\u064f\u0646"],"af":["Latn",["AF"],"Afrikaans"],"ahr":["Deva",["AS"],"\u0905\u0939\u093f\u0930\u093e\u0923\u0940"],"ak":["Latn",["AF"],"Akan"],"akz":["Latn",["AM"],"Albaamo innaa\u026ciilka"],"aln":["Latn",["EU"],"Geg\u00eb"],"am":["Ethi",["AF"],"\u12a0\u121b\u122d\u129b"],"an":["Latn",["EU"],"aragon\u00e9s"],"ang":["Latn",["EU"],"\u00c6nglisc"],"anp":["Deva",["AS"],"\u0905\u0919\u094d\u0917\u093f\u0915\u093e"],"ar":["Arab",["ME"],"\u0627\u0644\u0639\u0631\u0628\u064a\u0629"],"arc":["Syrc",["ME"],"\u0710\u072a\u0721\u071d\u0710"],"arn":["Latn",["AM"],"mapudungun"],"aro":["Latn",["AM"],"Araona"],"arq":["Latn",["AF"],"Dziri"],"ary":["Latn",["ME"],"Ma\u0121ribi"],"arz":["Arab",["ME"],"\u0645\u0635\u0631\u0649"],"as":["Beng",["AS"],"\u0985\u09b8\u09ae\u09c0\u09af\u09bc\u09be"],"ase":["Sgnw",["AM"],"American sign language"],"ast":["Latn",["EU"],"asturianu"],"av":["Cyrl",["EU"],"\u0430\u0432\u0430\u0440"],"avk":["Latn",["WW"],"Kotava"],"ay":["Latn",["AM"],"Aymar aru"],"az":["az-latn"],"az-latn":["Latn",["EU","ME"],"az\u0259rbaycanca"],"az-arab":["Arab",["EU","ME"],"\u0622\u0630\u0631\u0628\u0627\u064a\u062c\u0627\u0646\u062c\u0627"],"az-cyrl":["Latn",["EU","ME"],"\u0430\u0437\u04d9\u0440\u0431\u0430\u0458\u04b9\u0430\u043d\u04b9\u0430"],"azb":["az-arab"],"ba":["Cyrl",["EU"],"\u0431\u0430\u0448\u04a1\u043e\u0440\u0442\u0441\u0430"],"bar":["Latn",["EU"],"Boarisch"],"bat-smg":["sgs"],"bbc-latn":["Latn",["AS"],"Batak Toba"],"bbc-batk":["Batk",["AS"],"Batak Toba"],"bbc":["Latn",["AS"],"Batak Toba"],"bcc":["Arab",["AS","ME"],"\u0628\u0644\u0648\u0686\u06cc \u0645\u06a9\u0631\u0627\u0646\u06cc"],"bcl":["Latn",["AS"],"Bikol Central"],"be-tarask":["Cyrl",["EU"],"\u0431\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f (\u0442\u0430\u0440\u0430\u0448\u043a\u0435\u0432\u0456\u0446\u0430)"],"be-x-old":["be-tarask"],"be":["Cyrl",["EU"],"\u0431\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f"],"bew":["Latn",["AS"],"Bahasa Betawi"],"bfq":["Taml",["AS"],"\u0baa\u0b9f\u0b95\u0bbe"],"bg":["Cyrl",["EU"],"\u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438"],"bh":["Deva",["AS"],"\u092d\u094b\u091c\u092a\u0941\u0930\u0940"],"bho":["Deva",["AS"],"\u092d\u094b\u091c\u092a\u0941\u0930\u0940"],"bi":["Latn",["PA"],"Bislama"],"bjn":["Latn",["AS"],"Bahasa Banjar"],"bm":["Latn",["AF"],"bamanankan"],"bn":["Beng",["AS"],"\u09ac\u09be\u0982\u09b2\u09be"],"bo":["Tibt",["AS"],"\u0f56\u0f7c\u0f51\u0f0b\u0f61\u0f72\u0f42"],"bpy":["Beng",["AS"],"\u09ac\u09bf\u09b7\u09cd\u09a3\u09c1\u09aa\u09cd\u09b0\u09bf\u09af\u09bc\u09be \u09ae\u09a3\u09bf\u09aa\u09c1\u09b0\u09c0"],"bqi":["Arab",["ME"],"\u0628\u062e\u062a\u064a\u0627\u0631\u064a"],"br":["Latn",["EU"],"brezhoneg"],"brh":["Latn",["ME","AS"],"Br\u00e1hu\u00ed"],"brx":["Deva",["AS"],"\u092c\u0921\u093c\u094b"],"bs":["Latn",["EU"],"bosanski"],"bto":["Latn",["AS"],"Iriga Bicolano"],"bug":["Bugi",["AS"],"\u1a05\u1a14 \u1a15\u1a18\u1a01\u1a17"],"bxr":["Cyrl",["AS"],"\u0431\u0443\u0440\u044f\u0430\u0434"],"ca":["Latn",["EU"],"catal\u00e0"],"cbk-zam":["Latn",["AS"],"Chavacano de Zamboanga"],"cdo":["Latn",["AS"],"M\u00ecng-d\u0115\u0324ng-ng\u1e73\u0304"],"ce":["Cyrl",["EU"],"\u043d\u043e\u0445\u0447\u0438\u0439\u043d"],"ceb":["Latn",["AS"],"Cebuano"],"ch":["Latn",["PA"],"Chamoru"],"cho":["Latn",["AM"],"Choctaw"],"chr":["Cher",["AM"],"\u13e3\u13b3\u13a9"],"chy":["Latn",["AM"],"Tsets\u00eahest\u00e2hese"],"ckb":["Arab",["ME"],"\u06a9\u0648\u0631\u062f\u06cc"],"co":["Latn",["EU"],"corsu"],"cps":["Latn",["AS"],"Capice\u00f1o"],"cr":["Cans",["AM"],"\u14c0\u1426\u1403\u152d\u140d\u140f\u1423"],"cr-cans":["cr"],"cr-latn":["Latn",["AM"],"N\u0113hiyaw\u0113win"],"crh":["Latn",["EU"],"q\u0131r\u0131mtatarca"],"crh-cyrl":["Cyrl",["EU"],"\u043a\u044a\u044b\u0440\u044b\u043c\u0442\u0430\u0442\u0430\u0440\u0434\u0436\u0430"],"crh-latn":["crh"],"cs":["Latn",["EU"],"\u010desky"],"csb":["Latn",["EU"],"kasz\u00ebbsczi"],"cu":["Cyrl",["EU"],"\u0441\u043b\u043e\u0432\u0463\u0301\u043d\u044c\u0441\u043a\u044a \/ \u2c14\u2c0e\u2c11\u2c02\u2c21\u2c10\u2c20\u2c14\u2c0d\u2c1f"],"cv":["Cyrl",["EU"],"\u0427\u04d1\u0432\u0430\u0448\u043b\u0430"],"cy":["Latn",["EU"],"Cymraeg"],"da":["Latn",["EU"],"dansk"],"de-at":["Latn",["EU"],"\u00d6sterreichisches Deutsch"],"de-ch":["Latn",["EU"],"Schweizer Hochdeutsch"],"de-formal":["Latn",["EU"],"Deutsch (Sie-Form)"],"de":["Latn",["EU"],"Deutsch"],"diq":["Latn",["EU","AS"],"Zazaki"],"dsb":["Latn",["EU"],"dolnoserbski"],"dtp":["Latn",["AS"],"Dusun Bundu-liwan"],"dv":["Thaa",["AS"],"\u078b\u07a8\u0788\u07ac\u0780\u07a8\u0784\u07a6\u0790\u07b0"],"dz":["Tibt",["AS"],"\u0f47\u0f7c\u0f44\u0f0b\u0f41"],"ee":["Latn",["AF"],"e\u028begbe"],"egl":["Latn",["EU"],"Emili\u00e0n"],"el":["Grek",["EU"],"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac"],"eml":["Latn",["EU"],"emili\u00e0n e rumagn\u00f2l"],"en-ca":["Latn",["AM"],"Canadian English"],"en-gb":["Latn",["EU","AS","PA"],"British English"],"en":["Latn",["EU","AM","AF","ME","AS","PA","WW"],"English"],"eo":["Latn",["WW"],"Esperanto"],"es-419":["Latn",["AM"],"espa\u00f1ol de America Latina"],"es-formal":["Latn",["EU","AM","AF","WW"],"espa\u00f1ol (formal)"],"es":["Latn",["EU","AM","AF","WW"],"espa\u00f1ol"],"esu":["Latn",["AM"],"Yup'ik"],"et":["Latn",["EU"],"eesti"],"eu":["Latn",["EU"],"euskara"],"ext":["Latn",["EU"],"estreme\u00f1u"],"fa":["Arab",["ME"],"\u0641\u0627\u0631\u0633\u06cc"],"ff":["Latn",["AF"],"Fulfulde"],"fi":["Latn",["EU"],"suomi"],"fit":["Latn",["EU"],"me\u00e4nkieli"],"fiu-vro":["vro"],"fj":["Latn",["PA"],"Na Vosa Vakaviti"],"fo":["Latn",["EU"],"f\u00f8royskt"],"fr":["Latn",["EU","AM","WW"],"fran\u00e7ais"],"frc":["Latn",["AM"],"fran\u00e7ais cadien"],"frp":["Latn",["EU"],"arpetan"],"frr":["Latn",["EU"],"Nordfriisk"],"fur":["Latn",["EU"],"furlan"],"fy":["Latn",["EU"],"Frysk"],"ga":["Latn",["EU"],"Gaeilge"],"gag":["Latn",["EU"],"Gagauz"],"gah":["Latn",["AS"],"Alekano"],"gan-hans":["Hans",["AS"],"\u8d63\u8bed\uff08\u7b80\u4f53"],"gan-hant":["gan"],"gan":["Hant",["AS"],"\u8d1b\u8a9e"],"gbz":["Latn",["AS"],"Dari"],"gcf":["Latn",["AM"],"Guadeloupean Creole French"],"gd":["Latn",["EU"],"G\u00e0idhlig"],"gl":["Latn",["EU"],"galego"],"glk":["Arab",["ME"],"\u06af\u06cc\u0644\u06a9\u06cc"],"gn":["Latn",["AM"],"Ava\u00f1e'\u1ebd"],"gom":["Deva",["AS"],"\u0915\u094b\u0902\u0915\u0923\u0940"],"gom-deva":["gom"],"gom-latn":["Latn",["AS"],"Konknni"],"got":["Goth",["EU"],"\ud800\udf32\ud800\udf3f\ud800\udf44\ud800\udf39\ud800\udf43\ud800\udf3a"],"grc":["Grek",["EU"],"\u1f08\u03c1\u03c7\u03b1\u03af\u03b1 \u1f11\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u1f74"],"gsw":["Latn",["EU"],"Alemannisch"],"gu":["Gujr",["AS"],"\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0"],"guc":["Latn",["AM"],"Way\u00fau"],"gur":["Latn",["AF"],"Guren\u025b"],"gv":["Latn",["EU"],"Gaelg"],"ha-arab":["Arab",["AF"],"\u0647\u064e\u0648\u064f\u0633\u064e"],"ha-latn":["Latn",["AF"],"Hausa"],"ha":["ha-latn"],"hak":["Latn",["AS"],"Hak-k\u00e2-fa"],"haw":["Latn",["AM","PA"],"Hawai`i"],"he":["Hebr",["ME"],"\u05e2\u05d1\u05e8\u05d9\u05ea"],"hi":["Deva",["AS"],"\u0939\u093f\u0928\u094d\u0926\u0940"],"hif":["Latn",["PA","AS"],"Fiji Hindi"],"hif-deva":["Deva",["AS"],"\u092b\u093c\u0940\u091c\u0940 \u0939\u093f\u0928\u094d\u0926\u0940"],"hif-latn":["hif"],"hil":["Latn",["AS"],"Ilonggo"],"hne":["Deva",["AS"],"\u091b\u0924\u094d\u0924\u0940\u0938\u0917\u0922\u093c\u0940"],"ho":["Latn",["PA"],"Hiri Motu"],"hr":["Latn",["EU"],"hrvatski"],"hsb":["Latn",["EU"],"hornjoserbsce"],"hsn":["Hans",["AS"],"\u6e58\u8bed"],"ht":["Latn",["AM"],"Krey\u00f2l ayisyen"],"hu-formal":["Latn",["EU"],"Magyar (mag\u00e1z\u00f3)"],"hu":["Latn",["EU"],"magyar"],"hy":["Armn",["EU","ME"],"\u0540\u0561\u0575\u0565\u0580\u0565\u0576"],"hz":["Latn",["AF"],"Otsiherero"],"ia":["Latn",["WW"],"interlingua"],"id":["Latn",["AS"],"Bahasa Indonesia"],"ie":["Latn",["WW"],"Interlingue"],"ig":["Latn",["AF"],"Igbo"],"ii":["Yiii",["AS"],"\ua187\ua259"],"ik":["Latn",["AM"],"I\u00f1upiak"],"ike-cans":["Cans",["AM"],"\u1403\u14c4\u1483\u144e\u1450\u1466"],"ike-latn":["Latn",["AM"],"inuktitut"],"ilo":["Latn",["AS"],"Ilokano"],"inh":["Cyrl",["EU"],"\u0413\u04c0\u0430\u043b\u0433\u04c0\u0430\u0439"],"io":["Latn",["WW"],"Ido"],"is":["Latn",["EU"],"\u00edslenska"],"it":["Latn",["EU"],"italiano"],"iu":["Cans",["AM"],"\u1403\u14c4\u1483\u144e\u1450\u1466"],"ja":["Jpan",["AS"],"\u65e5\u672c\u8a9e"],"jam":["Latn",["AM"],"Patois"],"jbo":["Latn",["WW"],"Lojban"],"jut":["Latn",["EU"],"jysk"],"jv":["Latn",["AS","PA"],"Basa Jawa"],"jv-java":["Java",["AS","PA"],"\ua9a7\ua9b1\ua997\ua9ae"],"ka":["Geor",["EU"],"\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8"],"kaa":["Latn",["AS"],"Qaraqalpaqsha"],"kab":["Latn",["AF","EU"],"Taqbaylit"],"kbd-cyrl":["kbd"],"kbd-latn":["Latn",["EU"],"Qabardjaj\u0259bza"],"kbd":["Cyrl",["EU","ME"],"\u0410\u0434\u044b\u0433\u044d\u0431\u0437\u044d"],"kea":["Latn",["AF"],"Kabuverdianu"],"kg":["Latn",["AF"],"Kongo"],"kgp":["Latn",["AM"],"Kaing\u00e1ng"],"khw":["Arab",["ME","AS"],"\u06a9\u06be\u0648\u0627\u0631"],"ki":["Latn",["AF"],"G\u0129k\u0169y\u0169"],"kiu":["Latn",["EU","ME"],"K\u0131rmancki"],"kj":["Latn",["AF"],"Kwanyama"],"kk":["kk-cyrl"],"kk-arab":["Arab",["EU","AS"],"\u0642\u0627\u0632\u0627\u0642\u0634\u0627 (\u062a\u0674\u0648\u062a\u06d5)"],"kk-cn":["kk-arab"],"kk-cyrl":["Cyrl",["EU","AS"],"\u049b\u0430\u0437\u0430\u049b\u0448\u0430"],"kk-kz":["kk-cyrl"],"kk-latn":["Latn",["EU","AS","ME"],"qazaq\u015fa"],"kk-tr":["kk-latn"],"kl":["Latn",["AM","EU"],"kalaallisut"],"km":["Khmr",["AS"],"\u1797\u17b6\u179f\u17b6\u1781\u17d2\u1798\u17c2\u179a"],"kn":["Knda",["AS"],"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1"],"ko-kp":["Kore",["AS"],"\ud55c\uad6d\uc5b4 (\uc870\uc120)"],"ko":["Kore",["AS"],"\ud55c\uad6d\uc5b4"],"koi":["Cyrl",["EU"],"\u041f\u0435\u0440\u0435\u043c \u041a\u043e\u043c\u0438"],"kr":["Latn",["AF"],"Kanuri"],"krc":["Cyrl",["EU"],"\u043a\u044a\u0430\u0440\u0430\u0447\u0430\u0439-\u043c\u0430\u043b\u043a\u044a\u0430\u0440"],"kri":["Latn",["AF"],"Krio"],"krj":["Latn",["ME","EU"],"Kinaray-a"],"krl":["Latn",["EU"],"Karjala"],"ks-arab":["Arab",["AS"],"\u06a9\u0672\u0634\u064f\u0631"],"ks-deva":["Deva",["AS"],"\u0915\u0949\u0936\u0941\u0930"],"ks":["Arab",["AS"],"\u06a9\u0672\u0634\u064f\u0631"],"ksf":["Latn",["AF"],"Bafia"],"ksh":["Latn",["EU"],"Ripoarisch"],"ku":["ku-latn"],"ku-arab":["Arab",["EU","ME"],"\u0643\u0648\u0631\u062f\u064a"],"ku-latn":["Latn",["EU","ME"],"Kurd\u00ee"],"kv":["Cyrl",["EU"],"\u043a\u043e\u043c\u0438"],"kw":["Latn",["EU"],"kernowek"],"ky":["Cyrl",["AS"],"\u041a\u044b\u0440\u0433\u044b\u0437\u0447\u0430"],"la":["Latn",["EU"],"Latina"],"lad":["lad-latn"],"lad-latn":["Latn",["ME","EU","AM"],"Ladino"],"lad-hebr":["Hebr",["ME","EU","AM"],"\u05dc\u05d0\u05d3\u05d9\u05e0\u05d5"],"lb":["Latn",["EU"],"L\u00ebtzebuergesch"],"lbe":["Cyrl",["EU"],"\u043b\u0430\u043a\u043a\u0443"],"lez":["Cyrl",["EU"],"\u043b\u0435\u0437\u0433\u0438"],"lfn":["Latn",["WW"],"Lingua Franca Nova"],"lg":["Latn",["AF"],"Luganda"],"li":["Latn",["EU"],"Limburgs"],"lij":["Latn",["EU"],"Ligure"],"liv":["Latn",["EU"],"L\u012bv\u00f5 k\u0113\u013c"],"lld":["Latn",["EU"],"Ladin"],"lmo":["Latn",["EU"],"lumbaart"],"ln":["Latn",["AF"],"ling\u00e1la"],"lo":["Laoo",["AS"],"\u0ea5\u0eb2\u0ea7"],"loz":["Latn",["AF"],"Silozi"],"lt":["Latn",["EU"],"lietuvi\u0173"],"ltg":["Latn",["EU"],"latga\u013cu"],"lus":["Latn",["AS"],"Mizo \u0163awng"],"lv":["Latn",["EU"],"latvie\u0161u"],"lzh":["Hant",["AS"],"\u6587\u8a00"],"lzz":["Latn",["EU","ME"],"Lazuri"],"mai":["Deva",["AS"],"\u092e\u0948\u0925\u093f\u0932\u0940"],"map-bms":["Latn",["AS"],"Basa Banyumasan"],"mdf":["Cyrl",["EU"],"\u043c\u043e\u043a\u0448\u0435\u043d\u044c"],"mfe":["Latn",["AM"],"Morisyen"],"mg":["Latn",["AF"],"Malagasy"],"mh":["Latn",["PA"],"Ebon"],"mhr":["Cyrl",["EU"],"\u043e\u043b\u044b\u043a \u043c\u0430\u0440\u0438\u0439"],"mi":["Latn",["PA"],"M\u0101ori"],"mic":["Latn",["AM"],"Mi'kmaq"],"min":["Latn",["AS"],"Baso Minangkabau"],"mk":["Cyrl",["EU"],"\u043c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438"],"ml":["Mlym",["AS","ME"],"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02"],"mn":["Cyrl",["AS"],"\u043c\u043e\u043d\u0433\u043e\u043b"],"mnc":["Mong",["AS"],"\u182e\u1820\u1828\u1835\u1860 \u1864\u1873\u1830\u1860\u1828"],"mni":["Beng",["AS"],"\u09ae\u09c7\u0987\u09a4\u09c7\u0987 \u09b2\u09cb\u09a8\u09cd"],"mnw":["Mymr",["AS"],"\u1018\u102c\u101e\u102c \u1019\u1014\u103a"],"mo":["Cyrl",["EU"],"\u043c\u043e\u043b\u0434\u043e\u0432\u0435\u043d\u044f\u0441\u043a\u044d"],"mr":["Deva",["AS","ME"],"\u092e\u0930\u093e\u0920\u0940"],"mrj":["Cyrl",["EU"],"\u043a\u044b\u0440\u044b\u043a \u043c\u0430\u0440\u044b"],"ms":["Latn",["AS"],"Bahasa Melayu"],"mt":["Latn",["EU"],"Malti"],"mui":["Latn",["AS"],"Musi"],"mus":["Latn",["AM"],"Mvskoke"],"mwl":["Latn",["EU"],"Mirand\u00e9s"],"mwv":["Latn",["AS"],"Behase Mentawei"],"my":["Mymr",["AS"],"\u1019\u103c\u1014\u103a\u1019\u102c\u1018\u102c\u101e\u102c"],"myv":["Cyrl",["EU"],"\u044d\u0440\u0437\u044f\u043d\u044c"],"mzn":["Arab",["ME","AS"],"\u0645\u0627\u0632\u0650\u0631\u0648\u0646\u06cc"],"na":["Latn",["PA"],"Dorerin Naoero"],"nah":["Latn",["AM"],"N\u0101huatl"],"nan":["Latn",["AS"],"B\u00e2n-l\u00e2m-g\u00fa"],"nap":["Latn",["EU"],"Nnapulitano"],"nb":["Latn",["EU"],"norsk (bokm\u00e5l)"],"nds-nl":["Latn",["EU"],"Nedersaksisch"],"nds":["Latn",["EU"],"Plattd\u00fc\u00fctsch"],"ne":["Deva",["AS"],"\u0928\u0947\u092a\u093e\u0932\u0940"],"new":["Deva",["AS"],"\u0928\u0947\u092a\u093e\u0932 \u092d\u093e\u0937\u093e"],"ng":["Latn",["AF"],"Oshiwambo"],"niu":["Latn",["PA"],"ko e vagahau Niu\u0113"],"njo":["Latn",["AS"],"Ao"],"nl-informal":["Latn",["EU","AM"],"Nederlands (informeel)"],"nl":["Latn",["EU","AM"],"Nederlands"],"nn":["Latn",["EU"],"norsk (nynorsk)"],"no":["Latn",["EU"],"norsk"],"nov":["Latn",["WW"],"Novial"],"nqo":["Nkoo",["AF"],"\u07d2\u07de\u07cf"],"nrm":["Latn",["EU"],"Nouormand"],"nso":["Latn",["AF"],"Sesotho sa Leboa"],"nv":["Latn",["AM"],"Din\u00e9 bizaad"],"ny":["Latn",["AF"],"Chi-Chewa"],"oc":["Latn",["EU"],"occitan"],"om":["Latn",["AF"],"Oromoo"],"or":["Orya",["AS"],"\u0b13\u0b21\u0b3c\u0b3f\u0b06"],"os":["Cyrl",["EU"],"\u0418\u0440\u043e\u043d"],"pa":["pa-guru"],"pa-guru":["Guru",["AS"],"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40"],"pag":["Latn",["AS"],"Pangasinan"],"pam":["Latn",["AS"],"Kapampangan"],"pap":["Latn",["AM"],"Papiamentu"],"pcd":["Latn",["EU"],"Picard"],"pdc":["Latn",["EU","AM"],"Deitsch"],"pdt":["Latn",["EU","AM"],"Plautdietsch"],"pfl":["Latn",["EU"],"P\u00e4lzisch"],"pi":["Deva",["AS"],"\u092a\u093e\u0932\u093f"],"pih":["Latn",["PA"],"Norfuk \/ Pitkern"],"pis":["Latn",["PA"],"Pijin"],"pko":["Latn",["AF"],"P\u00f6koot"],"pl":["Latn",["EU"],"polski"],"pms":["Latn",["EU"],"Piemont\u00e8is"],"pnb":["Arab",["AS","ME"],"\u067e\u0646\u062c\u0627\u0628\u06cc"],"pnt":["Grek",["EU"],"\u03a0\u03bf\u03bd\u03c4\u03b9\u03b1\u03ba\u03ac"],"ppl":["Latn",["AM"],"Nawat"],"prg":["Latn",["EU"],"Pr\u016bsiskan"],"ps":["Arab",["AS","ME"],"\u067e\u069a\u062a\u0648"],"pt-br":["Latn",["AM"],"portugu\u00eas do Brasil"],"pt":["Latn",["EU","AM","AS","PA","AF","WW"],"portugu\u00eas"],"qu":["Latn",["AM"],"Runa Simi"],"qug":["Latn",["AM"],"Runa shimi"],"rap":["Latn",["AM"],"arero rapa nui"],"rgn":["Latn",["EU"],"Rumagn\u00f4l"],"rif":["Latn",["AF"],"Tarifit"],"rki":["Mymr",["AS"],"\u101b\u1001\u102d\u102f\u1004\u103a"],"rm":["Latn",["EU"],"rumantsch"],"rmy":["Latn",["EU"],"Romani"],"rn":["Latn",["AF"],"Kirundi"],"ro":["Latn",["EU"],"rom\u00e2n\u0103"],"roa-rup":["rup"],"roa-tara":["Latn",["EU"],"tarand\u00edne"],"rtm":["Latn",["PA"],"Faeag Rotuma"],"ru":["Cyrl",["EU","AS","ME"],"\u0440\u0443\u0441\u0441\u043a\u0438\u0439"],"rue":["Cyrl",["EU"],"\u0440\u0443\u0441\u0438\u043d\u044c\u0441\u043a\u044b\u0439"],"rup":["Latn",["EU"],"Arm\u00e3neashce"],"ruq":["Cyrl",["EU"],"\u0412\u043b\u0430\u0445\u0435\u0441\u0442\u0435"],"ruq-cyrl":["ruq"],"ruq-grek":["Grek",["EU"],"Megleno-Romanian (Greek script)"],"ruq-latn":["Latn",["EU"],"Vl\u0103he\u015fte"],"rw":["Latn",["AF"],"Kinyarwanda"],"ryu":["Kana",["AS"],"\u0294ucin\u0101guci"],"sa":["Deva",["AS"],"\u0938\u0902\u0938\u094d\u0915\u0943\u0924\u092e\u094d"],"sah":["Cyrl",["EU","AS"],"\u0441\u0430\u0445\u0430 \u0442\u044b\u043b\u0430"],"sat":["Latn",["AS"],"Santali"],"saz":["Saur",["AS"],"\ua8b1\ua8c3\ua8ac\ua8b5\ua8af\ua8c4\ua8a1\ua8c4\ua8ac\ua8b5"],"sc":["Latn",["EU"],"sardu"],"scn":["Latn",["EU"],"sicilianu"],"sco":["Latn",["EU"],"Scots"],"sd":["Arab",["AS"],"\u0633\u0646\u068c\u064a"],"sdc":["Latn",["EU"],"Sassaresu"],"se":["Latn",["EU"],"s\u00e1megiella"],"sei":["Latn",["AM"],"Cmique Itom"],"sg":["Latn",["AF"],"S\u00e4ng\u00f6"],"sgs":["Latn",["EU"],"\u017eemait\u0117\u0161ka"],"sh":["Latn",["EU"],"srpskohrvatski"],"shi-latn":["Latn",["AF"],"Ta\u0161l\u1e25iyt"],"shi-tfng":["Tfng",["AF"],"\u2d5c\u2d30\u2d5b\u2d4d\u2d43\u2d49\u2d5c"],"shi":["shi-latn"],"shn":["Mymr",["AS"],"\u101c\u102d\u1075\u103a\u1088\u1010\u1086\u1038"],"si":["Sinh",["AS"],"\u0dc3\u0dd2\u0d82\u0dc4\u0dbd"],"simple":["Latn",["WW"],"Simple English"],"sk":["Latn",["EU"],"sloven\u010dina"],"sl":["Latn",["EU"],"sloven\u0161\u010dina"],"sli":["Latn",["EU"],"Schl\u00e4sch"],"slr":["Latn",["AS"],"Sal\u0131r\u00e7a"],"sly":["Latn",["AS"],"Bahasa Selayar"],"sm":["Latn",["PA"],"Gagana Samoa"],"sma":["Latn",["EU"],"\u00e5arjelsaemien"],"smj":["Latn",["EU"],"julevs\u00e1megiella"],"smn":["Latn",["EU"],"anar\u00e2\u0161kiel\u00e2"],"sms":["Latn",["EU"],"s\u00e4\u00e4\u00b4m\u01e9i\u00f5ll"],"sn":["Latn",["AF"],"chiShona"],"so":["Latn",["AF"],"Soomaaliga"],"sq":["Latn",["EU"],"shqip"],"sr":["sr-cyrl"],"sr-ec":["sr-cyrl"],"sr-cyrl":["Cyrl",["EU"],"\u0441\u0440\u043f\u0441\u043a\u0438"],"sr-el":["sr-latn"],"sr-latn":["Latn",["EU"],"srpski"],"srn":["Latn",["AM","EU"],"Sranantongo"],"ss":["Latn",["AF"],"SiSwati"],"st":["Latn",["AF"],"Sesotho"],"stq":["Latn",["EU"],"Seeltersk"],"su":["Latn",["AS"],"Basa Sunda"],"sv":["Latn",["EU"],"svenska"],"sw":["Latn",["AF"],"Kiswahili"],"swb":["Latn",["AF"],"Shikomoro"],"sxu":["Latn",["EU"],"S\u00e4ggssch"],"szl":["Latn",["EU"],"\u015bl\u016fnski"],"ta":["Taml",["AS"],"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd"],"tcy":["Knda",["AS"],"\u0ca4\u0cc1\u0cb3\u0cc1"],"te":["Telu",["AS"],"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41"],"tet":["Latn",["AS","PA"],"tetun"],"tg-cyrl":["Cyrl",["AS"],"\u0442\u043e\u04b7\u0438\u043a\u04e3"],"tg-latn":["Latn",["AS"],"tojik\u012b"],"tg":["Cyrl",["AS"],"\u0442\u043e\u04b7\u0438\u043a\u04e3"],"th":["Thai",["AS"],"\u0e44\u0e17\u0e22"],"ti":["Ethi",["AF"],"\u1275\u130d\u122d\u129b"],"tk":["Latn",["AS"],"T\u00fcrkmen\u00e7e"],"tkr":["Cyrl",["AS"],"\u0426\u04c0\u0430\u044c\u0445\u043d\u0430 \u043c\u0438\u0437"],"tl":["Latn",["AS"],"Tagalog"],"tly":["Cyrl",["EU","AS","ME"],"\u0442\u043e\u043b\u044b\u0448\u04d9 \u0437\u044b\u0432\u043e\u043d"],"tn":["Latn",["AF"],"Setswana"],"to":["Latn",["PA"],"lea faka-Tonga"],"tokipona":["Latn",["WW"],"Toki Pona"],"tpi":["Latn",["PA","AS"],"Tok Pisin"],"tr":["Latn",["EU","ME"],"T\u00fcrk\u00e7e"],"trp":["Latn",["AS"],"Kokborok (Tripuri)"],"tru":["Latn",["AS"],"\u1e6auroyo"],"ts":["Latn",["AF"],"Xitsonga"],"tsd":["Grek",["EU"],"\u03a4\u03c3\u03b1\u03ba\u03c9\u03bd\u03b9\u03ba\u03ac"],"tt":["Cyrl",["EU"],"\u0442\u0430\u0442\u0430\u0440\u0447\u0430"],"tt-cyrl":["tt"],"tt-latn":["Latn",["EU"],"tatar\u00e7a"],"ttt":["Cyrl",["AS"],"Tati"],"tum":["Latn",["AF"],"chiTumbuka"],"tw":["Latn",["AF"],"Twi"],"twd":["Latn",["EU"],"Tweants"],"ty":["Latn",["PA"],"Reo M\u0101`ohi"],"tyv":["Cyrl",["AS"],"\u0442\u044b\u0432\u0430 \u0434\u044b\u043b"],"tzm":["Tfng",["AF"],"\u2d5c\u2d30\u2d4e\u2d30\u2d63\u2d49\u2d56\u2d5c"],"udm":["Cyrl",["EU"],"\u0443\u0434\u043c\u0443\u0440\u0442"],"ug":["ug-arab"],"ug-arab":["Arab",["AS"],"\u0626\u06c7\u064a\u063a\u06c7\u0631\u0686\u06d5"],"ug-latn":["Latn",["AS"],"uyghurche"],"ug-cyrl":["Cyrl",["AS"],"\u0443\u0439\u0493\u0443\u0440\u0447\u04d9"],"uk":["Cyrl",["EU"],"\u0443\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430"],"ur":["Arab",["AS","ME"],"\u0627\u0631\u062f\u0648"],"uz":["Latn",["AS"],"o\u02bbzbekcha"],"ve":["Latn",["AF"],"Tshivenda"],"vec":["Latn",["EU"],"v\u00e8neto"],"vep":["Latn",["EU"],"veps\u00e4n kel\u2019"],"vi":["Latn",["AS"],"Ti\u1ebfng Vi\u1ec7t"],"vls":["Latn",["EU"],"West-Vlams"],"vmf":["Latn",["EU"],"Mainfr\u00e4nkisch"],"vo":["Latn",["WW"],"Volap\u00fck"],"vot":["Latn",["EU"],"Va\u010f\u010fa"],"vro":["Latn",["EU"],"V\u00f5ro"],"wa":["Latn",["EU"],"walon"],"war":["Latn",["AS"],"Winaray"],"wls":["Latn",["PA"],"Faka'uvea"],"wo":["Latn",["AF"],"Wolof"],"wuu":["Hans",["EU"],"\u5434\u8bed"],"xal":["Cyrl",["EU"],"\u0445\u0430\u043b\u044c\u043c\u0433"],"xh":["Latn",["AF"],"isiXhosa"],"xmf":["Geor",["EU"],"\u10db\u10d0\u10e0\u10d2\u10d0\u10da\u10e3\u10e0\u10d8"],"ydd":["Hebr",["AS","EU"],"Eastern Yiddish"],"yi":["Hebr",["ME","EU","AM"],"\u05d9\u05d9\u05b4\u05d3\u05d9\u05e9"],"yo":["Latn",["AF"],"Yor\u00f9b\u00e1"],"yrk":["Cyrl",["AS"],"\u041d\u0435\u043d\u044d\u0446\u044f\u02bc \u0432\u0430\u0434\u0430"],"yrl":["Latn",["AM"],"\u00f1e'engat\u00fa"],"yua":["Latn",["AM"],"Maaya T'aan"],"yue":["Hant",["AS"],"\u7cb5\u8a9e"],"za":["Latn",["AS"],"Vahcuengh"],"zea":["Latn",["EU"],"Ze\u00eauws"],"zh":["Hans",["AS"],"\u4e2d\u6587"],"zh-classical":["Hant",["AS"],"\u6587\u8a00"],"zh-cn":["Hans",["AS"],"\u4e2d\u6587\uff08\u4e2d\u56fd\u5927\u9646\uff09"],"zh-hans":["Hans",["AS"],"\u4e2d\u6587\uff08\u7b80\u4f53\uff09"],"zh-hant":["Hant",["AS"],"\u4e2d\u6587\uff08\u7e41\u9ad4\uff09"],"zh-hk":["Hant",["AS"],"\u4e2d\u6587\uff08\u9999\u6e2f\uff09"],"zh-min-nan":["nan"],"zh-mo":["Hant",["AS"],"\u4e2d\u6587\uff08\u6fb3\u9580\uff09"],"zh-my":["Hans",["AS"],"\u4e2d\u6587\uff08\u9a6c\u6765\u897f\u4e9a\uff09"],"zh-sg":["Hans",["AS"],"\u4e2d\u6587\uff08\u65b0\u52a0\u5761\uff09"],"zh-tw":["Hant",["AS"],"\u4e2d\u6587\uff08\u53f0\u7063\uff09"],"zh-yue":["yue"],"zu":["Latn",["AF"],"isiZulu"]},"scriptgroups":{"Latin":["Latn","Goth"],"Greek":["Grek"],"WestCaucasian":["Armn","Geor"],"Arabic":["Arab"],"MiddleEastern":["Hebr","Syrc"],"African":["Ethi","Nkoo","Tfng"],"SouthAsian":["Beng","Deva","Gujr","Guru","Knda","Mlym","Orya","Saur","Sinh","Taml","Telu","Tibt","Thaa"],"Cyrillic":["Cyrl"],"CJK":["Hans","Hant","Kana","Kore","Jpan","Yiii"],"SouthEastAsian":["Batk","Bugi","Java","Khmr","Laoo","Mymr","Thai"],"Mongolian":["Mong"],"SignWriting":["Sgnw"],"NativeAmerican":["Cher","Cans"]},"rtlscripts":["Arab","Hebr","Syrc","Nkoo","Thaa"],"regiongroups":{"WW":1,"SP":1,"AM":2,"EU":3,"ME":3,"AF":3,"AS":4,"PA":4},"territories":{"AC":["en"],"AD":["ca","es","fr"],"AE":["ar","ml","ps","bal","fa"],"AF":["fa","ps","haz","uz-arab","tk","prd","bal","ug-arab","kk-arab"],"AG":["en","pt"],"AI":["en"],"AL":["sq","el","mk"],"AM":["hy","az-latn","ku-latn"],"AO":["pt","umb","kmb"],"AQ":["und"],"AR":["es","cy","gn"],"AS":["sm","en"],"AT":["de","hr","sl","hu"],"AU":["en","zh-hant","it"],"AW":["nl","pap","en"],"AX":["sv"],"AZ":["az-latn","az-cyrl","ku-latn"],"BA":["bs","hr","sr-cyrl","sr-latn"],"BB":["en"],"BD":["bn","syl","ccp","my","grt","mni"],"BE":["nl","en","fr","wa","de"],"BF":["mos","dyu","fr"],"BG":["bg","tr"],"BH":["ar","ml"],"BI":["rn","fr","sw"],"BJ":["fr","fon","yo"],"BL":["fr"],"BM":["en"],"BN":["ms","zh-hant","en"],"BO":["es","qu","ay","gn"],"BQ":[],"BR":["pt","de","it","ja","ko","kgp","gub","xav"],"BS":["en"],"BT":["dz","ne","tsj","lep"],"BV":["und"],"BW":["en","tn","af"],"BY":["be","ru"],"BZ":["en","es"],"CA":["en","fr","it","de","cr","crk","iu","moe","crj","atj","crl","csw","crm","ikt","dgr","den","scs","nsk","chp","gwi"],"CC":["ms","en"],"CD":["sw","lua","fr","ln","lu","kg","lol","rw"],"CF":["fr","sg"],"CG":["fr","ln"],"CH":["de","fr","gsw","it","lmo","rm","rmo","wae"],"CI":["fr","bci","sef","daf","kfo","bqv"],"CK":["en"],"CL":["es"],"CM":["fr","en","ar","ha-arab"],"CN":["zh-hans","ii","ug-arab","za","mn-mong","bo","ko","kk-arab","lis","ky-arab","nbf","khb","tdd","lcp","en","ru","vi","uz-cyrl"],"CO":["es"],"CP":["fr"],"CR":["es"],"CU":["es"],"CV":["kea","pt"],"CW":[],"CX":["en"],"CY":["el","tr","hy","ar"],"CZ":["cs","de","pl"],"DE":["de","en","nds","tr","hr","it","ku-latn","ru","el","ksh","pl","es","nl","da"],"DG":["en"],"DJ":["aa","so","ar","fr"],"DK":["da","de","kl"],"DM":["en"],"DO":["es","en"],"DZ":["ar","fr","kab"],"EA":["es"],"EC":["es"],"EE":["et","ru"],"EG":["ar","el"],"EH":["ar"],"ER":["ti","tig","ar","ssy","aa","byn"],"ES":["es","en","ca","gl","eu","ast"],"ET":["en","am","om","so","ti","sid","wal","aa"],"FI":["fi","sv","ru","en","et","rmf","se","smn","sms"],"FJ":["en","hi","fj"],"FK":["en"],"FM":["chk","pon","kos","yap","en","uli"],"FO":["fo"],"FR":["fr","en","oc","it","pt","gsw","br","co","ca","nl","eu"],"GA":["fr","puu","mdt"],"GB":["en","sco","cy","pa-guru","bn","zh-hant","syl","el","it","ks","gd","ml","ga","fr","kw"],"GD":["en"],"GE":["ka","ru","hy","ab","os","ku-latn"],"GF":["fr","gcr","zh-hant"],"GG":["en"],"GH":["ak","ee","abr","en","gaa","ha-latn"],"GI":["en"],"GL":["kl","da"],"GM":["en"],"GN":["fr","ff","man","sus","kpe"],"GP":["fr"],"GQ":["es","fan","fr","bvb","syi"],"GR":["el","mk","tr","bg","sq"],"GS":["und"],"GT":["es"],"GU":["en","ch"],"GW":["pt"],"GY":["en"],"HK":["zh-hant","en","zh-hans"],"HM":["und"],"HN":["es","en"],"HR":["hr","it"],"HT":["ht","fr"],"HU":["hu","de","ro","hr","sk","sl"],"IC":["es"],"ID":["id","jv","su","mad","ms","min","bya","bjn","ban","bug","ace","bew","sas","bbc","zh-hant","mak","ljp","rej","gor","nij","kge","aoz","mgy","kvr","lbw","rob","mdr","sxn"],"IE":["en","ga"],"IL":["he","ar","ru","ro","en","pl","hu","am","ti","ml"],"IM":["en","gv"],"IN":["hi","en","bn","te","mr","ta","ur","gu","kn","ml","or","pa-guru","bho","awa","as","bgc","mag","mwr","mai","hne","dcc","bjj","ne","sat","wtm","ks","kok","swv","gbm","lmn","sd-arab","gon","kfy","doi","kru","sck","tcy","wbq","xnr","wbr","khn","brx","noe","bhb","mni","raj","hoc","mtr","unr","bhi","hoj","kha","kfr","grt","unx","bfy","srx","saz","ccp","sd-deva","bfq","ria","bo","bft","bra","lep","btv","lif","lah","sa","kht","dv","dz"],"IO":["en"],"IQ":["ar","ku-arab","fa"],"IR":["fa","az-arab","glk","ckb","tk","sdh","lrc","ar","bal","rmt","bqi","luz","ku-arab","lki","prd","hy","ps","ka","kk-arab"],"IS":["is","da"],"IT":["it","en","nap","scn","fur","de","fr","sl","ca","el","hr"],"JE":["en"],"JM":["en"],"JO":["ar"],"JP":["ja","ryu","ko"],"KE":["en","sw","ki","luy","luo","kam","kln","guz","mer","mas","ebu","so","dav","teo","pko","om","saq","ar","pa-guru","gu"],"KG":["ky-cyrl","ru"],"KH":["km","cja","kdt"],"KI":["en","gil"],"KM":["ar","fr","zdj"],"KN":["en"],"KP":["ko"],"KR":["ko"],"KW":["ar"],"KY":["en"],"KZ":["ru","kk-cyrl","de","ug-cyrl"],"LA":["lo","kdt"],"LB":["ar","hy","ku-arab","fr","en"],"LC":["en"],"LI":["de","gsw","wae"],"LK":["si","ta","en"],"LR":["en","kpe","vai","men"],"LS":["st","zu","ss","en","xh"],"LT":["lt","ru"],"LU":["fr","lb","de"],"LV":["lv","ru"],"LY":["ar"],"MA":["ar","fr","tzm","shi-tfng","shi-latn","rif","es"],"MC":["fr"],"MD":["ro","bg","gag","ru"],"ME":["sr-latn","sq"],"MF":["fr"],"MG":["mg","fr","en"],"MH":["en","mh"],"MK":["mk","sq","tr"],"ML":["bm","fr","ffm","snk","mwk","ses","tmh","khq","dtm","kao","bzx","ar","bmq","bze"],"MM":["my","shn","mnw","kht"],"MN":["mn-cyrl","kk-arab","zh-hans","ru","ug-cyrl"],"MO":["zh-hant","pt","zh-hans"],"MP":["en","ch"],"MQ":["fr"],"MR":["ar","fr","ff","wo"],"MS":["en"],"MT":["mt","en"],"MU":["mfe","en","bho","ur","fr","ta"],"MV":["dv"],"MW":["en","ny","tum","zu"],"MX":["es","yua","nhe","nhw","maz","nch"],"MY":["ms","en","zh-hant","ta","bjn","jv","zmi","ml","bug"],"MZ":["pt","vmw","ndc","ts","ngl","seh","rng","ny","yao","sw","zu"],"NA":["kj","ng","naq","en","af","de","tn"],"NC":["fr"],"NE":["ha-latn","fr","dje","fuq","tmh","ar","twq"],"NF":["en"],"NG":["en","ha-latn","ig","yo","fuv","tiv","efi","ibb","ha-arab","bin","kaj","kcg","ar","cch","amo"],"NI":["es"],"NL":["nl","en","li","fy","gos","id","zea","rif","tr"],"NO":["nb","nn","se"],"NP":["ne","mai","bho","new","jml","taj","awa","thl","bap","lif","tdg","thr","mgp","thq","mrd","bfy","rkt","xsr","tsf","hi","ggn","gvr","bo","tkt","tdh","bn","unr","lep"],"NR":["en","na"],"NU":["en","niu"],"NZ":["en","mi"],"OM":["ar","bal","fa"],"PA":["es","en","zh-hant"],"PE":["es","qu","ay"],"PF":["fr","ty","zh-hant"],"PG":["tpi","en","ho"],"PH":["en","fil","es","ceb","ilo","hil","bik","war","bhk","pam","pag","mdh","tsg","zh-hant","bto","hnn","tbw","bku"],"PK":["ur","pa-arab","en","lah","ps","sd-arab","skr","bal","brh","hno","fa","hnd","tg-arab","gju","bft","kvx","khw","mvy","kxp","gjk","ks","btv"],"PL":["pl","de","be","uk","csb"],"PM":["fr","en"],"PN":["en"],"PR":["es","en"],"PS":["ar"],"PT":["pt","gl"],"PW":["pau","en"],"PY":["gn","es","de"],"QA":["ar","fa","ml"],"RE":["fr","rcf","ta"],"RO":["ro","hu","de","tr","sr-latn","bg","el","pl"],"RS":["sr-cyrl","sr-latn","sq","hu","ro","sk"],"RU":["ru","tt","ba","cv","ce","av","udm","chm","sah","kbd","myv","dar","bua","mdf","kum","kv","lez","krc","inh","tyv","ady","krl","koi","lbe","mrj","alt","fi","sr-latn","mn-cyrl"],"RW":["rw","fr","en"],"SA":["ar"],"SB":["en"],"SC":["crs","fr","en"],"SD":["ar","ha-arab"],"SE":["sv","fi","se","smj","sma","ia"],"SG":["en","zh-hans","ms","ta","ml","pa-guru"],"SH":["en"],"SI":["sl","hu","it"],"SJ":["nb","ru"],"SK":["sk","hu","uk","pl","de"],"SL":["kri","en","men","tem"],"SM":["it","eo"],"SN":["fr","wo","ff","srr"],"SO":["so","sw","om"],"SR":["nl","srn","zh-hant"],"SS":["ar","en"],"ST":["pt"],"SV":["es"],"SX":[],"SY":["ar","ku-latn","fr","hy","syr"],"SZ":["en","ss","zu","ts"],"TA":["en"],"TC":["en"],"TD":["fr","ar"],"TF":["fr"],"TG":["fr","ee"],"TH":["th","tts","nod","sou","mfa","zh-hant","kxm","kdt","mnw","shn","lcp","lwl"],"TJ":["tg-cyrl","fa","ar"],"TK":["tkl","en"],"TL":["pt","tet"],"TM":["tk","ru","uz-latn","ku-latn"],"TN":["ar","fr"],"TO":["to","en"],"TR":["tr","ku-latn","zza","kbd","az-latn","ar","bgx","bg","ady","hy","ka","sr-latn","sq","ab","el","uz-latn","ky-latn","kk-cyrl"],"TT":["en","es"],"TV":["tvl","en"],"TW":["zh-hant","trv"],"TZ":["sw","en","suk","nym","kde","bez","ksb","mas","asa","lag","jmc","rof","vun","rwk"],"UA":["uk","ru","pl","yi","rue","be","ro","bg","tr","hu","el"],"UG":["sw","lg","nyn","cgg","xog","en","teo","laj","myx","rw","ttj","hi"],"UM":["en"],"US":["en","es","zh-hant","fr","de","fil","it","vi","ko","ru","nv","haw","chr","ik"],"UY":["es"],"UZ":["uz-cyrl","uz-latn","ru","kaa","tr"],"VA":["it","la"],"VC":["en"],"VE":["es"],"VG":["en"],"VI":["en"],"VN":["vi","zh-hant","cjm"],"VU":["bi","en","fr"],"WF":["wls","fr","fud"],"WS":["sm","en"],"YE":["ar"],"YT":["swb","fr","buc","sw"],"ZA":["en","zu","xh","af","nso","tn","st","ts","ss","hi","ve","nr","sw"],"ZM":["en","bem","ny"],"ZW":["en","sn","nd","mxc","ndc","kck","ny","ve","tn"],"ZZ":[]}};
|
|
} ( jQuery ) );
|
|
|
|
/**
|
|
* Utility functions for querying language data.
|
|
*
|
|
* Copyright (C) 2012 Alolita Sharma, Amir Aharoni, Arun Ganesh, Brandon Harris,
|
|
* Niklas Laxström, Pau Giner, Santhosh Thottingal, Siebrand Mazeland and other
|
|
* contributors. See CREDITS for a list.
|
|
*
|
|
* UniversalLanguageSelector is dual licensed GPLv2 or later and MIT. You don't
|
|
* have to do anything special to choose one license or the other and you don't
|
|
* have to notify anyone which license you are using. You are free to use
|
|
* UniversalLanguageSelector in commercial projects as long as the copyright
|
|
* header is left intact. See files GPL-LICENSE and MIT-LICENSE for details.
|
|
*
|
|
* @file
|
|
* @ingroup Extensions
|
|
* @licence GNU General Public Licence 2.0 or later
|
|
* @licence MIT License
|
|
*/
|
|
|
|
( function ( $ ) {
|
|
'use strict';
|
|
|
|
/**
|
|
* Is this language a redirect to another language?
|
|
* @param language string Language code
|
|
* @return Target language code if it's a redirect or false if it's not
|
|
*/
|
|
$.uls.data.isRedirect = function ( language ) {
|
|
return ( $.uls.data.languages[language] !== undefined &&
|
|
$.uls.data.languages[language].length === 1 ) ? $.uls.data.languages[language][0] : false;
|
|
};
|
|
|
|
/**
|
|
* Returns the script of the language.
|
|
* @param language string Language code
|
|
* @return string
|
|
*/
|
|
$.uls.data.getScript = function ( language ) {
|
|
var target = $.uls.data.isRedirect( language );
|
|
|
|
if ( target ) {
|
|
return $.uls.data.getScript( target );
|
|
}
|
|
|
|
return $.uls.data.languages[language][0];
|
|
};
|
|
|
|
/**
|
|
* Returns the regions in which a language is spoken.
|
|
* @param language string Language code
|
|
* @return array|string 'UNKNOWN'
|
|
*/
|
|
$.uls.data.getRegions = function ( language ) {
|
|
var target = $.uls.data.isRedirect( language );
|
|
|
|
if ( target ) {
|
|
return $.uls.data.getRegions( target );
|
|
}
|
|
|
|
return ( $.uls.data.languages[language] && $.uls.data.languages[language][1] ) || 'UNKNOWN';
|
|
};
|
|
|
|
/**
|
|
* Returns the autonym of the language.
|
|
* @param language string Language code
|
|
* @return string
|
|
*/
|
|
$.uls.data.getAutonym = function ( language ) {
|
|
var target = $.uls.data.isRedirect( language );
|
|
|
|
if ( target ) {
|
|
return $.uls.data.getAutonym( target );
|
|
}
|
|
|
|
return ( $.uls.data.languages[language] && $.uls.data.languages[language][2] ) || language;
|
|
};
|
|
|
|
/**
|
|
* Returns all language codes and corresponding autonyms
|
|
* @return array
|
|
*/
|
|
$.uls.data.getAutonyms = function () {
|
|
var language,
|
|
autonymsByCode = {};
|
|
|
|
for ( language in $.uls.data.languages ) {
|
|
if ( $.uls.data.isRedirect( language ) ) {
|
|
continue;
|
|
}
|
|
|
|
autonymsByCode[language] = $.uls.data.getAutonym( language );
|
|
}
|
|
|
|
return autonymsByCode;
|
|
};
|
|
|
|
/**
|
|
* Returns an array of all region codes.
|
|
* @return array
|
|
*/
|
|
$.uls.data.getAllRegions = function () {
|
|
var region,
|
|
allRegions = [];
|
|
|
|
for ( region in $.uls.data.regiongroups ) {
|
|
allRegions.push( region );
|
|
}
|
|
|
|
return allRegions;
|
|
};
|
|
|
|
|
|
/**
|
|
* Returns all languages written in script.
|
|
* @param script string
|
|
* @return array of strings (languages codes)
|
|
*/
|
|
$.uls.data.getLanguagesInScript = function ( script ) {
|
|
return $.uls.data.getLanguagesInScripts( [ script ] );
|
|
};
|
|
|
|
/**
|
|
* Returns all languages written in the given scripts.
|
|
* @param scripts array of strings
|
|
* @return array of strings (languages codes)
|
|
*/
|
|
$.uls.data.getLanguagesInScripts = function ( scripts ) {
|
|
var language, i,
|
|
languagesInScripts = [];
|
|
|
|
for ( language in $.uls.data.languages ) {
|
|
if ( $.uls.data.isRedirect( language ) ) {
|
|
continue;
|
|
}
|
|
|
|
for ( i = 0; i < scripts.length; i++ ) {
|
|
if ( scripts[i] === $.uls.data.getScript( language ) ) {
|
|
languagesInScripts.push( language );
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
return languagesInScripts;
|
|
};
|
|
|
|
/**
|
|
* Returns all languages in a given region.
|
|
* @param region string
|
|
* @return array of strings (languages codes)
|
|
*/
|
|
$.uls.data.getLanguagesInRegion = function ( region ) {
|
|
return $.uls.data.getLanguagesInRegions( [ region ] );
|
|
};
|
|
|
|
/**
|
|
* Returns all languages in given regions.
|
|
* @param regions array of strings.
|
|
* @return array of strings (languages codes)
|
|
*/
|
|
$.uls.data.getLanguagesInRegions = function ( regions ) {
|
|
var language, i,
|
|
languagesInRegions = [];
|
|
|
|
for ( language in $.uls.data.languages ) {
|
|
if ( $.uls.data.isRedirect( language ) ) {
|
|
continue;
|
|
}
|
|
|
|
for ( i = 0; i < regions.length; i++ ) {
|
|
if ( $.inArray( regions[i], $.uls.data.getRegions( language ) ) !== -1 ) {
|
|
languagesInRegions.push( language );
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
return languagesInRegions;
|
|
};
|
|
|
|
/**
|
|
* Returns all languages in a region group.
|
|
* @param groupNum number.
|
|
* @return array of strings (languages codes)
|
|
*/
|
|
$.uls.data.getLanguagesInRegionGroup = function ( groupNum ) {
|
|
return $.uls.data.getLanguagesInRegions( $.uls.data.getRegionsInGroup( groupNum ) );
|
|
};
|
|
|
|
/**
|
|
* Returns an associative array of languages in a region,
|
|
* grouped by script.
|
|
* @param region string Region code
|
|
* @return associative array
|
|
*/
|
|
$.uls.data.getLanguagesByScriptInRegion = function ( region ) {
|
|
var language, script,
|
|
languagesByScriptInRegion = {};
|
|
|
|
for ( language in $.uls.data.languages ) {
|
|
if ( $.uls.data.isRedirect( language ) ) {
|
|
continue;
|
|
}
|
|
|
|
if ( $.inArray( region, $.uls.data.getRegions( language ) ) !== -1 ) {
|
|
script = $.uls.data.getScript( language );
|
|
|
|
if ( languagesByScriptInRegion[script] === undefined ) {
|
|
languagesByScriptInRegion[script] = [];
|
|
}
|
|
languagesByScriptInRegion[script].push( language );
|
|
}
|
|
}
|
|
|
|
return languagesByScriptInRegion;
|
|
};
|
|
|
|
/**
|
|
* Returns an associative array of languages in a region,
|
|
* grouped by script group.
|
|
* @param region string Region code
|
|
* @return associative array
|
|
*/
|
|
$.uls.data.getLanguagesByScriptGroupInRegion = function ( region ) {
|
|
return $.uls.data.getLanguagesByScriptGroupInRegions( [ region ] );
|
|
};
|
|
|
|
/**
|
|
* Returns an associative array of all languages,
|
|
* grouped by script group.
|
|
* @return associative array
|
|
*/
|
|
$.uls.data.getAllLanguagesByScriptGroup = function () {
|
|
return $.uls.data.getLanguagesByScriptGroupInRegions( $.uls.data.getAllRegions() );
|
|
};
|
|
|
|
/**
|
|
* Get the given list of languages grouped by script.
|
|
* @param languages Array of language codes
|
|
* @return {Object} Array of languages indexed by script codes
|
|
*/
|
|
$.uls.data.getLanguagesByScriptGroup = function ( languages ) {
|
|
var languagesByScriptGroup = {},
|
|
language, codeToAdd, langScriptGroup;
|
|
|
|
for ( language in languages ) {
|
|
codeToAdd = $.uls.data.isRedirect( language ) || language;
|
|
|
|
langScriptGroup = $.uls.data.getScriptGroupOfLanguage( codeToAdd );
|
|
|
|
if ( !languagesByScriptGroup[langScriptGroup] ) {
|
|
languagesByScriptGroup[langScriptGroup] = [];
|
|
}
|
|
|
|
// Prevent duplicate adding of redirects
|
|
if ( $.inArray( codeToAdd, languagesByScriptGroup[langScriptGroup] ) === -1 ) {
|
|
languagesByScriptGroup[langScriptGroup].push( codeToAdd );
|
|
}
|
|
}
|
|
|
|
return languagesByScriptGroup;
|
|
};
|
|
|
|
/**
|
|
* Returns an associative array of languages in several regions,
|
|
* grouped by script group.
|
|
* @param regions array of strings - region codes
|
|
* @return associative array
|
|
*/
|
|
$.uls.data.getLanguagesByScriptGroupInRegions = function ( regions ) {
|
|
var language, i, scriptGroup,
|
|
languagesByScriptGroupInRegions = {};
|
|
|
|
for ( language in $.uls.data.languages ) {
|
|
if ( $.uls.data.isRedirect( language ) ) {
|
|
continue;
|
|
}
|
|
|
|
for ( i = 0; i < regions.length; i++ ) {
|
|
if ( $.inArray( regions[i], $.uls.data.getRegions( language ) ) !== -1 ) {
|
|
scriptGroup = $.uls.data.getScriptGroupOfLanguage( language );
|
|
|
|
if ( languagesByScriptGroupInRegions[scriptGroup] === undefined ) {
|
|
languagesByScriptGroupInRegions[scriptGroup] = [];
|
|
}
|
|
|
|
languagesByScriptGroupInRegions[scriptGroup].push( language );
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
return languagesByScriptGroupInRegions;
|
|
};
|
|
|
|
/**
|
|
* Returns an array of languages grouped by region group,
|
|
* region, script group and script.
|
|
* @return associative array
|
|
*/
|
|
$.uls.data.getAllLanguagesByRegionAndScript = function () {
|
|
var region, regionGroup, language,
|
|
script, scriptGroup, regions, regionNum,
|
|
allLanguagesByRegionAndScript = {};
|
|
|
|
for ( region in $.uls.data.regiongroups ) {
|
|
regionGroup = $.uls.data.regiongroups[region];
|
|
|
|
if ( allLanguagesByRegionAndScript[regionGroup] === undefined ) {
|
|
allLanguagesByRegionAndScript[regionGroup] = {};
|
|
}
|
|
|
|
allLanguagesByRegionAndScript[regionGroup][region] = {};
|
|
}
|
|
|
|
for ( language in $.uls.data.languages ) {
|
|
if ( $.uls.data.isRedirect( language ) ) {
|
|
continue;
|
|
}
|
|
|
|
script = $.uls.data.getScript( language );
|
|
scriptGroup = $.uls.data.getGroupOfScript( script );
|
|
regions = $.uls.data.getRegions( language );
|
|
|
|
for ( regionNum = 0; regionNum < regions.length; regionNum++ ) {
|
|
region = regions[regionNum];
|
|
regionGroup = $.uls.data.regiongroups[region];
|
|
|
|
if ( allLanguagesByRegionAndScript[regionGroup][region][scriptGroup] === undefined ) {
|
|
allLanguagesByRegionAndScript[regionGroup][region][scriptGroup] = {};
|
|
}
|
|
|
|
if ( allLanguagesByRegionAndScript[regionGroup][region][scriptGroup][script] === undefined ) {
|
|
allLanguagesByRegionAndScript[regionGroup][region][scriptGroup][script] = [];
|
|
}
|
|
|
|
allLanguagesByRegionAndScript[regionGroup][region][scriptGroup][script].push( language );
|
|
}
|
|
}
|
|
|
|
return allLanguagesByRegionAndScript;
|
|
};
|
|
|
|
/**
|
|
* Returns all regions in a region group.
|
|
* @param groupNum int
|
|
* @return array of strings
|
|
*/
|
|
$.uls.data.getRegionsInGroup = function ( groupNum ) {
|
|
var region,
|
|
regionsInGroup = [];
|
|
|
|
for ( region in $.uls.data.regiongroups ) {
|
|
if ( $.uls.data.regiongroups[region] === groupNum ) {
|
|
regionsInGroup.push( region );
|
|
}
|
|
}
|
|
|
|
return regionsInGroup;
|
|
};
|
|
|
|
|
|
/**
|
|
* Returns the script group of a script or 'Other' if it doesn't
|
|
* belong to any group.
|
|
* @param script string Script code
|
|
* @return string script group name
|
|
*/
|
|
$.uls.data.getGroupOfScript = function ( script ) {
|
|
var scriptGroup;
|
|
|
|
for ( scriptGroup in $.uls.data.scriptgroups ) {
|
|
if ( $.inArray( script, $.uls.data.scriptgroups[scriptGroup] ) !== -1 ) {
|
|
return scriptGroup;
|
|
}
|
|
}
|
|
|
|
return 'Other';
|
|
};
|
|
|
|
/**
|
|
* Returns the script group of a language.
|
|
* @param language string Language code
|
|
* @return string script group name
|
|
*/
|
|
$.uls.data.getScriptGroupOfLanguage = function ( language ) {
|
|
return $.uls.data.getGroupOfScript( $.uls.data.getScript( language ) );
|
|
};
|
|
|
|
/**
|
|
* A callback for sorting languages by autonym.
|
|
* Can be used as an argument to a sort function.
|
|
* @param a string Language code
|
|
* @param b string Language code
|
|
*/
|
|
$.uls.data.sortByAutonym = function ( a, b ) {
|
|
var autonymA = $.uls.data.getAutonym( a ) || a,
|
|
autonymB = $.uls.data.getAutonym( b ) || b;
|
|
|
|
return ( autonymA.toLowerCase() < autonymB.toLowerCase() ) ? -1 : 1;
|
|
};
|
|
|
|
/**
|
|
* Check if a language is right-to-left.
|
|
* @param language string Language code
|
|
* @return boolean
|
|
*/
|
|
$.uls.data.isRtl = function ( language ) {
|
|
return $.inArray( $.uls.data.getScript( language ), $.uls.data.rtlscripts ) !== -1;
|
|
};
|
|
|
|
/**
|
|
* Return the direction of the language
|
|
* @param language string Language code
|
|
* @return string
|
|
*/
|
|
$.uls.data.getDir = function ( language ) {
|
|
return $.uls.data.isRtl( language ) ? 'rtl' : 'ltr';
|
|
};
|
|
|
|
/**
|
|
* Returns the languages spoken in a territory.
|
|
* @param territory string Territory code
|
|
* @return list of language codes
|
|
*/
|
|
$.uls.data.getLanguagesInTerritory = function ( territory ) {
|
|
return $.uls.data.territories[territory];
|
|
};
|
|
|
|
/**
|
|
* Adds a language in run time and sets its options as provided.
|
|
* If the target option is provided, the language is defined as a redirect.
|
|
* Other possible options are script, regions and autonym.
|
|
*
|
|
* @param code string New language code.
|
|
* @param options Object Language properties.
|
|
* @return list of language codes
|
|
*/
|
|
$.uls.data.addLanguage = function( code, options ) {
|
|
if ( options.target ) {
|
|
$.uls.data.languages[code] = [options.target];
|
|
} else {
|
|
$.uls.data.languages[code] = [options.script, options.regions, options.autonym];
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Removes a language from the langdb in run time.
|
|
*
|
|
* @param code string Language code to delete.
|
|
* @return true if the language was removed, false otherwise.
|
|
*/
|
|
$.uls.data.deleteLanguage = function( code ) {
|
|
if ( $.uls.data.languages[code] ) {
|
|
delete $.uls.data.languages[code];
|
|
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
};
|
|
|
|
} ( jQuery ) );
|
|
|
|
/**
|
|
* Universal Language Selector
|
|
* Language category display component - Used for showing the search results,
|
|
* grouped by regions, scripts
|
|
*
|
|
* Copyright (C) 2012 Alolita Sharma, Amir Aharoni, Arun Ganesh, Brandon Harris,
|
|
* Niklas Laxström, Pau Giner, Santhosh Thottingal, Siebrand Mazeland and other
|
|
* contributors. See CREDITS for a list.
|
|
*
|
|
* UniversalLanguageSelector is dual licensed GPLv2 or later and MIT. You don't
|
|
* have to do anything special to choose one license or the other and you don't
|
|
* have to notify anyone which license you are using. You are free to use
|
|
* UniversalLanguageSelector in commercial projects as long as the copyright
|
|
* header is left intact. See files GPL-LICENSE and MIT-LICENSE for details.
|
|
*
|
|
* @file
|
|
* @ingroup Extensions
|
|
* @licence GNU General Public Licence 2.0 or later
|
|
* @licence MIT License
|
|
*/
|
|
|
|
( function ( $ ) {
|
|
'use strict';
|
|
|
|
/*jshint multistr:true */
|
|
var noResultsTemplate = '\
|
|
<div class="twelve columns uls-no-results-view">\
|
|
<h2 data-i18n="uls-no-results-found" class="eleven columns end offset-by-one uls-no-results-found-title">\
|
|
No results found\
|
|
</h2>\
|
|
<div id="uls-no-found-more" class="uls-no-found-more">\
|
|
<div class="ten columns end offset-by-one">\
|
|
<p>\
|
|
<span data-i18n="uls-search-help">You can search by language name, \
|
|
script name, ISO code of language or \
|
|
you can browse by region:</span>\
|
|
<a class="uls-region-link" data-i18n="uls-region-AM" data-region="AM">America</a>, \
|
|
<a class="uls-region-link" data-i18n="uls-region-EU" data-region="EU">Europe</a>, \
|
|
<a class="uls-region-link" data-i18n="uls-region-ME" data-region="ME">Middle East</a>, \
|
|
<a class="uls-region-link" data-i18n="uls-region-AF" data-region="AF">Africa</a>, \
|
|
<a class="uls-region-link" data-i18n="uls-region-AS" data-region="AS">Asia</a>, \
|
|
<a class="uls-region-link" data-i18n="uls-region-PA" data-region="PA">Pacific</a>, \
|
|
<a class="uls-region-link" data-i18n="uls-region-WW" data-region="WW">Worldwide</a>.\
|
|
</p>\
|
|
</div>\
|
|
</div>\
|
|
</div>';
|
|
/*jshint multistr:false */
|
|
|
|
var LanguageCategoryDisplay = function ( element, options ) {
|
|
this.$element = $( element );
|
|
this.options = $.extend( {}, $.fn.lcd.defaults, options );
|
|
this.$element.addClass( 'lcd' );
|
|
this.regionDivs = {};
|
|
this.$element.append( $( noResultsTemplate ) );
|
|
this.$noResults = this.$element.find( 'div.uls-no-results-view' );
|
|
this.render();
|
|
this.listen();
|
|
};
|
|
|
|
LanguageCategoryDisplay.prototype = {
|
|
constructor: LanguageCategoryDisplay,
|
|
|
|
append: function ( langCode, regionCode ) {
|
|
this.addToRegion( langCode, regionCode );
|
|
this.$noResults.hide();
|
|
},
|
|
|
|
/**
|
|
* Add the language to a region.
|
|
* If the region parameter is given, add to that region alone
|
|
* Otherwise to all regions that this language belongs.
|
|
* @param langCode
|
|
* @param region Optional region
|
|
*/
|
|
addToRegion: function ( langCode, region ) {
|
|
var lcd = this,
|
|
language = lcd.options.languages[langCode],
|
|
langName = $.uls.data.getAutonym( langCode ) || language || langCode,
|
|
regions = [];
|
|
|
|
if ( region ) {
|
|
regions.push( region );
|
|
} else {
|
|
regions = $.uls.data.getRegions( langCode );
|
|
}
|
|
|
|
// World wide languages need not be repeated in all regions.
|
|
if ( $.inArray( 'WW', regions ) > -1 ) {
|
|
regions = [ 'WW' ];
|
|
}
|
|
|
|
for ( var i = 0; i < regions.length; i++ ) {
|
|
var regionCode = regions[i];
|
|
|
|
var $li = $( '<li>' )
|
|
.data( 'code', langCode )
|
|
.attr( {
|
|
lang: langCode,
|
|
dir: $.uls.data.getDir( langCode )
|
|
} )
|
|
.append(
|
|
$( '<a>' ).prop( 'title', language ).html( langName )
|
|
);
|
|
|
|
// Append the element to the column in the list
|
|
var $column = lcd.getColumn( regionCode );
|
|
var lastLanguage = $column.find( 'li:last' ).data( 'code' );
|
|
|
|
if ( lastLanguage ) {
|
|
var lastScriptGroup = $.uls.data.getScriptGroupOfLanguage( lastLanguage ),
|
|
currentScriptGroup = $.uls.data.getScriptGroupOfLanguage( langCode );
|
|
|
|
if ( lastScriptGroup !== currentScriptGroup ) {
|
|
if ( $column.find( 'li' ).length > 2 ) {
|
|
// If column already has 2 or more languages, add a new column
|
|
$column = lcd.getColumn( regionCode, true );
|
|
}
|
|
}
|
|
}
|
|
|
|
$column.append( $li );
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Get a column to add language.
|
|
* @param regionCode string The region code
|
|
* @param forceNew bool whether a new column must be created or not
|
|
*/
|
|
getColumn: function ( regionCode, forceNew ) {
|
|
var $divRegionCode, $rowDiv, $ul;
|
|
|
|
forceNew = forceNew || false;
|
|
$divRegionCode = this.regionDivs[regionCode];
|
|
$rowDiv = $divRegionCode.find( 'div.row:last' );
|
|
$ul = $rowDiv.find( 'ul:last' );
|
|
|
|
// Each column can have maximum 8 languages.
|
|
if ( $ul.length === 0 || $ul.find( 'li' ).length >= 8 || forceNew ) {
|
|
$ul = $( '<ul>' ).addClass( 'three columns end' );
|
|
|
|
if ( $rowDiv.length === 0 || $rowDiv.find( 'ul' ).length >= 4 ) {
|
|
$rowDiv = $( '<div>' ).addClass( 'row uls-language-block' );
|
|
$divRegionCode.append( $rowDiv );
|
|
$ul.addClass( 'offset-by-one' );
|
|
}
|
|
|
|
$rowDiv.append( $ul );
|
|
}
|
|
|
|
// Don't show the region unless it was enabled
|
|
if ( $.inArray( regionCode, this.options.showRegions ) > -1 ) {
|
|
$divRegionCode.show();
|
|
}
|
|
|
|
return $ul;
|
|
},
|
|
|
|
render: function () {
|
|
var $section, $sectionTitle,
|
|
lcd = this,
|
|
regions = {
|
|
// These are fallback text when i18n library not present
|
|
WW: 'Worldwide',
|
|
SP: 'Special',
|
|
AM: 'America',
|
|
EU: 'Europe',
|
|
ME: 'Middle East',
|
|
AS: 'Asia',
|
|
AF: 'Africa',
|
|
PA: 'Pacific'
|
|
};
|
|
|
|
$.each( $.uls.data.regiongroups, function ( regionCode, regionIndex ) {
|
|
$section = $( '<div>' ).addClass( 'twelve columns uls-lcd-region-section' ).prop( 'id', regionCode );
|
|
|
|
$sectionTitle = $( '<h3 data-i18n="uls-region-' + regionCode + '">' )
|
|
.addClass( 'eleven columns uls-lcd-region-section uls-lcd-region-title offset-by-one' )
|
|
.text( regions[regionCode] );
|
|
|
|
$section.append( $sectionTitle );
|
|
lcd.$element.append( $section );
|
|
$section.hide();
|
|
lcd.regionDivs[regionCode] = $section;
|
|
} );
|
|
|
|
this.$noResults.hide();
|
|
this.i18n();
|
|
},
|
|
|
|
i18n: function ( ) {
|
|
this.$element.find( '[data-i18n]' ).i18n();
|
|
},
|
|
|
|
quicklist: function () {
|
|
if ( $.isFunction( this.options.quickList ) ) {
|
|
this.options.quickList = this.options.quickList();
|
|
}
|
|
|
|
if ( !this.options.quickList ) {
|
|
return;
|
|
}
|
|
|
|
// Pick only the first elements, because we don't have room for more
|
|
var quickList = this.options.quickList;
|
|
quickList = quickList.slice( 0, 16 );
|
|
quickList.sort( $.uls.data.sortByAutonym );
|
|
|
|
var $quickListSection = $( '<div>' ).addClass( 'twelve columns uls-lcd-region-section' ).prop( 'id', 'uls-lcd-quicklist' );
|
|
var $quickListSectionTitle = $( '<h3 data-i18n="uls-common-languages">' )
|
|
.addClass( 'eleven columns uls-lcd-region-section uls-lcd-region-title offset-by-one' )
|
|
.text( 'Common languages' ); // This is placeholder text if jquery.i18n not present
|
|
$quickListSection.append( $quickListSectionTitle );
|
|
this.$element.prepend( $quickListSection );
|
|
this.regionDivs.quick = $quickListSection;
|
|
|
|
for ( var i = 0; i < quickList.length; i++) {
|
|
var $column = this.getColumn( 'quick', i % 4 === 0 );
|
|
var langCode = quickList[i];
|
|
var language = this.options.languages[langCode];
|
|
var langName = $.uls.data.getAutonym( langCode ) || language || langCode;
|
|
var $li = $( '<li>' )
|
|
.data( 'code', langCode )
|
|
.attr( {
|
|
lang: langCode,
|
|
dir: $.uls.data.getDir( langCode )
|
|
} )
|
|
.append(
|
|
$( '<a>' ).prop( 'title', language ).html( langName )
|
|
);
|
|
$column.append( $li );
|
|
}
|
|
|
|
$quickListSection.show();
|
|
$quickListSectionTitle.i18n();
|
|
|
|
return $quickListSection;
|
|
},
|
|
|
|
show: function () {
|
|
if ( !this.regionDivs ) {
|
|
this.render();
|
|
}
|
|
},
|
|
|
|
empty: function () {
|
|
this.$element.find( 'div.uls-language-block' ).remove();
|
|
this.$element.find( 'div.uls-lcd-region-section' ).hide();
|
|
},
|
|
|
|
focus: function () {
|
|
this.$element.focus();
|
|
},
|
|
|
|
noResults: function () {
|
|
this.$noResults.show();
|
|
var $suggestions = this.quicklist();
|
|
$suggestions.find( 'h3' )
|
|
.data( 'i18n', 'uls-no-results-suggestion-title' )
|
|
.text( 'You may be interested in:' )
|
|
.i18n();
|
|
this.$noResults.find( 'h2' ).after( $suggestions );
|
|
},
|
|
|
|
listen: function () {
|
|
var lcd = this;
|
|
|
|
if ( this.options.clickhandler ) {
|
|
this.$element.on( 'click', 'div.row li', function () {
|
|
lcd.options.clickhandler.call( this, $( this ).data( 'code' ) );
|
|
} );
|
|
}
|
|
|
|
// The region section need to be in sync with the map filter.
|
|
lcd.$element.scroll( function () {
|
|
var inview, inviewRegion,
|
|
$ulsLanguageList = $( this ),
|
|
scrollTop = $ulsLanguageList.position().top,
|
|
scrollBottom = $ulsLanguageList.height();
|
|
|
|
if ( lcd.options.lazyload && lcd.options.source.val() === '' ) {
|
|
if ( this.offsetHeight + this.scrollTop >= this.scrollHeight / 2 ) {
|
|
lcd.$element.trigger( 'scrollend' );
|
|
}
|
|
}
|
|
// The region section need to be in sync with the map filter.
|
|
inviewRegion = 'WW';
|
|
lcd.$element.find( 'div.uls-lcd-region-section' ).each( function () {
|
|
var $lcdRegionSection = $( this ),
|
|
top = $lcdRegionSection.position().top,
|
|
height = $lcdRegionSection.height(),
|
|
padding = 10;
|
|
|
|
if ( top - padding <= scrollTop && height > scrollBottom ) {
|
|
inviewRegion = $lcdRegionSection.attr( 'id' );
|
|
|
|
return true;
|
|
}
|
|
} );
|
|
|
|
inview = $.uls.data.regiongroups[inviewRegion];
|
|
$( '.regionselector' ).removeClass( 'active' );
|
|
$( '#uls-region-' + inview ).addClass( 'active' );
|
|
} );
|
|
}
|
|
};
|
|
|
|
$.fn.lcd = function ( option ) {
|
|
return this.each( function () {
|
|
var $this = $( this ),
|
|
data = $this.data( 'lcd' ),
|
|
options = typeof option === 'object' && option;
|
|
|
|
if ( !data ) {
|
|
$this.data( 'lcd', ( data = new LanguageCategoryDisplay( this, options ) ) );
|
|
}
|
|
|
|
if ( typeof option === 'string') {
|
|
data[option]();
|
|
}
|
|
} );
|
|
};
|
|
|
|
$.fn.lcd.defaults = {
|
|
languages: null,
|
|
showRegions: ['WW', 'AM', 'EU', 'ME', 'AF', 'AS', 'PA'],
|
|
lazyload: true
|
|
};
|
|
|
|
$.fn.lcd.Constructor = LanguageCategoryDisplay;
|
|
|
|
} ( jQuery ) );
|
|
|
|
/**
|
|
* jQuery language filter plugin.
|
|
*
|
|
* Copyright (C) 2012 Alolita Sharma, Amir Aharoni, Arun Ganesh, Brandon Harris,
|
|
* Niklas Laxström, Pau Giner, Santhosh Thottingal, Siebrand Mazeland and other
|
|
* contributors. See CREDITS for a list.
|
|
*
|
|
* UniversalLanguageSelector is dual licensed GPLv2 or later and MIT. You don't
|
|
* have to do anything special to choose one license or the other and you don't
|
|
* have to notify anyone which license you are using. You are free to use
|
|
* UniversalLanguageSelector in commercial projects as long as the copyright
|
|
* header is left intact. See files GPL-LICENSE and MIT-LICENSE for details.
|
|
*
|
|
* @file
|
|
* @ingroup Extensions
|
|
* @licence GNU General Public Licence 2.0 or later
|
|
* @licence MIT License
|
|
*/
|
|
|
|
/**
|
|
* Usage: $( 'inputbox' ).languagefilter();
|
|
* The values for autocompletion is from the options.languages.
|
|
* The data is in the format of languagecode:languagename.
|
|
*/
|
|
(function ( $ ) {
|
|
'use strict';
|
|
|
|
var LanguageFilter = function( element, options ) {
|
|
this.$element = $( element );
|
|
this.options = $.extend( {}, $.fn.regionselector.defaults, options );
|
|
this.$element.addClass( 'languagefilter' );
|
|
this.resultCount = 0;
|
|
this.$suggestion = this.$element.parents().find( '#' + this.$element.data( 'suggestion' ) );
|
|
this.$clear = this.$element.parents().find( '#'+ this.$element.data( 'clear' ) );
|
|
this.selectedLanguage = null;
|
|
|
|
this.listen();
|
|
};
|
|
|
|
var delay = ( function() {
|
|
var timer = 0;
|
|
|
|
return function( callback, milliseconds ) {
|
|
clearTimeout( timer );
|
|
timer = setTimeout( callback, milliseconds );
|
|
};
|
|
} () );
|
|
|
|
LanguageFilter.prototype = {
|
|
listen: function() {
|
|
this.$element.on( 'keypress', $.proxy( this.keyup, this ) )
|
|
.on( 'keyup', $.proxy( this.keyup, this ) );
|
|
|
|
if ( this.eventSupported( 'keydown' ) ) {
|
|
this.$element.on( 'keydown', $.proxy( this.keyup, this ) );
|
|
}
|
|
|
|
if ( this.$clear.length ) {
|
|
this.$clear.on( 'click' , $.proxy( this.clear, this ) );
|
|
}
|
|
|
|
this.toggleClear();
|
|
},
|
|
|
|
keyup: function( e ) {
|
|
switch( e.keyCode ) {
|
|
case 9: // Tab -> Autocomplete
|
|
var suggestion = this.$suggestion.val();
|
|
|
|
if ( suggestion && suggestion !== this.$element.val() ) {
|
|
this.$element.val( suggestion );
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
}
|
|
break;
|
|
case 13: // Enter
|
|
if ( !this.options.onSelect ) {
|
|
break;
|
|
}
|
|
|
|
var query = $.trim( this.$element.val() ).toLowerCase();
|
|
|
|
if ( this.selectedLanguage ) {
|
|
// this.selectLanguage will be populated from a matching search
|
|
this.options.onSelect( this.selectedLanguage );
|
|
} else if ( this.options.languages[query] ) {
|
|
// Search is yet to happen (in timeout delay),
|
|
// but we have a matching language code.
|
|
this.options.onSelect( query );
|
|
}
|
|
|
|
break;
|
|
default:
|
|
var languageFilter = this;
|
|
|
|
if ( e.which < 32 ) {
|
|
// ignore any ASCII control characters
|
|
break;
|
|
}
|
|
|
|
this.selectedLanguage = null;
|
|
|
|
delay( function() {
|
|
if ( !languageFilter.$element.val() ) {
|
|
languageFilter.clear();
|
|
} else {
|
|
languageFilter.options.$target.empty();
|
|
languageFilter.search();
|
|
}
|
|
}, 300 );
|
|
|
|
this.toggleClear();
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Clears the current search removing
|
|
* clear buttons and suggestions.
|
|
*/
|
|
deactivate: function() {
|
|
this.$element.val( '' );
|
|
|
|
if ( !$.fn.uls.Constructor.prototype.isMobile() ) {
|
|
this.$element.focus();
|
|
}
|
|
|
|
this.toggleClear();
|
|
this.autofill();
|
|
},
|
|
|
|
/**
|
|
* Clears the search and shows all languages
|
|
*/
|
|
clear: function() {
|
|
this.deactivate();
|
|
this.$element.trigger( 'searchclear' );
|
|
},
|
|
|
|
/**
|
|
* Toggles the visibility of clear icon depending
|
|
* on whether there is anything to clear.
|
|
*/
|
|
toggleClear: function() {
|
|
if ( !this.$clear.length ) {
|
|
return;
|
|
}
|
|
|
|
if ( this.$element.val() ) {
|
|
this.$clear.show();
|
|
} else {
|
|
this.$clear.hide();
|
|
}
|
|
},
|
|
|
|
search: function() {
|
|
var query = $.trim( this.$element.val() ),
|
|
languages = $.uls.data.getLanguagesByScriptGroup( this.options.languages ),
|
|
scriptGroup, langNum, langCode;
|
|
|
|
this.resultCount = 0;
|
|
|
|
for ( scriptGroup in languages ) {
|
|
var languagesInScript = languages[scriptGroup];
|
|
|
|
languagesInScript.sort( $.uls.data.sortByAutonym );
|
|
|
|
for ( langNum = 0; langNum < languagesInScript.length; langNum++ ) {
|
|
langCode = languagesInScript[langNum];
|
|
|
|
if ( query === '' || this.filter( langCode, query ) ) {
|
|
if ( this.resultCount === 0 ) {
|
|
// Autofill the first result.
|
|
this.autofill( langCode );
|
|
}
|
|
|
|
if ( query.toLowerCase() === langCode ) {
|
|
this.selectedLanguage = langCode;
|
|
}
|
|
|
|
this.render( langCode );
|
|
this.resultCount++;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Also do a search by search API
|
|
if( !this.resultCount && this.options.searchAPI && query ) {
|
|
this.searchAPI( query );
|
|
} else {
|
|
this.resultHandler( query );
|
|
}
|
|
},
|
|
|
|
searchAPI: function( query ) {
|
|
var languageFilter = this;
|
|
|
|
$.get( languageFilter.options.searchAPI, { search: query }, function( result ) {
|
|
$.each( result.languagesearch, function( code, name ) {
|
|
if ( languageFilter.resultCount === 0 ) {
|
|
// Autofill the first result.
|
|
languageFilter.autofill( code, name );
|
|
}
|
|
|
|
languageFilter.render( code );
|
|
languageFilter.resultCount++;
|
|
} );
|
|
|
|
languageFilter.resultHandler( query );
|
|
} );
|
|
},
|
|
|
|
/**
|
|
* Handler method to be called once search is over.
|
|
* Based on search result call success or noresults callbacks
|
|
* @param query string
|
|
*/
|
|
resultHandler: function( query ) {
|
|
if ( this.resultCount === 0 && this.options.noresults ) {
|
|
this.$suggestion.val( '' );
|
|
this.options.noresults.call( this, query );
|
|
} else if ( this.options.success ) {
|
|
this.options.success( this, query, this.resultCount );
|
|
}
|
|
},
|
|
|
|
autofill: function( langCode, languageName ) {
|
|
if ( !this.$suggestion.length ) {
|
|
return;
|
|
}
|
|
|
|
if ( !this.$element.val() ) {
|
|
this.$suggestion.val( '' );
|
|
return;
|
|
}
|
|
|
|
this.selectedLanguage = langCode;
|
|
languageName = languageName || this.options.languages[langCode];
|
|
|
|
var autonym,
|
|
userInput = this.$element.val(),
|
|
suggestion = userInput + languageName.substring( userInput.length, languageName.length );
|
|
|
|
if ( suggestion.toLowerCase() !== languageName.toLowerCase() ) {
|
|
// see if it was autonym match
|
|
autonym = $.uls.data.getAutonym( langCode ) || '';
|
|
suggestion = userInput + autonym.substring( userInput.length, autonym.length );
|
|
|
|
if ( suggestion !== autonym ) {
|
|
// Give up. It may be an ISO/script code match.
|
|
suggestion = '';
|
|
}
|
|
}
|
|
|
|
// Make sure that it is a visual prefix.
|
|
if ( !isVisualPrefix( userInput, suggestion ) ) {
|
|
suggestion = '';
|
|
}
|
|
|
|
this.$suggestion.val( suggestion );
|
|
},
|
|
|
|
render: function( langCode ) {
|
|
var $target = this.options.$target;
|
|
|
|
if ( !$target ) {
|
|
return;
|
|
}
|
|
|
|
$target.append( langCode, null );
|
|
},
|
|
|
|
escapeRegex: function( value ) {
|
|
return value.replace( /[\-\[\]{}()*+?.,\\\^$\|#\s]/g, '\\$&' );
|
|
},
|
|
|
|
/**
|
|
* A search match happens if any of the following passes:
|
|
* a) Language name in current user interface language
|
|
* 'starts with' search string.
|
|
* b) Language autonym 'starts with' search string.
|
|
* c) ISO 639 code match with search string.
|
|
* d) ISO 15924 code for the script match the search string.
|
|
*/
|
|
filter: function( langCode, searchTerm ) {
|
|
// FIXME script is ISO 15924 code. We might need actual name of script.
|
|
var matcher = new RegExp( '^' + this.escapeRegex( searchTerm ), 'i' ),
|
|
languageName = this.options.languages[langCode];
|
|
|
|
return matcher.test( languageName ) ||
|
|
matcher.test( $.uls.data.getAutonym( langCode ) ) ||
|
|
matcher.test( langCode ) ||
|
|
matcher.test( $.uls.data.getScript( langCode ) );
|
|
},
|
|
|
|
eventSupported: function ( eventName ) {
|
|
var isSupported = eventName in this.$element;
|
|
|
|
if ( !isSupported ) {
|
|
this.$element.setAttribute( eventName, 'return;' );
|
|
isSupported = typeof this.$element[eventName] === 'function';
|
|
}
|
|
|
|
return isSupported;
|
|
}
|
|
};
|
|
|
|
$.fn.languagefilter = function( option ) {
|
|
return this.each( function() {
|
|
var $this = $( this ),
|
|
data = $this.data( 'languagefilter' ),
|
|
options = typeof option === 'object' && option;
|
|
|
|
if ( !data ) {
|
|
$this.data( 'languagefilter', ( data = new LanguageFilter( this, options ) ) );
|
|
}
|
|
|
|
if ( typeof option === 'string' ) {
|
|
data[option]();
|
|
}
|
|
} );
|
|
};
|
|
|
|
$.fn.languagefilter.defaults = {
|
|
$target: null, // Where to append the results
|
|
searchAPI: null,
|
|
languages: null, // Languages as code:name format.
|
|
noresults: null, // callback for no results found case
|
|
success: null, // callback if any results found.
|
|
onSelect: null // Language select handler - like enter in filter textbox.
|
|
};
|
|
|
|
$.fn.languagefilter.Constructor = LanguageFilter;
|
|
|
|
/**
|
|
* Check if a prefix is visually prefix of a string
|
|
* @param prefix string
|
|
* @param string string
|
|
*/
|
|
function isVisualPrefix( prefix, string ) {
|
|
// Pre-base vowel signs of Indic languages. A vowel sign is called pre-base if
|
|
// consonant + vowel becomes [vowel][consonant] when rendered. Eg: ക + െ => കെ
|
|
var prebases = 'െേൈൊോൌெேைொோௌେୈୋୌિਿिিেৈোৌෙේෛොෝෞ';
|
|
return prebases.indexOf( string[prefix.length] ) <= 0;
|
|
}
|
|
} ( jQuery ) );
|
|
|
|
/**
|
|
* jQuery region filter plugin.
|
|
*
|
|
* Copyright (C) 2012 Alolita Sharma, Amir Aharoni, Arun Ganesh, Brandon Harris,
|
|
* Niklas Laxström, Pau Giner, Santhosh Thottingal, Siebrand Mazeland and other
|
|
* contributors. See CREDITS for a list.
|
|
*
|
|
* UniversalLanguageSelector is dual licensed GPLv2 or later and MIT. You don't
|
|
* have to do anything special to choose one license or the other and you don't
|
|
* have to notify anyone which license you are using. You are free to use
|
|
* UniversalLanguageSelector in commercial projects as long as the copyright
|
|
* header is left intact. See files GPL-LICENSE and MIT-LICENSE for details.
|
|
*
|
|
* @file
|
|
* @ingroup Extensions
|
|
* @licence GNU General Public Licence 2.0 or later
|
|
* @licence MIT License
|
|
*/
|
|
|
|
( function ( $ ) {
|
|
'use strict';
|
|
|
|
/* RegionSelector plugin definition */
|
|
|
|
/**
|
|
* Region selector is a language selector based on regions.
|
|
* Usage: $( 'jqueryselector' ).regionselector( options );
|
|
* The attached element should have data-regiongroup attribute
|
|
* that defines the regiongroup for the selector.
|
|
*/
|
|
var RegionSelector = function ( element, options ) {
|
|
this.$element = $( element );
|
|
this.options = $.extend( {}, $.fn.regionselector.defaults, options );
|
|
this.$element.addClass( 'regionselector' );
|
|
this.regions = [];
|
|
this.cache= null;
|
|
this.regionGroup = this.$element.data( 'regiongroup' );
|
|
this.init();
|
|
this.listen();
|
|
};
|
|
|
|
RegionSelector.prototype = {
|
|
constructor: RegionSelector,
|
|
|
|
init: function () {
|
|
var region = this.$element.data( 'region' );
|
|
this.regions = $.uls.data.getRegionsInGroup( this.regionGroup );
|
|
|
|
if ( region ) {
|
|
this.regions.push( region );
|
|
}
|
|
},
|
|
|
|
test: function ( langCode ) {
|
|
var langRegions = $.uls.data.getRegions( langCode ),
|
|
region;
|
|
|
|
for ( var i = 0; i < this.regions.length; i++ ) {
|
|
region = this.regions[i];
|
|
|
|
if ( $.inArray( region, langRegions ) >= 0 ) {
|
|
this.render( langCode, region );
|
|
this.cache[langCode] = region;
|
|
|
|
return;
|
|
}
|
|
}
|
|
},
|
|
|
|
show: function () {
|
|
if ( this.cache ) {
|
|
// If the result cache is present, render the results from there.
|
|
var result = null;
|
|
|
|
for ( result in this.cache ) {
|
|
this.render( result, this.cache[result] );
|
|
}
|
|
} else {
|
|
this.cache = {};
|
|
// Get the languages grouped by script group
|
|
var languagesByScriptGroup = $.uls.data.getLanguagesByScriptGroup( this.options.languages );
|
|
|
|
// Make sure that we go by the original order
|
|
// of script groups
|
|
for ( var scriptGroup in $.uls.data.scriptgroups ) {
|
|
// Get the languages for the script group
|
|
var languages = languagesByScriptGroup[scriptGroup];
|
|
|
|
// It's possible that some script groups are missing
|
|
if ( !languages ) {
|
|
continue;
|
|
}
|
|
|
|
// Sort it based on autonym
|
|
languages.sort( $.uls.data.sortByAutonym );
|
|
|
|
for ( var i = 0; i < languages.length; i++ ) {
|
|
// Check whether it belongs to the region
|
|
this.test( languages[i] );
|
|
}
|
|
}
|
|
}
|
|
|
|
if ( this.options.success ) {
|
|
this.options.success( this );
|
|
}
|
|
},
|
|
|
|
render: function ( langCode, region ) {
|
|
var $target = this.options.$target;
|
|
|
|
if ( !$target ) {
|
|
return;
|
|
}
|
|
|
|
$target.append( langCode, region );
|
|
},
|
|
|
|
next: function () {
|
|
var regionSelector = this;
|
|
|
|
if ( !this.$element.hasClass( 'active' ) ) {
|
|
return true;
|
|
}
|
|
|
|
// Do not respond to all scroll end events, but only after a short interval
|
|
delay( function () {
|
|
var nextRegionGroupNumber = regionSelector.$element.data( 'regiongroup' ) + 1,
|
|
$nextRegion = $( '#uls-region-' + nextRegionGroupNumber ),
|
|
nextRegionSelector = $nextRegion.length && $nextRegion.data( 'regionselector' );
|
|
|
|
// If cache is defined, then it is already rendered and there's no need
|
|
// to re-render it.
|
|
if ( nextRegionSelector && nextRegionSelector.cache === null ) {
|
|
nextRegionSelector.show();
|
|
}
|
|
}, 100 );
|
|
|
|
return false;
|
|
},
|
|
|
|
listen: function () {
|
|
this.$element.on( 'click', $.proxy( this.click, this ) );
|
|
this.options.$target.$element.bind( 'scrollend', $.proxy( this.next, this ) );
|
|
},
|
|
|
|
click: function ( e ) {
|
|
// Don't do anything if a region is selected already
|
|
if ( this.$element.hasClass( 'active' ) ) {
|
|
return;
|
|
}
|
|
|
|
// Re-populate the list of languages
|
|
this.options.$target.empty();
|
|
this.show();
|
|
// Make the selected region (and it only) active
|
|
$( '.regionselector' ).removeClass( 'active' );
|
|
|
|
if ( this.regionGroup ) {
|
|
// if there is a region group, make it active.
|
|
this.$element.addClass( 'active' );
|
|
}
|
|
}
|
|
};
|
|
|
|
/* RegionSelector plugin definition */
|
|
|
|
$.fn.regionselector = function ( option ) {
|
|
return this.each( function () {
|
|
var $this = $( this ),
|
|
data = $this.data( 'regionselector' ),
|
|
options = typeof option === 'object' && option;
|
|
|
|
if ( !data ) {
|
|
$this.data( 'regionselector', ( data = new RegionSelector( this, options ) ) );
|
|
}
|
|
|
|
if ( typeof option === 'string' ) {
|
|
data[option]();
|
|
}
|
|
} );
|
|
};
|
|
|
|
$.fn.regionselector.defaults = {
|
|
$target: null, // Where to render the results
|
|
success: null, // callback if any results found.
|
|
noresults: null, // callback when no results to show
|
|
languages: null
|
|
};
|
|
|
|
$.fn.regionselector.Constructor = RegionSelector;
|
|
|
|
var delay = ( function () {
|
|
var timer = 0;
|
|
return function ( callback, milliseconds ) {
|
|
clearTimeout( timer );
|
|
timer = setTimeout( callback, milliseconds );
|
|
};
|
|
} () );
|
|
|
|
} ( jQuery ) );
|
|
|
|
/**
|
|
* Universal Language Selector
|
|
* ULS core component.
|
|
*
|
|
* Copyright (C) 2012 Alolita Sharma, Amir Aharoni, Arun Ganesh, Brandon Harris,
|
|
* Niklas Laxström, Pau Giner, Santhosh Thottingal, Siebrand Mazeland and other
|
|
* contributors. See CREDITS for a list.
|
|
*
|
|
* UniversalLanguageSelector is dual licensed GPLv2 or later and MIT. You don't
|
|
* have to do anything special to choose one license or the other and you don't
|
|
* have to notify anyone which license you are using. You are free to use
|
|
* UniversalLanguageSelector in commercial projects as long as the copyright
|
|
* header is left intact. See files GPL-LICENSE and MIT-LICENSE for details.
|
|
*
|
|
* @file
|
|
* @ingroup Extensions
|
|
* @licence GNU General Public Licence 2.0 or later
|
|
* @licence MIT License
|
|
*/
|
|
|
|
( function ( $ ) {
|
|
'use strict';
|
|
|
|
// Region numbers in id attributes also appear in the langdb.
|
|
/*jshint multistr:true */
|
|
var template = '\
|
|
<div class="grid uls-menu uls-wide"> \
|
|
<div class="row"> \
|
|
<span id="uls-close" class="icon-close"></span> \
|
|
</div> \
|
|
<div class="row"> \
|
|
<div class="uls-title-region seven columns">\
|
|
<h1 data-i18n="uls-select-language" class="uls-title">Select Language</h1>\
|
|
</div>\
|
|
<div class="five columns map-block" id="map-block">\
|
|
<div class="row">\
|
|
<div data-regiongroup="1" id="uls-region-1" class="three columns uls-region uls-region-1">\
|
|
<a data-i18n="uls-region-WW">Worldwide</a>\
|
|
</div>\
|
|
<div class="nine columns">\
|
|
<div class="row uls-worldmap">\
|
|
<div data-regiongroup="2" id="uls-region-2" class="four columns uls-region">\
|
|
<a data-i18n="uls-region-AM">America</a>\
|
|
</div>\
|
|
<div data-regiongroup="3" id="uls-region-3" class="four columns uls-region">\
|
|
<a><span data-i18n="uls-region-EU">Europe</span><br>\
|
|
<span data-i18n="uls-region-ME">Middle East</span><br>\
|
|
<span data-i18n="uls-region-AF">Africa</span></a>\
|
|
</div>\
|
|
<div data-regiongroup="4" id="uls-region-4" class="four columns uls-region">\
|
|
<a><span data-i18n="uls-region-AS">Asia</span><br>\
|
|
<span data-i18n="uls-region-PA">Pacific</span></a>\
|
|
</div>\
|
|
</div>\
|
|
</div>\
|
|
</div>\
|
|
</div>\
|
|
</div>\
|
|
<div id="search" class="row search"> \
|
|
<div class="one column">\
|
|
<span class="search-label"></span>\
|
|
</div>\
|
|
<div class="ten columns">\
|
|
<div id="search-input-block" class="search-input-block">\
|
|
<input type="text" class="filterinput filtersuggestion" id="filtersuggestion" disabled="true"\
|
|
autocomplete="off" /> <input type="text" class="filterinput languagefilter" id="languagefilter"\
|
|
data-clear="languagefilter-clear" data-suggestion="filtersuggestion"\
|
|
placeholder="Language search" autocomplete="off" />\
|
|
</div>\
|
|
</div>\
|
|
<div class="one column">\
|
|
<span id="languagefilter-clear" class="languagefilter-clear"></span>\
|
|
</div>\
|
|
</div>\
|
|
<div class="row uls-language-list"></div>\
|
|
<div class="row" id="settings-block"></div>\
|
|
</div> ';
|
|
/*jshint multistr:false */
|
|
|
|
/**
|
|
* ULS Public class definition
|
|
*/
|
|
var ULS = function ( element, options ) {
|
|
this.$element = $( element );
|
|
this.options = $.extend( {}, $.fn.uls.defaults, options );
|
|
this.$menu = $( template );
|
|
this.languages = this.options.languages;
|
|
|
|
for ( var code in this.languages ) {
|
|
if ( $.uls.data.languages[code] === undefined ) {
|
|
if ( window.console && window.console.log ) {
|
|
window.console.log( 'ULS: Unknown language ' + code + '.' );
|
|
}
|
|
delete this.languages[code];
|
|
}
|
|
}
|
|
|
|
this.left = this.options.left;
|
|
this.top = this.options.top;
|
|
this.shown = false;
|
|
this.initialized = false;
|
|
|
|
this.$languageFilter = this.$menu.find( '#languagefilter' );
|
|
this.$regionFilters = this.$menu.find( '.uls-region' );
|
|
this.$resultsView = this.$menu.find( 'div.uls-language-list' );
|
|
|
|
this.render();
|
|
this.listen();
|
|
this.ready();
|
|
};
|
|
|
|
ULS.prototype = {
|
|
constructor: ULS,
|
|
|
|
ready: function () {
|
|
if ( this.options.onReady ) {
|
|
this.options.onReady.call( this );
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Calculate the position of ULS
|
|
* Returns an object with top and left properties.
|
|
* @returns {Object}
|
|
*/
|
|
position: function () {
|
|
var pos = $.extend( {}, this.$element.offset(), {
|
|
height: this.$element[0].offsetHeight
|
|
} );
|
|
return {
|
|
top: this.top || pos.top + pos.height,
|
|
left: this.left || '25%'
|
|
};
|
|
},
|
|
|
|
/**
|
|
* Show the ULS window
|
|
*/
|
|
show: function () {
|
|
var pos = this.position();
|
|
this.$menu.css( {
|
|
top: pos.top,
|
|
left: '25%'
|
|
} );
|
|
|
|
if ( !this.initialized ) {
|
|
$( 'body' ).prepend( this.$menu );
|
|
this.i18n();
|
|
// Initialize with a full search.
|
|
// This happens on first time click of uls trigger.
|
|
this.defaultSearch();
|
|
this.initialized = true;
|
|
}
|
|
|
|
// hide any other ULS visible
|
|
$( '.uls-menu' ).hide();
|
|
|
|
this.$menu.show();
|
|
this.shown = true;
|
|
|
|
if ( !this.isMobile() ) {
|
|
this.$languageFilter.focus();
|
|
}
|
|
},
|
|
|
|
i18n: function () {
|
|
if ( $.i18n ) {
|
|
this.$menu.find( '[data-i18n]' ).i18n();
|
|
this.$languageFilter.prop( 'placeholder', $.i18n( 'uls-search-placeholder' ) );
|
|
}
|
|
},
|
|
|
|
defaultSearch: function () {
|
|
this.$resultsView.lcd( 'empty' );
|
|
|
|
if ( this.options.lazyload ) {
|
|
this.$regionFilters.first().regionselector( 'show' );
|
|
} else {
|
|
this.$regionFilters.regionselector( 'show' );
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Hide the ULS window
|
|
*/
|
|
hide: function () {
|
|
this.$menu.hide();
|
|
this.shown = false;
|
|
},
|
|
|
|
/**
|
|
* Render the UI elements.
|
|
* Does nothing by default. Can be used for customization.
|
|
*/
|
|
render: function () {
|
|
// Rendering stuff here
|
|
},
|
|
|
|
/**
|
|
* Callback for no results found context.
|
|
*/
|
|
noresults: function () {
|
|
this.$resultsView.lcd( 'noResults' );
|
|
},
|
|
|
|
/**
|
|
* callback for results found context.
|
|
*/
|
|
success: function () {
|
|
this.$resultsView.show();
|
|
},
|
|
|
|
/**
|
|
* Bind the UI elements with their event listeners
|
|
*/
|
|
listen: function () {
|
|
var lcd,
|
|
uls = this;
|
|
|
|
// Register all event listeners to the ULS here.
|
|
uls.$element.on( 'click', $.proxy( uls.click, uls ) );
|
|
|
|
uls.$languageFilter.on( 'searchclear', $.proxy( uls.defaultSearch, uls ) );
|
|
|
|
// Close when clicking on the close button
|
|
uls.$menu.find( '#uls-close' ).on( 'click', $.proxy( uls.cancel, uls ) );
|
|
// Don't do anything if pressing on empty space in the ULS
|
|
uls.$menu.on( 'click', function ( e ) {
|
|
e.stopPropagation();
|
|
} );
|
|
|
|
// Handle key press events on the menu
|
|
uls.$menu.on( 'keypress', $.proxy( this.keypress, this ) )
|
|
.on( 'keyup', $.proxy( this.keyup, this ) );
|
|
|
|
if ( this.eventSupported( 'keydown' ) ) {
|
|
this.$menu.on( 'keydown', $.proxy( this.keypress, this ) );
|
|
}
|
|
|
|
lcd = uls.$resultsView.lcd( {
|
|
languages: uls.languages,
|
|
quickList: uls.options.quickList,
|
|
clickhandler: $.proxy( uls.select, uls ),
|
|
lazyload: uls.options.lazyload,
|
|
source: uls.$languageFilter,
|
|
showRegions: uls.options.showRegions
|
|
} ).data( 'lcd' );
|
|
|
|
uls.$languageFilter.languagefilter( {
|
|
$target: lcd,
|
|
languages: uls.languages,
|
|
success: function () {
|
|
$( '.regionselector' ).removeClass( 'active' );
|
|
uls.success();
|
|
},
|
|
noresults: function () {
|
|
$( '.regionselector' ).removeClass( 'active' );
|
|
uls.noresults();
|
|
},
|
|
searchAPI: uls.options.searchAPI,
|
|
onSelect: $.proxy( uls.select, uls )
|
|
} );
|
|
|
|
// Create region selectors, one per region
|
|
this.$menu.find( '.uls-region, .uls-region-link' ).regionselector( {
|
|
$target: lcd,
|
|
languages: uls.languages,
|
|
success: function ( regionfilter ) {
|
|
// Deactivate search filtering
|
|
uls.$languageFilter.languagefilter( 'deactivate' );
|
|
|
|
// If it is the WW region, show the quicklist
|
|
if ( regionfilter.regionGroup === 1 ) {
|
|
lcd.quicklist();
|
|
}
|
|
|
|
// Show 'results view' if we are in no results mode
|
|
uls.success();
|
|
},
|
|
noresults: function () {
|
|
uls.$languageFilter.languagefilter( 'clear' );
|
|
}
|
|
} );
|
|
},
|
|
|
|
/**
|
|
* On select handler for search results
|
|
* @param langCode
|
|
*/
|
|
select: function ( langCode ) {
|
|
this.hide();
|
|
|
|
if ( this.options.onSelect ) {
|
|
this.options.onSelect.call( this, langCode );
|
|
}
|
|
},
|
|
|
|
/**
|
|
* On cancel handler for the uls menu
|
|
*/
|
|
cancel: function () {
|
|
this.hide();
|
|
|
|
if ( this.options.onCancel ) {
|
|
this.options.onCancel.call( this );
|
|
}
|
|
},
|
|
|
|
keyup: function ( e ) {
|
|
if ( !this.shown ) {
|
|
return;
|
|
}
|
|
|
|
if ( e.keyCode === 27 ) { // escape
|
|
this.cancel();
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
}
|
|
},
|
|
|
|
keypress: function ( e ) {
|
|
if ( !this.shown ) {
|
|
return;
|
|
}
|
|
|
|
if ( e.keyCode === 27 ) { // escape
|
|
this.cancel();
|
|
e.preventDefault();
|
|
e.stopPropagation();
|
|
}
|
|
},
|
|
|
|
click: function ( e ) {
|
|
e.stopPropagation();
|
|
e.preventDefault();
|
|
|
|
if ( this.shown ) {
|
|
this.hide();
|
|
} else {
|
|
this.show();
|
|
}
|
|
},
|
|
|
|
eventSupported: function ( eventName ) {
|
|
var isSupported = eventName in this.$menu;
|
|
|
|
if ( !isSupported ) {
|
|
this.$element.setAttribute( eventName, 'return;' );
|
|
isSupported = typeof this.$element[eventName] === 'function';
|
|
}
|
|
|
|
return isSupported;
|
|
},
|
|
|
|
isMobile: function () {
|
|
return navigator.userAgent.match( /(iPhone|iPod|iPad|Android|BlackBerry)/ );
|
|
}
|
|
};
|
|
|
|
/* ULS PLUGIN DEFINITION
|
|
* =========================== */
|
|
|
|
$.fn.uls = function ( option ) {
|
|
return this.each( function () {
|
|
var $this = $( this ),
|
|
data = $this.data( 'uls' ),
|
|
options = typeof option === 'object' && option;
|
|
|
|
if ( !data ) {
|
|
$this.data( 'uls', ( data = new ULS( this, options ) ) );
|
|
}
|
|
|
|
if ( typeof option === 'string' ) {
|
|
data[option]();
|
|
}
|
|
} );
|
|
};
|
|
|
|
$.fn.uls.defaults = {
|
|
menu: template,
|
|
onSelect: null, // Callback function to be called when a language is selected
|
|
searchAPI: null, // Language search API
|
|
languages: $.uls.data.getAutonyms(), // Languages to be used for ULS, default is all languages
|
|
quickList: null, // Array of language codes or function that returns such
|
|
lazyload: true, // Lazy load the language list when scrolled.
|
|
showRegions: ['WW', 'AM', 'EU', 'ME', 'AF', 'AS', 'PA']
|
|
};
|
|
|
|
// Define a dummy i18n function, if jquery.i18n not integrated.
|
|
if ( !$.fn.i18n ) {
|
|
$.fn.i18n = function () {
|
|
};
|
|
}
|
|
|
|
$.fn.uls.Constructor = ULS;
|
|
} ( jQuery ) );
|