diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2015-03-20 06:59:33 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2015-03-20 06:59:33 +0000 |
commit | ec56ce9659fcbf0e6725e41492095adfc3ef8d2f (patch) | |
tree | 50a6fea1c40455de5db4224c2f8437f51d7c815a | |
parent | 81f46061857cad78faa649a0f1a8916008ab0017 (diff) |
added language support
git-svn-id: http://svn.miranda-ng.org/main/trunk@12442 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | protocols/SkypeWeb/src/skype_profile.cpp | 198 |
1 files changed, 196 insertions, 2 deletions
diff --git a/protocols/SkypeWeb/src/skype_profile.cpp b/protocols/SkypeWeb/src/skype_profile.cpp index 9d1bd3ea10..30915f41ff 100644 --- a/protocols/SkypeWeb/src/skype_profile.cpp +++ b/protocols/SkypeWeb/src/skype_profile.cpp @@ -1,5 +1,194 @@ #include "common.h"
+struct { TCHAR *szCode; TCHAR *szDescription; } g_LanguageCodes[] = {
+ { _T("aa"), LPGENT("Afar") },
+ { _T("ab"), LPGENT("Abkhazian") },
+ { _T("af"), LPGENT("Afrikaans") },
+ { _T("ak"), LPGENT("Akan") },
+ { _T("sq"), LPGENT("Albanian") },
+ { _T("am"), LPGENT("Amharic") },
+ { _T("ar"), LPGENT("Arabic") },
+ { _T("an"), LPGENT("Aragonese") },
+ { _T("hy"), LPGENT("Armenian") },
+ { _T("as"), LPGENT("Assamese") },
+ { _T("av"), LPGENT("Avaric") },
+ { _T("ae"), LPGENT("Avestan") },
+ { _T("ay"), LPGENT("Aymara") },
+ { _T("az"), LPGENT("Azerbaijani") },
+ { _T("ba"), LPGENT("Bashkir") },
+ { _T("bm"), LPGENT("Bambara") },
+ { _T("eu"), LPGENT("Basque") },
+ { _T("be"), LPGENT("Belarusian") },
+ { _T("bn"), LPGENT("Bengali") },
+ { _T("bh"), LPGENT("Bihari") },
+ { _T("bi"), LPGENT("Bislama") },
+ { _T("bs"), LPGENT("Bosnian") },
+ { _T("br"), LPGENT("Breton") },
+ { _T("bg"), LPGENT("Bulgarian") },
+ { _T("my"), LPGENT("Burmese") },
+ { _T("ca"), LPGENT("Catalan; Valencian") },
+ { _T("ch"), LPGENT("Chamorro") },
+ { _T("ce"), LPGENT("Chechen") },
+ { _T("zh"), LPGENT("Chinese") },
+ { _T("cu"), LPGENT("Church Slavic; Old Slavonic") },
+ { _T("cv"), LPGENT("Chuvash") },
+ { _T("kw"), LPGENT("Cornish") },
+ { _T("co"), LPGENT("Corsican") },
+ { _T("cr"), LPGENT("Cree") },
+ { _T("cs"), LPGENT("Czech") },
+ { _T("da"), LPGENT("Danish") },
+ { _T("dv"), LPGENT("Divehi; Dhivehi; Maldivian") },
+ { _T("nl"), LPGENT("Dutch; Flemish") },
+ { _T("dz"), LPGENT("Dzongkha") },
+ { _T("en"), LPGENT("English") },
+ { _T("eo"), LPGENT("Esperanto") },
+ { _T("et"), LPGENT("Estonian") },
+ { _T("ee"), LPGENT("Ewe") },
+ { _T("fo"), LPGENT("Faroese") },
+ { _T("fj"), LPGENT("Fijian") },
+ { _T("fi"), LPGENT("Finnish") },
+ { _T("fr"), LPGENT("French") },
+ { _T("fy"), LPGENT("Western Frisian") },
+ { _T("ff"), LPGENT("Fulah") },
+ { _T("ka"), LPGENT("Georgian") },
+ { _T("de"), LPGENT("German") },
+ { _T("gd"), LPGENT("Gaelic; Scottish Gaelic") },
+ { _T("ga"), LPGENT("Irish") },
+ { _T("gl"), LPGENT("Galician") },
+ { _T("gv"), LPGENT("Manx") },
+ { _T("el"), LPGENT("Greek, Modern (1453-)") },
+ { _T("gn"), LPGENT("Guarani") },
+ { _T("gu"), LPGENT("Gujarati") },
+ { _T("ht"), LPGENT("Haitian; Haitian Creole") },
+ { _T("ha"), LPGENT("Hausa") },
+ { _T("he"), LPGENT("Hebrew") },
+ { _T("hz"), LPGENT("Herero") },
+ { _T("hi"), LPGENT("Hindi") },
+ { _T("ho"), LPGENT("Hiri Motu") },
+ { _T("hu"), LPGENT("Hungarian") },
+ { _T("ig"), LPGENT("Igbo") },
+ { _T("is"), LPGENT("Icelandic") },
+ { _T("io"), LPGENT("Ido") },
+ { _T("ii"), LPGENT("Sichuan Yi") },
+ { _T("iu"), LPGENT("Inuktitut") },
+ { _T("ie"), LPGENT("Interlingue") },
+ { _T("ia"), LPGENT("Interlingua (International Auxiliary Language Association)") },
+ { _T("id"), LPGENT("Indonesian") },
+ { _T("ik"), LPGENT("Inupiaq") },
+ { _T("it"), LPGENT("Italian") },
+ { _T("jv"), LPGENT("Javanese") },
+ { _T("ja"), LPGENT("Japanese") },
+ { _T("kl"), LPGENT("Kalaallisut; Greenlandic") },
+ { _T("kn"), LPGENT("Kannada") },
+ { _T("ks"), LPGENT("Kashmiri") },
+ { _T("kr"), LPGENT("Kanuri") },
+ { _T("kk"), LPGENT("Kazakh") },
+ { _T("km"), LPGENT("Central Khmer") },
+ { _T("ki"), LPGENT("Kikuyu; Gikuyu") },
+ { _T("rw"), LPGENT("Kinyarwanda") },
+ { _T("ky"), LPGENT("Kirghiz; Kyrgyz") },
+ { _T("kv"), LPGENT("Komi") },
+ { _T("kg"), LPGENT("Kongo") },
+ { _T("ko"), LPGENT("Korean") },
+ { _T("kj"), LPGENT("Kuanyama; Kwanyama") },
+ { _T("ku"), LPGENT("Kurdish") },
+ { _T("lo"), LPGENT("Lao") },
+ { _T("la"), LPGENT("Latin") },
+ { _T("lv"), LPGENT("Latvian") },
+ { _T("li"), LPGENT("Limburgan; Limburger; Limburgish") },
+ { _T("ln"), LPGENT("Lingala") },
+ { _T("lt"), LPGENT("Lithuanian") },
+ { _T("lb"), LPGENT("Luxembourgish; Letzeburgesch") },
+ { _T("lu"), LPGENT("Luba-Katanga") },
+ { _T("lg"), LPGENT("Ganda") },
+ { _T("mk"), LPGENT("Macedonian") },
+ { _T("mh"), LPGENT("Marshallese") },
+ { _T("ml"), LPGENT("Malayalam") },
+ { _T("mi"), LPGENT("Maori") },
+ { _T("mr"), LPGENT("Marathi") },
+ { _T("ms"), LPGENT("Malay") },
+ { _T("mg"), LPGENT("Malagasy") },
+ { _T("mt"), LPGENT("Maltese") },
+ { _T("mo"), LPGENT("Moldavian") },
+ { _T("mn"), LPGENT("Mongolian") },
+ { _T("na"), LPGENT("Nauru") },
+ { _T("nv"), LPGENT("Navajo; Navaho") },
+ { _T("nr"), LPGENT("Ndebele, South; South Ndebele") },
+ { _T("nd"), LPGENT("Ndebele, North; North Ndebele") },
+ { _T("ng"), LPGENT("Ndonga") },
+ { _T("ne"), LPGENT("Nepali") },
+ { _T("nn"), LPGENT("Norwegian Nynorsk; Nynorsk, Norwegian") },
+ { _T("nb"), LPGENT("Bokmaal, Norwegian; Norwegian Bokmaal") },
+ { _T("no"), LPGENT("Norwegian") },
+ { _T("ny"), LPGENT("Chichewa; Chewa; Nyanja") },
+ { _T("oc"), LPGENT("Occitan (post 1500); Provencal") },
+ { _T("oj"), LPGENT("Ojibwa") },
+ { _T("or"), LPGENT("Oriya") },
+ { _T("om"), LPGENT("Oromo") },
+ { _T("os"), LPGENT("Ossetian; Ossetic") },
+ { _T("pa"), LPGENT("Panjabi; Punjabi") },
+ { _T("fa"), LPGENT("Persian") },
+ { _T("pi"), LPGENT("Pali") },
+ { _T("pl"), LPGENT("Polish") },
+ { _T("pt"), LPGENT("Portuguese") },
+ { _T("ps"), LPGENT("Pushto") },
+ { _T("qu"), LPGENT("Quechua") },
+ { _T("rm"), LPGENT("Romansh") },
+ { _T("ro"), LPGENT("Romanian") },
+ { _T("rn"), LPGENT("Rundi") },
+ { _T("ru"), LPGENT("Russian") },
+ { _T("sg"), LPGENT("Sango") },
+ { _T("sa"), LPGENT("Sanskrit") },
+ { _T("sr"), LPGENT("Serbian") },
+ { _T("hr"), LPGENT("Croatian") },
+ { _T("si"), LPGENT("Sinhala; Sinhalese") },
+ { _T("sk"), LPGENT("Slovak") },
+ { _T("sl"), LPGENT("Slovenian") },
+ { _T("se"), LPGENT("Northern Sami") },
+ { _T("sm"), LPGENT("Samoan") },
+ { _T("sn"), LPGENT("Shona") },
+ { _T("sd"), LPGENT("Sindhi") },
+ { _T("so"), LPGENT("Somali") },
+ { _T("st"), LPGENT("Sotho, Southern") },
+ { _T("es"), LPGENT("Spanish; Castilian") },
+ { _T("sc"), LPGENT("Sardinian") },
+ { _T("ss"), LPGENT("Swati") },
+ { _T("su"), LPGENT("Sundanese") },
+ { _T("sw"), LPGENT("Swahili") },
+ { _T("sv"), LPGENT("Swedish") },
+ { _T("ty"), LPGENT("Tahitian") },
+ { _T("ta"), LPGENT("Tamil") },
+ { _T("tt"), LPGENT("Tatar") },
+ { _T("te"), LPGENT("Telugu") },
+ { _T("tg"), LPGENT("Tajik") },
+ { _T("tl"), LPGENT("Tagalog") },
+ { _T("th"), LPGENT("Thai") },
+ { _T("bo"), LPGENT("Tibetan") },
+ { _T("ti"), LPGENT("Tigrinya") },
+ { _T("to"), LPGENT("Tonga (Tonga Islands)") },
+ { _T("tn"), LPGENT("Tswana") },
+ { _T("ts"), LPGENT("Tsonga") },
+ { _T("tk"), LPGENT("Turkmen") },
+ { _T("tr"), LPGENT("Turkish") },
+ { _T("tw"), LPGENT("Twi") },
+ { _T("ug"), LPGENT("Uighur; Uyghur") },
+ { _T("uk"), LPGENT("Ukrainian") },
+ { _T("ur"), LPGENT("Urdu") },
+ { _T("uz"), LPGENT("Uzbek") },
+ { _T("ve"), LPGENT("Venda") },
+ { _T("vi"), LPGENT("Vietnamese") },
+ { _T("vo"), LPGENT("Volapuk") },
+ { _T("cy"), LPGENT("Welsh") },
+ { _T("wa"), LPGENT("Walloon") },
+ { _T("wo"), LPGENT("Wolof") },
+ { _T("xh"), LPGENT("Xhosa") },
+ { _T("yi"), LPGENT("Yiddish") },
+ { _T("yo"), LPGENT("Yoruba") },
+ { _T("za"), LPGENT("Zhuang; Chuang") },
+ { _T("zu"), LPGENT("Zulu") },
+ { NULL, NULL }
+};
+
void CSkypeProto::UpdateProfileFirstName(JSONNODE *root, MCONTACT hContact)
{
JSONNODE *node = json_get(root, "firstname");
@@ -94,10 +283,15 @@ void CSkypeProto::UpdateProfileCity(JSONNODE *root, MCONTACT hContact) void CSkypeProto::UpdateProfileLanguage(JSONNODE *root, MCONTACT hContact)
{
JSONNODE *node = json_get(root, "language");
- CMStringA isocode = mir_t2a(ptrT(json_as_string(node)));
+ CMString isocode = ptrT(json_as_string(node));
if (!isocode.IsEmpty() && isocode != "null")
{
- // convert language code to language name
+ for (int i = 0; g_LanguageCodes[i].szCode; i++) {
+ if (!_tcscmp(isocode, g_LanguageCodes[i].szCode)) {
+ setTString(hContact, "Language0", g_LanguageCodes[i].szDescription);
+ break;
+ }
+ }
}
else
delSetting(hContact, "Language0");
|