diff --git a/data/localized_name.txt b/data/localized_name.txt new file mode 100644 index 000000000..2f256e364 --- /dev/null +++ b/data/localized_name.txt @@ -0,0 +1,231 @@ +aa=ʿAfár af +af=Afrikaans +af_ZA=0 +am=ኣማርኛ +ar=العربية +ar_AR=0 +ar_OM=0 +ar_SA=0 +ar_SY=0 +ar_TN=0 +as=অসমীয়া +ast=Asturianu +ay=aymar aru +az=Azərbaycanca +az_IR=0 +be=Беларуская мова +bg=български +bg_BG=0 +bn=বাংলা +bn_BD=0 +bn_IN=0 +bo=བོད་སྐད་ +br=brezhoneg +bs=Bosanski +bs_BA=0 +bs_BS=0 +ca_ES=0 +ca=0 +cmn=0 +co=corsu +cs=Čeština +cs_CZ=Čeština (Česká Republika) +cy=Welsh +cy_GB=Welsh (Great Britain) +cz=Unknown language +da=Dansk +da_DK=Dansk (Danmark) +de=Deutsch +de_AT= Deutsch (Österreich) +de_CH=Deutsch (Schweiz) +de_DE=Deutsch (Deutschland) +dk=Unknown language +dz=རྫོང་ཁ +el=ελληνικά +el_GR=0 +en=English +en_AU=English (Australia) +en_CA=English (Canada) +en_GB=English (Great Britain) +en_US=English (United States) +en_ZA=English (South Africa) +en_US=English +eo=Esperanto +es=Español +es_AR=0 +es_CL=0 +es_CO=0 +es_CR=0 +es_DO=0 +es_EC=0 +es_ES=0 +es_GT=0 +es_HN=0 +es_LA=0 +es_MX=0 +es_NI=0 +es_PA=0 +es_PE=0 +es_PR=0 +es_SV=0 +es_UY=0 +es_VE=0 +et=eesti keel +et_EE=0 +et_ET=0 +eu=euskara +eu_ES=0 +fa=فارسى +fa_AF=0 +fa_IR=0 +fi=suomi +fi_FI=0 +fo=Føroyskt +fo_FO=0 +fr=Français +fr_CA=Français (Canada) +fr_CH=Français (Suisse) +fr_FR=Français (France) +fr_LU=Français (Luxembourg) +fy=Frysk +ga=Gaeilge +gd=Gàidhlig +gl=Galego +gl_ES=0 +gn=Avañe'ẽ +gu=ગુજરાતી +gv=Gaelg +ha=حَوْسَ +he=עברית +he_IL=0 +hi=हिन्दी +hr=Hrvatski +hr_HR=0 +hu=magyar +hu_HU=0 +hy=Հայերեն +ia=Interlingua +id=Bahasa Indonesia +id_ID=0 +is=Íslenska +is_IS=0 +it=Italiano +it_CH=0 +it_IT=0 +iu=ᐃᓄᒃᑎᑐᑦ/inuktitut +ja=日本語 +ja_JP=0 +ka=ქართული +kk=Қазақша +kl=Kalaallisut +km=ភាសាខ្មែរ +km_KH=0 +kn=ಕನ್ನಡ +ko=한국어 +ko_KR=0 +ku=Kurdî +kw=Kernowek +ky=кыргызча +la=Latina +lo=ລາວ +lt=Lietuvių +lt=0 +lv=Latviešu +lv_LV=0 +jbo=La .lojban. +mg=Malagasy +mi=Māori +mk=Македонски +mk_MK=0 +ml=മലയാളം +mn=Монгол +mr=मराठी +ms=Bahasa Melayu +ms_MY=0 +mt=Malti +my=မြန်မာဘာသာ +my_MM=0 +nb=0 +nb_NO=0 +ne=0 +nl=Nederlands +nl_BE=0 +nl_NL=0 +nn=Norsk nynorsk +nn_NO=0 +no=Norsk bokmål +no_NO=0 +no_NY=0 +nr=0 +oc=Occitan +om=Oromoo +or=ଓଡ଼ିଆ +os=0 +pa=ਪੰਜਾਬੀ +pl=Polski +pl_PL=0 +ps=پښتو +pt=Português +pt_BR=0 +pt_PT=0 +qu=Runa Simi +rm=Rumantsch +ro=Română +ro_RO=0 +ru=Русский +ru_RU=0 +rw=Kinyarwanda +sa=0 +sd=0 +se=Sámegiella +se_NO=0 +si=0 +sk=Slovenčina +sk_SK=0 +sl=Slovenščina +sl_SI=0 +sl_SL=0 +sm=0 +so=0 +sp=0 +sq=Shqip +sq_AL=0 +sr=Српски +sr_YU=0 +ss=0 +st=0 +sv=Svenska +sv_SE=0 +sv_SV=0 +sw=0 +ta=தமிழ் +te=0 +tg=0 +th=ไทย +th_TH=0 +ti=0 +tk=0 +tl=0 +to=0 +tr=Türkçe +tr_TR=0 +ts=0 +tt=Татарча +ug=0 +uk=Українська +uk_UA=0 +ur=اردو +ur_PK=0 +uz=0 +vi=Tiếng Việt +vi_VN=0 +wa=0 +wo=0 +xh=0 +yi=ייִדיש +yo=0 +zh=中文 +zh_CN=中文(简体) +zh_HK=中文(香港) +zh_TW=中文(繁體) +zu=0 diff --git a/src/states_screens/options_screen_ui.cpp b/src/states_screens/options_screen_ui.cpp index 0e37693cb..39d42afef 100644 --- a/src/states_screens/options_screen_ui.cpp +++ b/src/states_screens/options_screen_ui.cpp @@ -197,7 +197,7 @@ void OptionsScreenUI::init() for (int n=0; ngetLocalizedName(code_name) + " (" + tinygettext::Language::from_name(code_name).get_language() + ")"; core::stringw nice_name = translations->fribidize(StringUtils::utf8ToWide(s_name)); nice_lang_list.push_back(nice_name); diff --git a/src/tinygettext/language.cpp b/src/tinygettext/language.cpp index 99024d9b8..aefed84b7 100644 --- a/src/tinygettext/language.cpp +++ b/src/tinygettext/language.cpp @@ -38,254 +38,251 @@ struct LanguageSpec { /** Language name: "German", "English", "French", ... */ const char* name; - - /** Language name in the specified language */ - const char* name_localized; }; /** Language Definitions */ //*{ static const LanguageSpec languages[] = { - { "aa", 0, 0, "Afar" , "ʿAfár af" }, - { "af", 0, 0, "Afrikaans" , "Afrikaans" }, - { "af", "ZA", 0, "Afrikaans (South Africa)" , 0 }, - { "am", 0, 0, "Amharic" , "ኣማርኛ" }, - { "ar", 0, 0, "Arabic" , "العربية" }, - { "ar", "AR", 0, "Arabic (Argentina)" , 0 }, - { "ar", "OM", 0, "Arabic (Oman)" , 0 }, - { "ar", "SA", 0, "Arabic (Saudi Arabia)" , 0 }, - { "ar", "SY", 0, "Arabic (Syrian Arab Republic)", 0 }, - { "ar", "TN", 0, "Arabic (Tunisia)" , 0 }, - { "as", 0, 0, "Assamese" , "অসমীয়া" }, - { "ast",0, 0, "Asturian" , "Asturianu" }, - { "ay", 0, 0, "Aymara" , "aymar aru" }, - { "az", 0, 0, "Azerbaijani" , "Azərbaycanca" }, - { "az", "IR", 0, "Azerbaijani (Iran)" , 0 }, - { "be", 0, 0, "Belarusian" , "Беларуская мова" }, - { "be", 0, "latin", "Belarusian" , "Беларуская мова" }, - { "bg", 0, 0, "Bulgarian" , "български" }, - { "bg", "BG", 0, "Bulgarian (Bulgaria)" , 0 }, - { "bn", 0, 0, "Bengali" , "বাংলা" }, - { "bn", "BD", 0, "Bengali (Bangladesh)" , 0 }, - { "bn", "IN", 0, "Bengali (India)" , 0 }, - { "bo", 0, 0, "Tibetan" , "བོད་སྐད་" }, - { "br", 0, 0, "Breton" , "brezhoneg" }, - { "bs", 0, 0, "Bosnian" , "Bosanski" }, - { "bs", "BA", 0, "Bosnian (Bosnia/Herzegovina)", 0 }, - { "bs", "BS", 0, "Bosnian (Bahamas)" , 0 }, - { "ca", "ES", "valencia", "Catalan (valencia)" , 0 }, - { "ca", "ES", 0, "Catalan (Spain)" , 0 }, - { "ca", 0, "valencia", "Catalan (valencia)" , 0 }, - { "ca", 0, 0, "Catalan" , 0 }, - { "cmn", 0, 0, "Mandarin" , 0 }, - { "co", 0, 0, "Corsican" , "corsu" }, - { "cs", 0, 0, "Czech" , "Čeština" }, - { "cs", "CZ", 0, "Czech (Czech Republic)" , "Čeština (Česká Republika)"}, - { "cy", 0, 0, "Welsh" , "Welsh" }, - { "cy", "GB", 0, "Welsh (Great Britain)" , "Welsh (Great Britain)" }, - { "cz", 0, 0, "Unknown language" , "Unknown language" }, - { "da", 0, 0, "Danish" , "Dansk" }, - { "da", "DK", 0, "Danish (Denmark)" , "Dansk (Danmark)" }, - { "de", 0, 0, "German" , "Deutsch" }, - { "de", "AT", 0, "German (Austria)" , "Deutsch (Österreich)" }, - { "de", "CH", 0, "German (Switzerland)" , "Deutsch (Schweiz)" }, - { "de", "DE", 0, "German (Germany)" , "Deutsch (Deutschland)" }, - { "dk", 0, 0, "Unknown language" , "Unknown language" }, - { "dz", 0, 0, "Dzongkha" , "རྫོང་ཁ" }, - { "el", 0, 0, "Greek" , "ελληνικά" }, - { "el", "GR", 0, "Greek (Greece)" , 0 }, - { "en", 0, 0, "English" , "English" }, - { "en", "AU", 0, "English (Australia)" , "English (Australia)" }, - { "en", "CA", 0, "English (Canada)" , "English (Canada)" }, - { "en", "GB", 0, "English (Great Britain)" , "English (Great Britain)" }, - { "en", "US", 0, "English (United States)" , "English (United States)" }, - { "en", "ZA", 0, "English (South Africa)" , "English (South Africa)" }, - { "en", 0, "boldquot", "English" , "English" }, - { "en", 0, "quot", "English" , "English" }, - { "en", "US", "piglatin", "English" , "English" }, - { "eo", 0, 0, "Esperanto" , "Esperanto" }, - { "es", 0, 0, "Spanish" , "Español" }, - { "es", "AR", 0, "Spanish (Argentina)" , 0 }, - { "es", "CL", 0, "Spanish (Chile)" , 0 }, - { "es", "CO", 0, "Spanish (Colombia)" , 0 }, - { "es", "CR", 0, "Spanish (Costa Rica)" , 0 }, - { "es", "DO", 0, "Spanish (Dominican Republic)", 0 }, - { "es", "EC", 0, "Spanish (Ecuador)" , 0 }, - { "es", "ES", 0, "Spanish (Spain)" , 0 }, - { "es", "GT", 0, "Spanish (Guatemala)" , 0 }, - { "es", "HN", 0, "Spanish (Honduras)" , 0 }, - { "es", "LA", 0, "Spanish (Laos)" , 0 }, - { "es", "MX", 0, "Spanish (Mexico)" , 0 }, - { "es", "NI", 0, "Spanish (Nicaragua)" , 0 }, - { "es", "PA", 0, "Spanish (Panama)" , 0 }, - { "es", "PE", 0, "Spanish (Peru)" , 0 }, - { "es", "PR", 0, "Spanish (Puerto Rico)" , 0 }, - { "es", "SV", 0, "Spanish (El Salvador)" , 0 }, - { "es", "UY", 0, "Spanish (Uruguay)" , 0 }, - { "es", "VE", 0, "Spanish (Venezuela)" , 0 }, - { "et", 0, 0, "Estonian" , "eesti keel" }, - { "et", "EE", 0, "Estonian (Estonia)" , 0 }, - { "et", "ET", 0, "Estonian (Ethiopia)" , 0 }, - { "eu", 0, 0, "Basque" , "euskara" }, - { "eu", "ES", 0, "Basque (Spain)" , 0 }, - { "fa", 0, 0, "Persian" , "فارسى" }, - { "fa", "AF", 0, "Persian (Afghanistan)" , 0 }, - { "fa", "IR", 0, "Persian (Iran)" , 0 }, - { "fi", 0, 0, "Finnish" , "suomi" }, - { "fi", "FI", 0, "Finnish (Finland)" , 0 }, - { "fo", 0, 0, "Faroese" , "Føroyskt" }, - { "fo", "FO", 0, "Faeroese (Faroe Islands)" , 0 }, - { "fr", 0, 0, "French" , "Français" }, - { "fr", "CA", 0, "French (Canada)" , "Français (Canada)" }, - { "fr", "CH", 0, "French (Switzerland)" , "Français (Suisse)" }, - { "fr", "FR", 0, "French (France)" , "Français (France)" }, - { "fr", "LU", 0, "French (Luxembourg)" , "Français (Luxembourg)" }, - { "fy", 0, 0, "Frisian" , "Frysk" }, - { "ga", 0, 0, "Irish" , "Gaeilge" }, - { "gd", 0, 0, "Gaelic Scots" , "Gàidhlig" }, - { "gl", 0, 0, "Galician" , "Galego" }, - { "gl", "ES", 0, "Galician (Spain)" , 0 }, - { "gn", 0, 0, "Guarani" , "Avañe'ẽ" }, - { "gu", 0, 0, "Gujarati" , "ગુજરાતી" }, - { "gv", 0, 0, "Manx" , "Gaelg" }, - { "ha", 0, 0, "Hausa" , "حَوْسَ" }, - { "he", 0, 0, "Hebrew" , "עברית" }, - { "he", "IL", 0, "Hebrew (Israel)" , 0 }, - { "hi", 0, 0, "Hindi" , "हिन्दी" }, - { "hr", 0, 0, "Croatian" , "Hrvatski" }, - { "hr", "HR", 0, "Croatian (Croatia)" , 0 }, - { "hu", 0, 0, "Hungarian" , "magyar" }, - { "hu", "HU", 0, "Hungarian (Hungary)" , 0 }, - { "hy", 0, 0, "Armenian" , "Հայերեն" }, - { "ia", 0, 0, "Interlingua" , "Interlingua" }, - { "id", 0, 0, "Indonesian" , "Bahasa Indonesia" }, - { "id", "ID", 0, "Indonesian (Indonesia)" , 0 }, - { "is", 0, 0, "Icelandic" , "Íslenska" }, - { "is", "IS", 0, "Icelandic (Iceland)" , 0 }, - { "it", 0, 0, "Italian" , "Italiano" }, - { "it", "CH", 0, "Italian (Switzerland)" , 0 }, - { "it", "IT", 0, "Italian (Italy)" , 0 }, - { "iu", 0, 0, "Inuktitut" , "ᐃᓄᒃᑎᑐᑦ/inuktitut" }, - { "ja", 0, 0, "Japanese" , "日本語" }, - { "ja", "JP", 0, "Japanese (Japan)" , 0 }, - { "ka", 0, 0, "Georgian" , "ქართული" }, - { "kk", 0, 0, "Kazakh" , "Қазақша" }, - { "kl", 0, 0, "Kalaallisut" , "Kalaallisut" }, - { "km", 0, 0, "Khmer" , "ភាសាខ្មែរ" }, - { "km", "KH", 0, "Khmer (Cambodia)" , 0 }, - { "kn", 0, 0, "Kannada" , "ಕನ್ನಡ" }, - { "ko", 0, 0, "Korean" , "한국어" }, - { "ko", "KR", 0, "Korean (Korea)" , 0 }, - { "ku", 0, 0, "Kurdish" , "Kurdî" }, - { "kw", 0, 0, "Cornish" , "Kernowek" }, - { "ky", 0, 0, "Kirghiz" , 0 }, - { "la", 0, 0, "Latin" , "Latina" }, - { "lo", 0, 0, "Lao" , "ລາວ" }, - { "lt", 0, 0, "Lithuanian" , "Lietuvių" }, - { "lt", "LT", 0, "Lithuanian (Lithuania)" , 0 }, - { "lv", 0, 0, "Latvian" , "Latviešu" }, - { "lv", "LV", 0, "Latvian (Latvia)" , 0 }, - { "jbo", 0, 0, "Lojban" , "La .lojban." }, - { "mg", 0, 0, "Malagasy" , "Malagasy" }, - { "mi", 0, 0, "Maori" , "Māori" }, - { "mk", 0, 0, "Macedonian" , "Македонски" }, - { "mk", "MK", 0, "Macedonian (Macedonia)" , 0 }, - { "ml", 0, 0, "Malayalam" , "മലയാളം" }, - { "mn", 0, 0, "Mongolian" , "Монгол" }, - { "mr", 0, 0, "Marathi" , "मराठी" }, - { "ms", 0, 0, "Malay" , "Bahasa Melayu" }, - { "ms", "MY", 0, "Malay (Malaysia)" , 0 }, - { "mt", 0, 0, "Maltese" , "Malti" }, - { "my", 0, 0, "Burmese" , "မြန်မာဘာသာ" }, - { "my", "MM", 0, "Burmese (Myanmar)" , 0 }, - { "nb", 0, 0, "Norwegian Bokmal" , 0 }, - { "nb", "NO", 0, "Norwegian Bokmål (Norway)" , 0 }, - { "ne", 0, 0, "Nepali" , 0 }, - { "nl", 0, 0, "Dutch" , "Nederlands" }, - { "nl", "BE", 0, "Dutch (Belgium)" , 0 }, - { "nl", "NL", 0, "Dutch (Netherlands)" , 0 }, - { "nn", 0, 0, "Norwegian Nynorsk" , "Norsk nynorsk" }, - { "nn", "NO", 0, "Norwegian Nynorsk (Norway)" , 0 }, - { "no", 0, 0, "Norwegian" , "Norsk bokmål" }, - { "no", "NO", 0, "Norwegian (Norway)" , 0 }, - { "no", "NY", 0, "Norwegian (NY)" , 0 }, - { "nr", 0, 0, "Ndebele, South" , 0 }, - { "oc", 0, 0, "Occitan post 1500" , "Occitan" }, - { "om", 0, 0, "Oromo" , "Oromoo" }, - { "or", 0, 0, "Oriya" , "ଓଡ଼ିଆ" }, - { "pa", 0, 0, "Punjabi" , "ਪੰਜਾਬੀ" }, - { "pl", 0, 0, "Polish" , "Polski" }, - { "pl", "PL", 0, "Polish (Poland)" , 0 }, - { "ps", 0, 0, "Pashto" , "پښتو" }, - { "pt", 0, 0, "Portuguese" , "Português" }, - { "pt", "BR", 0, "Portuguese (Brazil)" , 0 }, - { "pt", "PT", 0, "Portuguese (Portugal)" , 0 }, - { "qu", 0, 0, "Quechua" , "Runa Simi" }, - { "rm", 0, 0, "Rhaeto-Romance" , "Rumantsch" }, - { "ro", 0, 0, "Romanian" , "Română" }, - { "ro", "RO", 0, "Romanian (Romania)" , 0 }, - { "ru", 0, 0, "Russian" ,"Русский" }, - { "ru", "RU", 0, "Russian (Russia" , 0 }, - { "rw", 0, 0, "Kinyarwanda" , "Kinyarwanda" }, - { "sa", 0, 0, "Sanskrit" , 0 }, - { "sd", 0, 0, "Sindhi" , 0 }, - { "se", 0, 0, "Sami" , "Sámegiella" }, - { "se", "NO", 0, "Sami (Norway)" , 0 }, - { "si", 0, 0, "Sinhalese" , 0 }, - { "sk", 0, 0, "Slovak" , "Slovenčina" }, - { "sk", "SK", 0, "Slovak (Slovakia)" , 0 }, - { "sl", 0, 0, "Slovenian" , "Slovenščina" }, - { "sl", "SI", 0, "Slovenian (Slovenia)" , 0 }, - { "sl", "SL", 0, "Slovenian (Sierra Leone)" , 0 }, - { "sm", 0, 0, "Samoan" , 0 }, - { "so", 0, 0, "Somali" , 0 }, - { "sp", 0, 0, "Unknown language" , 0 }, - { "sq", 0, 0, "Albanian" , "Shqip" }, - { "sq", "AL", 0, "Albanian (Albania)" , 0 }, - { "sr", 0, 0, "Serbian" , "Српски / srpski" }, - { "sr", "YU", 0, "Serbian (Yugoslavia)" , 0 }, - { "sr", 0,"ije", "Serbian" , 0 }, - { "sr", 0, "latin", "Serbian" , 0 }, - { "sr", 0, "Latn", "Serbian" , 0 }, - { "ss", 0, 0, "Swati" , 0 }, - { "st", 0, 0, "Sotho" , 0 }, - { "sv", 0, 0, "Swedish" , "Svenska" }, - { "sv", "SE", 0, "Swedish (Sweden)" , 0 }, - { "sv", "SV", 0, "Swedish (El Salvador)" , 0 }, - { "sw", 0, 0, "Swahili" , 0 }, - { "ta", 0, 0, "Tamil" , 0 }, - { "te", 0, 0, "Telugu" , 0 }, - { "tg", 0, 0, "Tajik" , 0 }, - { "th", 0, 0, "Thai" , "ไทย" }, - { "th", "TH", 0, "Thai (Thailand)" , 0 }, - { "ti", 0, 0, "Tigrinya" , 0 }, - { "tk", 0, 0, "Turkmen" , 0 }, - { "tl", 0, 0, "Tagalog" , 0 }, - { "to", 0, 0, "Tonga" , 0 }, - { "tr", 0, 0, "Turkish" , "Türkçe" }, - { "tr", "TR", 0, "Turkish (Turkey)" , 0 }, - { "ts", 0, 0, "Tsonga" , 0 }, - { "tt", 0, 0, "Tatar" , 0 }, - { "ug", 0, 0, "Uighur" , 0 }, - { "uk", 0, 0, "Ukrainian" , "Українська" }, - { "uk", "UA", 0, "Ukrainian (Ukraine)" , 0 }, - { "ur", 0, 0, "Urdu" , 0 }, - { "ur", "PK", 0, "Urdu (Pakistan)" , 0 }, - { "uz", 0, 0, "Uzbek" , 0 }, - { "uz", 0, "cyrillic", "Uzbek" , 0 }, - { "vi", 0, 0, "Vietnamese" , "Tiếng Việt" }, - { "vi", "VN", 0, "Vietnamese (Vietnam)" , 0 }, - { "wa", 0, 0, "Walloon" , 0 }, - { "wo", 0, 0, "Wolof" , 0 }, - { "xh", 0, 0, "Xhosa" , 0 }, - { "yi", 0, 0, "Yiddish" , "ייִדיש" }, - { "yo", 0, 0, "Yoruba" , 0 }, - { "zh", 0, 0, "Chinese" , "中文" }, - { "zh", "CN", 0, "Chinese (simplified)" , "中文(简体)" }, - { "zh", "HK", 0, "Chinese (Hong Kong)" , "中文(香港)" }, - { "zh", "TW", 0, "Chinese (traditional)" , "中文(繁體)" }, - { "zu", 0, 0, "Zulu" , 0 }, - { NULL, 0, 0, NULL , 0 } + { "aa", 0, 0, "Afar" }, + { "af", 0, 0, "Afrikaans" }, + { "af", "ZA", 0, "Afrikaans (South Africa)" }, + { "am", 0, 0, "Amharic" }, + { "ar", 0, 0, "Arabic" }, + { "ar", "AR", 0, "Arabic (Argentina)" }, + { "ar", "OM", 0, "Arabic (Oman)" }, + { "ar", "SA", 0, "Arabic (Saudi Arabia)" }, + { "ar", "SY", 0, "Arabic (Syrian Arab Republic)" }, + { "ar", "TN", 0, "Arabic (Tunisia)" }, + { "as", 0, 0, "Assamese" }, + { "ast",0, 0, "Asturian" }, + { "ay", 0, 0, "Aymara" }, + { "az", 0, 0, "Azerbaijani" }, + { "az", "IR", 0, "Azerbaijani (Iran)" }, + { "be", 0, 0, "Belarusian" }, + { "be", 0, "latin", "Belarusian" }, + { "bg", 0, 0, "Bulgarian" }, + { "bg", "BG", 0, "Bulgarian (Bulgaria)" }, + { "bn", 0, 0, "Bengali" }, + { "bn", "BD", 0, "Bengali (Bangladesh)" }, + { "bn", "IN", 0, "Bengali (India)" }, + { "bo", 0, 0, "Tibetan" }, + { "br", 0, 0, "Breton" }, + { "bs", 0, 0, "Bosnian" }, + { "bs", "BA", 0, "Bosnian (Bosnia/Herzegovina)"}, + { "bs", "BS", 0, "Bosnian (Bahamas)" }, + { "ca", "ES", "valencia", "Catalan (valencia)" }, + { "ca", "ES", 0, "Catalan (Spain)" }, + { "ca", 0, "valencia", "Catalan (valencia)" }, + { "ca", 0, 0, "Catalan" }, + { "co", 0, 0, "Corsican" }, + { "cs", 0, 0, "Czech" }, + { "cs", "CZ", 0, "Czech (Czech Republic)" }, + { "cy", 0, 0, "Welsh" }, + { "cy", "GB", 0, "Welsh (Great Britain)" }, + { "cz", 0, 0, "Unknown language" }, + { "da", 0, 0, "Danish" }, + { "da", "DK", 0, "Danish (Denmark)" }, + { "de", 0, 0, "German" }, + { "de", "AT", 0, "German (Austria)" }, + { "de", "CH", 0, "German (Switzerland)" }, + { "de", "DE", 0, "German (Germany)" }, + { "dk", 0, 0, "Unknown language" }, + { "dz", 0, 0, "Dzongkha" }, + { "el", 0, 0, "Greek" }, + { "el", "GR", 0, "Greek (Greece)" }, + { "en", 0, 0, "English" }, + { "en", "AU", 0, "English (Australia)" }, + { "en", "CA", 0, "English (Canada)" }, + { "en", "GB", 0, "English (Great Britain)" }, + { "en", "US", 0, "English (United States)" }, + { "en", "ZA", 0, "English (South Africa)" }, + { "en", 0, "boldquot", "English" }, + { "en", 0, "quot", "English" }, + { "en", "US", "piglatin", "English" }, + { "eo", 0, 0, "Esperanto" }, + { "es", 0, 0, "Spanish" }, + { "es", "AR", 0, "Spanish (Argentina)" }, + { "es", "CL", 0, "Spanish (Chile)" }, + { "es", "CO", 0, "Spanish (Colombia)" }, + { "es", "CR", 0, "Spanish (Costa Rica)" }, + { "es", "DO", 0, "Spanish (Dominican Republic)"}, + { "es", "EC", 0, "Spanish (Ecuador)" }, + { "es", "ES", 0, "Spanish (Spain)" }, + { "es", "GT", 0, "Spanish (Guatemala)" }, + { "es", "HN", 0, "Spanish (Honduras)" }, + { "es", "LA", 0, "Spanish (Laos)" }, + { "es", "MX", 0, "Spanish (Mexico)" }, + { "es", "NI", 0, "Spanish (Nicaragua)" }, + { "es", "PA", 0, "Spanish (Panama)" }, + { "es", "PE", 0, "Spanish (Peru)" }, + { "es", "PR", 0, "Spanish (Puerto Rico)" }, + { "es", "SV", 0, "Spanish (El Salvador)" }, + { "es", "UY", 0, "Spanish (Uruguay)" }, + { "es", "VE", 0, "Spanish (Venezuela)" }, + { "et", 0, 0, "Estonian" }, + { "et", "EE", 0, "Estonian (Estonia)" }, + { "et", "ET", 0, "Estonian (Ethiopia)" }, + { "eu", 0, 0, "Basque" }, + { "eu", "ES", 0, "Basque (Spain)" }, + { "fa", 0, 0, "Persian" }, + { "fa", "AF", 0, "Persian (Afghanistan)" }, + { "fa", "IR", 0, "Persian (Iran)" }, + { "fi", 0, 0, "Finnish" }, + { "fi", "FI", 0, "Finnish (Finland)" }, + { "fo", 0, 0, "Faroese" }, + { "fo", "FO", 0, "Faeroese (Faroe Islands)" }, + { "fr", 0, 0, "French" }, + { "fr", "CA", 0, "French (Canada)" }, + { "fr", "CH", 0, "French (Switzerland)" }, + { "fr", "FR", 0, "French (France)" }, + { "fr", "LU", 0, "French (Luxembourg)" }, + { "fy", 0, 0, "Frisian" }, + { "ga", 0, 0, "Irish" }, + { "gd", 0, 0, "Gaelic Scots" }, + { "gl", 0, 0, "Galician" }, + { "gl", "ES", 0, "Galician (Spain)" }, + { "gn", 0, 0, "Guarani" }, + { "gu", 0, 0, "Gujarati" }, + { "gv", 0, 0, "Manx" }, + { "ha", 0, 0, "Hausa" }, + { "he", 0, 0, "Hebrew" }, + { "he", "IL", 0, "Hebrew (Israel)" }, + { "hi", 0, 0, "Hindi" }, + { "hr", 0, 0, "Croatian" }, + { "hr", "HR", 0, "Croatian (Croatia)" }, + { "hu", 0, 0, "Hungarian" }, + { "hu", "HU", 0, "Hungarian (Hungary)" }, + { "hy", 0, 0, "Armenian" }, + { "ia", 0, 0, "Interlingua" }, + { "id", 0, 0, "Indonesian" }, + { "id", "ID", 0, "Indonesian (Indonesia)" }, + { "is", 0, 0, "Icelandic" }, + { "is", "IS", 0, "Icelandic (Iceland)" }, + { "it", 0, 0, "Italian" }, + { "it", "CH", 0, "Italian (Switzerland)" }, + { "it", "IT", 0, "Italian (Italy)" }, + { "iu", 0, 0, "Inuktitut" }, + { "ja", 0, 0, "Japanese" }, + { "ja", "JP", 0, "Japanese (Japan)" }, + { "ka", 0, 0, "Georgian" }, + { "kk", 0, 0, "Kazakh" }, + { "kl", 0, 0, "Kalaallisut" }, + { "km", 0, 0, "Khmer" }, + { "km", "KH", 0, "Khmer (Cambodia)" }, + { "kn", 0, 0, "Kannada" }, + { "ko", 0, 0, "Korean" }, + { "ko", "KR", 0, "Korean (Korea)" }, + { "ku", 0, 0, "Kurdish" }, + { "kw", 0, 0, "Cornish" }, + { "ky", 0, 0, "Kirghiz" }, + { "la", 0, 0, "Latin" }, + { "lo", 0, 0, "Lao" }, + { "lt", 0, 0, "Lithuanian" }, + { "lt", "LT", 0, "Lithuanian (Lithuania)" }, + { "lv", 0, 0, "Latvian" }, + { "lv", "LV", 0, "Latvian (Latvia)" }, + { "mg", 0, 0, "Malagasy" }, + { "mi", 0, 0, "Maori" }, + { "mk", 0, 0, "Macedonian" }, + { "mk", "MK", 0, "Macedonian (Macedonia)" }, + { "ml", 0, 0, "Malayalam" }, + { "mn", 0, 0, "Mongolian" }, + { "mr", 0, 0, "Marathi" }, + { "ms", 0, 0, "Malay" }, + { "ms", "MY", 0, "Malay (Malaysia)" }, + { "mt", 0, 0, "Maltese" }, + { "my", 0, 0, "Burmese" }, + { "my", "MM", 0, "Burmese (Myanmar)" }, + { "nb", 0, 0, "Norwegian Bokmal" }, + { "nb", "NO", 0, "Norwegian Bokmål (Norway)" }, + { "ne", 0, 0, "Nepali" }, + { "nl", 0, 0, "Dutch" }, + { "nl", "BE", 0, "Dutch (Belgium)" }, + { "nl", "NL", 0, "Dutch (Netherlands)" }, + { "nn", 0, 0, "Norwegian Nynorsk" }, + { "nn", "NO", 0, "Norwegian Nynorsk (Norway)" }, + // DEPRECATED + //{ "no", 0, 0, "Norwegian" }, + //{ "no", "NO", 0, "Norwegian (Norway)" }, + //{ "no", "NY", 0, "Norwegian (NY)" }, + { "nr", 0, 0, "Ndebele, South" }, + { "oc", 0, 0, "Occitan post 1500" }, + { "om", 0, 0, "Oromo" }, + { "or", 0, 0, "Oriya" }, + { "os", 0, 0, "Ossetian" }, + { "pa", 0, 0, "Punjabi" }, + { "pl", 0, 0, "Polish" }, + { "pl", "PL", 0, "Polish (Poland)" }, + { "ps", 0, 0, "Pashto" }, + { "pt", 0, 0, "Portuguese" }, + { "pt", "BR", 0, "Portuguese (Brazil)" }, + { "pt", "PT", 0, "Portuguese (Portugal)" }, + { "qu", 0, 0, "Quechua" }, + { "rm", 0, 0, "Rhaeto-Romance" }, + { "ro", 0, 0, "Romanian" }, + { "ro", "RO", 0, "Romanian (Romania)" }, + { "ru", 0, 0, "Russian" }, + { "ru", "RU", 0, "Russian (Russia" }, + { "rw", 0, 0, "Kinyarwanda" }, + { "sa", 0, 0, "Sanskrit" }, + { "sd", 0, 0, "Sindhi" }, + { "se", 0, 0, "Sami" }, + { "se", "NO", 0, "Sami (Norway)" }, + { "si", 0, 0, "Sinhalese" }, + { "sk", 0, 0, "Slovak" }, + { "sk", "SK", 0, "Slovak (Slovakia)" }, + { "sl", 0, 0, "Slovenian" }, + { "sl", "SI", 0, "Slovenian (Slovenia)" }, + { "sl", "SL", 0, "Slovenian (Sierra Leone)" }, + { "sm", 0, 0, "Samoan" }, + { "so", 0, 0, "Somali" }, + { "sp", 0, 0, "Unknown language" }, + { "sq", 0, 0, "Albanian" }, + { "sq", "AL", 0, "Albanian (Albania)" }, + { "sr", 0, 0, "Serbian" }, + { "sr", "YU", 0, "Serbian (Yugoslavia)" }, + { "sr", 0,"ije", "Serbian" }, + { "sr", 0, "latin", "Serbian" }, + { "sr", 0, "Latn", "Serbian" }, + { "ss", 0, 0, "Swati" }, + { "st", 0, 0, "Sotho" }, + { "sv", 0, 0, "Swedish" }, + { "sv", "SE", 0, "Swedish (Sweden)" }, + { "sv", "SV", 0, "Swedish (El Salvador)" }, + { "sw", 0, 0, "Swahili" }, + { "ta", 0, 0, "Tamil" }, + { "te", 0, 0, "Telugu" }, + { "tg", 0, 0, "Tajik" }, + { "th", 0, 0, "Thai" }, + { "th", "TH", 0, "Thai (Thailand)" }, + { "ti", 0, 0, "Tigrinya" }, + { "tk", 0, 0, "Turkmen" }, + { "tl", 0, 0, "Tagalog" }, + { "to", 0, 0, "Tonga" }, + { "tr", 0, 0, "Turkish" }, + { "tr", "TR", 0, "Turkish (Turkey)" }, + { "ts", 0, 0, "Tsonga" }, + { "tt", 0, 0, "Tatar" }, + { "ug", 0, 0, "Uighur" }, + { "uk", 0, 0, "Ukrainian" }, + { "uk", "UA", 0, "Ukrainian (Ukraine)" }, + { "ur", 0, 0, "Urdu" }, + { "ur", "PK", 0, "Urdu (Pakistan)" }, + { "uz", 0, 0, "Uzbek" }, + { "uz", 0, "cyrillic", "Uzbek" }, + { "vi", 0, 0, "Vietnamese" }, + { "vi", "VN", 0, "Vietnamese (Vietnam)" }, + { "wa", 0, 0, "Walloon" }, + { "wo", 0, 0, "Wolof" }, + { "xh", 0, 0, "Xhosa" }, + { "yi", 0, 0, "Yiddish" }, + { "yo", 0, 0, "Yoruba" }, + { "zh", 0, 0, "Chinese" }, + { "zh", "CN", 0, "Chinese (simplified)" }, + { "zh", "HK", 0, "Chinese (Hong Kong)" }, + { "zh", "TW", 0, "Chinese (traditional)" }, + { "zu", 0, 0, "Zulu" }, + { NULL, 0, 0, NULL } }; //*} @@ -535,15 +532,6 @@ Language::get_name() const return ""; } -std::string -Language::get_localized_name() const -{ - if(language_spec && language_spec->name_localized) - return language_spec->name_localized; - else - return this->get_name(); -} - std::string Language::str() const { diff --git a/src/tinygettext/language.hpp b/src/tinygettext/language.hpp index 98e31a22c..46f47d299 100644 --- a/src/tinygettext/language.hpp +++ b/src/tinygettext/language.hpp @@ -70,9 +70,6 @@ public: /** Returns the human readable name of the Language */ std::string get_name() const; - /** Returns the human readable name of the language in the language itself */ - std::string get_localized_name() const; - /** Returns the Language as string in the form of an environment variable: {language}_{country}@{modifier} */ std::string str() const; diff --git a/src/utils/translation.cpp b/src/utils/translation.cpp index 7204fc81f..eadd937d0 100644 --- a/src/utils/translation.cpp +++ b/src/utils/translation.cpp @@ -176,14 +176,14 @@ Translations::Translations() //: m_dictionary_manager("UTF-16") { m_dictionary_manager.add_directory( file_manager->getAsset(FileManager::TRANSLATION,"")); - + if (g_language_list.size() == 0) { std::set languages = m_dictionary_manager.get_languages(); - + // English is always there but won't be found on file system g_language_list.push_back("en"); - + std::set::iterator it; for (it = languages.begin(); it != languages.end(); it++) { @@ -191,6 +191,37 @@ Translations::Translations() //: m_dictionary_manager("UTF-16") } } + const std::string file_name = file_manager->getAsset("localized_name.txt"); + try + { + std::unique_ptr in(new std::ifstream(file_name.c_str())); + if (!in.get()) + { + Log::error("translation", "error: failure opening: '%s'.", + file_name.c_str()); + } + else + { + for (std::string line; std::getline(*in, line); ) + { + std::size_t pos = line.find("="); + std::string name = line.substr(0, pos); + std::string localized_name = line.substr(pos + 1); + if (localized_name == "0") + { + localized_name = + tinygettext::Language::from_name(name).get_name(); + } + m_localized_name[name] = localized_name; + } + } + } + catch(std::exception& e) + { + Log::error("translation", "error: failure extract localized name."); + Log::error("translation", "%s", e.what()); + } + // LC_ALL does not work, sscanf will then not always be able // to scan for example: s=-1.1,-2.3,-3.3 correctly, which is // used in driveline files. @@ -603,4 +634,12 @@ core::stringw Translations::fribidizeLine(const core::stringw &str) #else return core::stringw(str); #endif // ENABLE_BIDI + +} + +const std::string& Translations::getLocalizedName(const std::string& str) const +{ + std::map::const_iterator n = m_localized_name.find(str); + assert (n != m_localized_name.end()); + return n->second; } diff --git a/src/utils/translation.hpp b/src/utils/translation.hpp index ad52738c0..7205433a9 100644 --- a/src/utils/translation.hpp +++ b/src/utils/translation.hpp @@ -53,6 +53,8 @@ private: std::map m_fribidized_strings; bool m_rtl; + std::map m_localized_name; + std::string m_current_language_name; std::string m_current_language_name_code; @@ -81,6 +83,8 @@ public: std::string getCurrentLanguageNameCode(); + const std::string& getLocalizedName(const std::string& str) const; + private: irr::core::stringw fribidizeLine(const irr::core::stringw &str); }; // Translations