×
Namespaces

Variants
Actions
Revision as of 11:01, 23 July 2012 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Extended language support for WRT

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: Risalmin (23 Jun 2009)
Last edited: hamishwillee (23 Jul 2012)

What is it

This article describes an extended way for getting the supported languages on a WRT supported device

Why

The current method only returns S60 enumerations and they cannot be used easily in code.

function getLangExtended() {
//This function returns the ISO codes, S60 enumerations and real names
//for all languages supported by the device.
//Requires S60 Platform services
//Covers also all languages not yet supported ;o)
 
var systemServiceObj = null;
systemServiceObj = device.getServiceObject("Service.SysInfo", "ISysInfo");
 
var criteria = new Object();
criteria.Entity = "General";
criteria.Key = "SupportedLanguages";
alert(criteria.Key);
 
var result = systemServiceObj.ISysInfo.GetInfo(criteria callBack);
var langList=result.ReturnValue.LanguageList;
 
criteria.Entity = "General";
criteria.Key = "InputLanguage";
alert(criteria.Key);
 
var result = systemServiceObj.ISysInfo.GetInfo(criteria callBack);
var defaultLang = result.ReturnValue.Status;
 
var languages = new Array();
 
for (var i=0;i<=langList.length-1;i++){
var language = new Object();
var fromTable = langCodeTable[langList[i]].split("|");
language.s60Enum = langList[i];
language.ISOCode = fromTable[0];
language.realName = fromTable[1];
language.eLang = fromTable[2];
if(languages.s60Enum == defaultLang){
language.default = true;
}else{
language.default = false;
}
languages[i] = language;
}
return languages;
}
var langCodeTable = new Array(); //Array to store the language values
langCodeTable[0]="dummy|No WRT|Am I on PC";//Dummy value for testing in browser
langCodeTable[1]="en|English, GB|ELangEnglish";
langCodeTable[2]="fr|French|ELangFrench";
langCodeTable[3]="de|German|ELangGerman";
langCodeTable[4]="es|Spanish|ELangSpanish";
langCodeTable[5]="it|Italian|ELangItalian";
langCodeTable[6]="sv|Swedish|ELangSwedish";
langCodeTable[7]="da|Danish|ELangDanish";
langCodeTable[8]="no|Norwegian|ELangNorwegian";
langCodeTable[9]="fi|Finnish|ELangFinnish";
langCodeTable[10]="en-US|English, US|ELangAmerican";
langCodeTable[11]="fr-CH|French, SW|ELangSwissFrench";
langCodeTable[12]="ge-CH|German, SW|ELangSwissGerman";
langCodeTable[13]="pt|Portuguese|ELangPortuguese";
langCodeTable[14]="tr|Turkish|ELangTurkish";
langCodeTable[15]="is|Icelandic|ELangIcelandic";
langCodeTable[16]="ru|Russian|ELangRussian";
langCodeTable[17]="hu|Hungarian|ELangHungarian";
langCodeTable[18]="nl|Dutch|ELangDutch";
langCodeTable[19]="nl-BE|Belgian Flemish|ELangBelgianFlemish";
langCodeTable[20]="en-AU|Australian|ELangAustralian";
langCodeTable[21]="fr-BE|Belgian French|ELangBelgianFrench";
langCodeTable[22]="de-AT|German (Austrian)|ELangAustrian";
langCodeTable[23]="en-NZ|New Zealand English|ELangNewZealand";
langCodeTable[24]="fr|French (International)|ELangInternationalFrench";
langCodeTable[25]="cs|Czech|ELangCzech";
langCodeTable[26]="sk|Slovak|ELangSlovak";
langCodeTable[27]="pl|Polish|ELangPolish";
langCodeTable[28]="sl|Slovenian|ELangSlovenian";
langCodeTable[29]="zh-Hant|Chinese (Taiwan, traditional)|ELangTaiwanChinese";
langCodeTable[30]="zh-Hant|Chinese (Hongkong, traditional)|ELangHongKongChinese";
langCodeTable[31]="zh-Hans|Chinese (PRC, simplified)|ELangPrcChinese";
langCodeTable[32]="ja|Japanese|ELangJapanese";
langCodeTable[33]="th|Thai|ELangThai";
langCodeTable[34]="af|Afrikaans|ELangAfrikaans";
langCodeTable[35]="sq|Albanian|ELangAlbanian";
langCodeTable[36]="am|Amharic|ELangAmharic";
langCodeTable[37]="ar|Arabic|ELangArabic";
langCodeTable[38]="hy|Armenian|ELangArmenian";
langCodeTable[39]="tl|Tagalog|ELangTagalog";
langCodeTable[40]="be|Belarusian|ELangBelarussian";
langCodeTable[41]="bn|Bengali|ELangBengali";
langCodeTable[42]="bg|Bulgarian|ELangBulgarian";
langCodeTable[43]="my|Burmese|ELangBurmese";
langCodeTable[44]="ca|Catalan|ELangCatalan";
langCodeTable[45]="hr|Croatian|ELangCroatian";
langCodeTable[46]="en-CA|English, CA|ELangCanadianEnglish";
langCodeTable[47]="en|English (International)|ELangInternationalEnglish";
langCodeTable[48]="en-ZA|English (South African)|ELangSouthAfricanEnglish";
langCodeTable[49]="et|Estonian|ELangEstonian";
langCodeTable[50]="fa|Farsi|ELangFarsi";
langCodeTable[51]="fr-CA|French, Canadian|ELangCanadianFrench";
langCodeTable[52]="ga|Gaelic|ELangScotsGaelic";
langCodeTable[53]="ka|Georgian|ELangGeorgian";
langCodeTable[54]="el|Greek, Modern|ELangGreek";
langCodeTable[55]="el-CY|Greek (Cyprus)|ELangCyprusGreek";
langCodeTable[56]="gu|Gujarati|ELangGujarati";
langCodeTable[57]="he|Hebrew|ELangHebrew";
langCodeTable[58]="hi|Hindi|ELangHindi";
langCodeTable[59]="id|Indonesian|ELangIndonesian";
langCodeTable[60]="ga|Irish|ELangIrish";
langCodeTable[61]="it-CH|Swiss Italian|ELangSwissItalian";
langCodeTable[62]="kn|Kannada|ELangKannada";
langCodeTable[63]="kk|Kazakh|ELangKazakh";
langCodeTable[64]="km|Khmer|ELangKhmer";
langCodeTable[65]="ko|Korean|ELangKorean";
langCodeTable[66]="lo|Lao|ELangLao";
langCodeTable[67]="lv|Latvian|ELangLatvian";
langCodeTable[68]="lt|Lithuanian|ELangLithuanian";
langCodeTable[69]="mk|Macedonian|ELangMacedonian";
langCodeTable[70]="ms|Malay|ELangMalay";
langCodeTable[71]="ml|Malayalam|ELangMalayalam";
langCodeTable[72]="mr|Marathi|ELangMarathi";
langCodeTable[73]="mo|Moldavian|ELangMoldavian";
langCodeTable[74]="mn|Mongolian|ELangMongolian";
langCodeTable[75]="nn|Norwegian Nynorsk|ELangNorwegianNynorsk";
langCodeTable[76]="pt-BR|Portuguese, Brazilian|ELangBrazilianPortuguese";
langCodeTable[77]="pa|Punjabi|ELangPunjabi";
langCodeTable[78]="ro|Romanian|ELangRomanian";
langCodeTable[79]="sr|Serbian|ELangSerbian";
langCodeTable[80]="si|Sinhalese|ELangSinhalese";
langCodeTable[81]="so|Somali|ELangSomali";
langCodeTable[82]="es|Spanish, International|ELangInternationalSpanish";
langCodeTable[83]="es-419|Spanish, LatinAmerican|ELangLatinAmericanSpanish";
langCodeTable[84]="sw|Swahili|ELangSwahili";
langCodeTable[85]="sv-FI|Finland Swedish|ELangFinlandSwedish";
langCodeTable[86]="und|Reserved for future use|ELangReserved1";
langCodeTable[87]="ta|Tamil|ELangTamil";
langCodeTable[88]="te|Telugu|ELangTelugu";
langCodeTable[89]="bo|Tibetan|ELangTibetan";
langCodeTable[90]="ti|Tigrinya|ELangTigrinya";
langCodeTable[91]="tr-CY|Cyprus Turkish|ELangCyprusTurkish";
langCodeTable[92]="tk|Turkmen|ELangTurkmen";
langCodeTable[93]="uk|Ukrainian|ELangUkrainian";
langCodeTable[94]="ur|Urdu|ELangUrdu";
langCodeTable[95]="und|Reserved for future use|ELangReserved2";
langCodeTable[96]="vi|Vietnamese|ELangVietnamese";
langCodeTable[97]="cy|Welsh|ELangWelsh";
langCodeTable[98]="zu|Zulu|ELangZulu";
langCodeTable[99]="und|Other (deprecated)|ELangOther";
langCodeTable[100]="und|Undefined|Undefined";
langCodeTable[101]="und|Undefined|Undefined";
langCodeTable[102]="eu|Basque|ELangBasque";
langCodeTable[103]="gl|Galician|ELangGalician";
langCodeTable[104]="und|Undefined|Undefined";
langCodeTable[105]="und|Undefined|Undefined";
langCodeTable[106]="und|Undefined|Undefined";
langCodeTable[107]="und|Undefined|Undefined";
langCodeTable[108]="und|Undefined|Undefined";
langCodeTable[109]="und|Undefined|Undefined";
langCodeTable[110]="und|Undefined|Undefined";
langCodeTable[111]="und|Undefined|Undefined";
langCodeTable[112]="und|Undefined|Undefined";
langCodeTable[113]="und|Undefined|Undefined";
langCodeTable[114]="und|Undefined|Undefined";
langCodeTable[115]="und|Undefined|Undefined";
langCodeTable[116]="und|Undefined|Undefined";
langCodeTable[117]="und|Undefined|Undefined";
langCodeTable[118]="und|Undefined|Undefined";
langCodeTable[119]="und|Undefined|Undefined";
langCodeTable[120]="und|Undefined|Undefined";
langCodeTable[121]="und|Undefined|Undefined";
langCodeTable[122]="und|Undefined|Undefined";
langCodeTable[123]="und|Undefined|Undefined";
langCodeTable[124]="und|Undefined|Undefined";
langCodeTable[125]="und|Undefined|Undefined";
langCodeTable[126]="und|Undefined|Undefined";
langCodeTable[127]="und|Undefined|Undefined";
langCodeTable[128]="und|Undefined|Undefined";
langCodeTable[129]="en-APAC|English, APAC|KLangApacEnglish";
langCodeTable[130]="und|Undefined|Undefined";
langCodeTable[131]="und|Undefined|Undefined";
langCodeTable[132]="und|Undefined|Undefined";
langCodeTable[133]="und|Undefined|Undefined";
langCodeTable[134]="und|Undefined|Undefined";
langCodeTable[135]="und|Undefined|Undefined";
langCodeTable[136]="und|Undefined|Undefined";
langCodeTable[137]="und|Undefined|Undefined";
langCodeTable[138]="und|Undefined|Undefined";
langCodeTable[139]="und|Undefined|Undefined";
langCodeTable[140]="und|Undefined|Undefined";
langCodeTable[141]="und|Undefined|Undefined";
langCodeTable[142]="und|Undefined|Undefined";
langCodeTable[143]="und|Undefined|Undefined";
langCodeTable[144]="und|Undefined|Undefined";
langCodeTable[145]="und|Undefined|Undefined";
langCodeTable[146]="und|Undefined|Undefined";
langCodeTable[147]="und|Undefined|Undefined";
langCodeTable[148]="und|Undefined|Undefined";
langCodeTable[149]="und|Undefined|Undefined";
langCodeTable[150]="und|Undefined|Undefined";
langCodeTable[151]="und|Undefined|Undefined";
langCodeTable[152]="und|Undefined|Undefined";
langCodeTable[153]="und|Undefined|Undefined";
langCodeTable[154]="und|Undefined|Undefined";
langCodeTable[155]="und|Undefined|Undefined";
langCodeTable[156]="und|Undefined|Undefined";
langCodeTable[157]="en-TW|English, TW|KLangTaiwanEnglish";
langCodeTable[158]="en-CN|English, PRC|KLangPrcEnglish";
langCodeTable[159]="en-HK|English, HK|KLangHongKongEnglish";
langCodeTable[160]="en-JP|English, Japan|KLangJapaneseEnglish";
langCodeTable[161]="en-TH|English, Thailand|KLangThaiEnglish";
langCodeTable[162]="und|Undefined|Undefined";
langCodeTable[163]="und|Undefined|Undefined";
langCodeTable[164]="und|Undefined|Undefined";
langCodeTable[165]="und|Undefined|Undefined";
langCodeTable[166]="und|Undefined|Undefined";
langCodeTable[167]="und|Undefined|Undefined";
langCodeTable[168]="und|Undefined|Undefined";
langCodeTable[169]="und|Undefined|Undefined";
langCodeTable[170]="und|Undefined|Undefined";
langCodeTable[171]="und|Undefined|Undefined";
langCodeTable[172]="und|Undefined|Undefined";
langCodeTable[173]="und|Undefined|Undefined";
langCodeTable[174]="und|Undefined|Undefined";
langCodeTable[175]="und|Undefined|Undefined";
langCodeTable[176]="und|Undefined|Undefined";
langCodeTable[177]="und|Undefined|Undefined";
langCodeTable[178]="und|Undefined|Undefined";
langCodeTable[179]="und|Undefined|Undefined";
langCodeTable[180]="und|Undefined|Undefined";
langCodeTable[181]="und|Undefined|Undefined";
langCodeTable[182]="und|Undefined|Undefined";
langCodeTable[183]="und|Undefined|Undefined";
langCodeTable[184]="und|Undefined|Undefined";
langCodeTable[185]="und|Undefined|Undefined";
langCodeTable[186]="und|Undefined|Undefined";
langCodeTable[187]="und|Undefined|Undefined";
langCodeTable[188]="und|Undefined|Undefined";
langCodeTable[189]="und|Undefined|Undefined";
langCodeTable[190]="und|Undefined|Undefined";
langCodeTable[191]="und|Undefined|Undefined";
langCodeTable[192]="und|Undefined|Undefined";
langCodeTable[193]="und|Undefined|Undefined";
langCodeTable[194]="und|Undefined|Undefined";
langCodeTable[195]="und|Undefined|Undefined";
langCodeTable[196]="und|Undefined|Undefined";
langCodeTable[197]="und|Undefined|Undefined";
langCodeTable[198]="und|Undefined|Undefined";
langCodeTable[199]="und|Undefined|Undefined";
langCodeTable[200]="und|Undefined|Undefined";
langCodeTable[201]="und|Undefined|Undefined";
langCodeTable[202]="und|Undefined|Undefined";
langCodeTable[203]="und|Undefined|Undefined";
langCodeTable[204]="und|Undefined|Undefined";
langCodeTable[205]="und|Undefined|Undefined";
langCodeTable[206]="und|Undefined|Undefined";
langCodeTable[207]="und|Undefined|Undefined";
langCodeTable[208]="und|Undefined|Undefined";
langCodeTable[209]="und|Undefined|Undefined";
langCodeTable[210]="und|Undefined|Undefined";
langCodeTable[211]="und|Undefined|Undefined";
langCodeTable[212]="und|Undefined|Undefined";
langCodeTable[213]="und|Undefined|Undefined";
langCodeTable[214]="und|Undefined|Undefined";
langCodeTable[215]="und|Undefined|Undefined";
langCodeTable[216]="und|Undefined|Undefined";
langCodeTable[217]="und|Undefined|Undefined";
langCodeTable[218]="und|Undefined|Undefined";
langCodeTable[219]="und|Undefined|Undefined";
langCodeTable[220]="und|Undefined|Undefined";
langCodeTable[221]="und|Undefined|Undefined";
langCodeTable[222]="und|Undefined|Undefined";
langCodeTable[223]="und|Undefined|Undefined";
langCodeTable[224]="und|Undefined|Undefined";
langCodeTable[225]="und|Undefined|Undefined";
langCodeTable[226]="und|Undefined|Undefined";
langCodeTable[227]="und|Undefined|Undefined";
langCodeTable[228]="und|Undefined|Undefined";
langCodeTable[229]="und|Undefined|Undefined";
langCodeTable[230]="en-IN|English, Indic|KLangIndicEnglish";
langCodeTable[231]="und|Undefined|Undefined";
langCodeTable[232]="und|Undefined|Undefined";
langCodeTable[233]="und|Undefined|Undefined";
langCodeTable[234]="und|Undefined|Undefined";
langCodeTable[235]="und|Undefined|Undefined";
langCodeTable[236]="und|Undefined|Undefined";
langCodeTable[237]="und|Undefined|Undefined";
langCodeTable[238]="und|Undefined|Undefined";
langCodeTable[239]="und|Undefined|Undefined";
langCodeTable[240]="und|Undefined|Undefined";
langCodeTable[241]="und|Undefined|Undefined";
langCodeTable[242]="und|Undefined|Undefined";
langCodeTable[243]="und|Undefined|Undefined";
langCodeTable[244]="und|Undefined|Undefined";
langCodeTable[245]="und|Undefined|Undefined";
langCodeTable[246]="und|Undefined|Undefined";
langCodeTable[247]="und|Undefined|Undefined";
langCodeTable[248]="und|Undefined|Undefined";
langCodeTable[249]="und|Undefined|Undefined";
langCodeTable[250]="und|Undefined|Undefined";
langCodeTable[251]="und|Undefined|Undefined";
langCodeTable[252]="und|Undefined|Undefined";
langCodeTable[253]="und|Undefined|Undefined";
langCodeTable[254]="und|Undefined|Undefined";
langCodeTable[255]="und|Undefined|Undefined";
langCodeTable[256]="und|Undefined|Undefined";
langCodeTable[257]="und|Undefined|Undefined";
langCodeTable[258]="und|Undefined|Undefined";
langCodeTable[259]="und|Undefined|Undefined";
langCodeTable[260]="und|Undefined|Undefined";
langCodeTable[261]="und|Undefined|Undefined";
langCodeTable[262]="und|Undefined|Undefined";
langCodeTable[263]="und|Undefined|Undefined";
langCodeTable[264]="und|Undefined|Undefined";
langCodeTable[265]="und|Undefined|Undefined";
langCodeTable[266]="und|Undefined|Undefined";
langCodeTable[267]="und|Undefined|Undefined";
langCodeTable[268]="und|Undefined|Undefined";
langCodeTable[269]="und|Undefined|Undefined";
langCodeTable[270]="und|Undefined|Undefined";
langCodeTable[271]="und|Undefined|Undefined";
langCodeTable[272]="und|Undefined|Undefined";
langCodeTable[273]="und|Undefined|Undefined";
langCodeTable[274]="und|Undefined|Undefined";
langCodeTable[275]="und|Undefined|Undefined";
langCodeTable[276]="und|Undefined|Undefined";
langCodeTable[277]="und|Undefined|Undefined";
langCodeTable[278]="und|Undefined|Undefined";
langCodeTable[279]="und|Undefined|Undefined";
langCodeTable[280]="und|Undefined|Undefined";
langCodeTable[281]="und|Undefined|Undefined";
langCodeTable[282]="und|Undefined|Undefined";
langCodeTable[283]="und|Undefined|Undefined";
langCodeTable[284]="und|Undefined|Undefined";
langCodeTable[285]="und|Undefined|Undefined";
langCodeTable[286]="und|Undefined|Undefined";
langCodeTable[287]="und|Undefined|Undefined";
langCodeTable[288]="und|Undefined|Undefined";
langCodeTable[289]="und|Undefined|Undefined";
langCodeTable[290]="und|Undefined|Undefined";
langCodeTable[291]="und|Undefined|Undefined";
langCodeTable[292]="und|Undefined|Undefined";
langCodeTable[293]="und|Undefined|Undefined";
langCodeTable[294]="und|Undefined|Undefined";
langCodeTable[295]="und|Undefined|Undefined";
langCodeTable[296]="und|Undefined|Undefined";
langCodeTable[297]="und|Undefined|Undefined";
langCodeTable[298]="und|Undefined|Undefined";
langCodeTable[299]="und|Undefined|Undefined";
langCodeTable[300]="und|Undefined|Undefined";
langCodeTable[301]="und|Undefined|Undefined";
langCodeTable[302]="und|Undefined|Undefined";
langCodeTable[303]="und|Undefined|Undefined";
langCodeTable[304]="und|Undefined|Undefined";
langCodeTable[305]="und|Undefined|Undefined";
langCodeTable[306]="und|Undefined|Undefined";
langCodeTable[307]="und|Undefined|Undefined";
langCodeTable[308]="und|Undefined|Undefined";
langCodeTable[309]="und|Undefined|Undefined";
langCodeTable[310]="und|Undefined|Undefined";
langCodeTable[311]="und|Undefined|Undefined";
langCodeTable[312]="und|Undefined|Undefined";
langCodeTable[313]="und|Undefined|Undefined";
langCodeTable[314]="und|Undefined|Undefined";
langCodeTable[315]="und|Undefined|Undefined";
langCodeTable[316]="und|Undefined|Undefined";
langCodeTable[317]="und|Undefined|Undefined";
langCodeTable[318]="und|Undefined|Undefined";
langCodeTable[319]="und|Undefined|Undefined";
langCodeTable[320]="und|Undefined|Undefined";
langCodeTable[321]="und|Undefined|Undefined";
langCodeTable[322]="und|Undefined|Undefined";
langCodeTable[323]="und|Undefined|Undefined";
langCodeTable[324]="und|Undefined|Undefined";
langCodeTable[325]="und|Undefined|Undefined";
langCodeTable[326]="ms-APAC|Malay, APAC|KLangApacMalay";
langCodeTable[327]="id-APAC|Indonesian, APAC|KLangApacIndonesian";
langCodeTable[328]="und|Undefined|Undefined";
langCodeTable[329]="und|Undefined|Undefined";
langCodeTable[330]="und|Undefined|Undefined";
This page was last modified on 23 July 2012, at 11:01.
81 page views in the last 30 days.