From af7e88f81385a0d24a3ebcaf39cdc634662fa6ab Mon Sep 17 00:00:00 2001 From: Paul Craciunoiu Date: Thu, 20 Jan 2011 17:40:48 -0800 Subject: [PATCH] [bug 624459] Trim down languages.json and add iso639_1 attribute (used in customercare app). --- apps/gallery/forms.py | 4 +- apps/search/forms.py | 2 +- apps/search/utils.py | 2 +- lib/languages.json | 1246 +++++++++++++++++------------------------ lib/sumo_locales.py | 10 +- 5 files changed, 526 insertions(+), 738 deletions(-) diff --git a/apps/gallery/forms.py b/apps/gallery/forms.py index cd2de33dc..082e82495 100644 --- a/apps/gallery/forms.py +++ b/apps/gallery/forms.py @@ -63,7 +63,7 @@ class ImageForm(forms.ModelForm): max_length=settings.MAX_FILENAME_LENGTH) locale = forms.ChoiceField( label=_lazy(u'Locale'), - choices=[(LOCALES[k].external, LOCALES[k].native) for + choices=[(k, LOCALES[k].native) for k in settings.SUMO_LANGUAGES], initial=settings.WIKI_DEFAULT_LANGUAGE) title = StrippedCharField( @@ -143,7 +143,7 @@ class VideoForm(forms.ModelForm): max_length=settings.MAX_FILENAME_LENGTH) locale = forms.ChoiceField( label=_lazy(u'Locale'), - choices=[(LOCALES[k].external, LOCALES[k].native) for + choices=[(k, LOCALES[k].native) for k in settings.SUMO_LANGUAGES], initial=settings.WIKI_DEFAULT_LANGUAGE) title = StrippedCharField( diff --git a/apps/search/forms.py b/apps/search/forms.py index 1c20cca45..24347f9ce 100644 --- a/apps/search/forms.py +++ b/apps/search/forms.py @@ -13,7 +13,7 @@ from sumo_locales import LOCALES from wiki.models import CATEGORIES, FIREFOX_VERSIONS, OPERATING_SYSTEMS -SEARCH_LANGUAGES = [(LOCALES[k].external, LOCALES[k].native) for +SEARCH_LANGUAGES = [(k, LOCALES[k].native) for k in settings.SUMO_LANGUAGES] diff --git a/apps/search/utils.py b/apps/search/utils.py index 72cad9529..e071d1eca 100644 --- a/apps/search/utils.py +++ b/apps/search/utils.py @@ -59,4 +59,4 @@ def locale_or_default(locale): def sphinx_locale(locale): """Given a locale string like 'en-US', return a Sphinx-ready locale.""" - return crc32(LOCALES[locale].internal) + return crc32(locale) diff --git a/lib/languages.json b/lib/languages.json index b581ea3c0..3e54b5192 100644 --- a/lib/languages.json +++ b/lib/languages.json @@ -1,730 +1,522 @@ { - "pa-IN":{ - "English":"Punjabi", - "internal":"pa-IN", - "external":"pa-IN", - "dictionary":"pa-IN", - "native":"\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40" - }, - "gd":{ - "dictionary":"gd-GB", - "English":"Scottish Gaelic", - "internal":"gd", - "external":"gd", - "native":"G\u00e0idhlig" - }, - "gl":{ - "English":"Galician", - "internal":"gl", - "external":"gl", - "dictionary":"gl", - "native":"Galego" - }, - "ne-NP":{ - "English":"Nepali", - "internal":"ne-NP", - "external":"ne-NP", - "dictionary":"ne-NP", - "native":"\u0928\u0947\u092a\u093e\u0932\u0940" - }, - "tr":{ - "English":"Turkish", - "internal":"tr", - "external":"tr", - "dictionary":"tr", - "native":"T\u00fcrk\u00e7e" - }, - "ts":{ - "English":"Tsonga", - "internal":"ts", - "external":"ts", - "dictionary":"ts", - "native":"Xitsonga" - }, - "tn":{ - "English":"Tswana", - "internal":"tn", - "external":"tn", - "dictionary":"tn", - "native":"Setswana" - }, - "lt":{ - "English":"Lithuanian", - "internal":"lt", - "external":"lt", - "dictionary":"lt", - "native":"lietuvi\u0173 kalba" - }, - "th":{ - "English":"Thai", - "internal":"th", - "external":"th", - "dictionary":"th", - "native":"\u0e44\u0e17\u0e22" - }, - "te":{ - "English":"Telugu", - "internal":"te", - "external":"te", - "dictionary":"te", - "native":"\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41" - }, - "ta":{ - "English":"Tamil", - "internal":"ta", - "external":"ta", - "dictionary":"ta", - "native":"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd" - }, - "bn-IN":{ - "English":"Bengali (India)", - "internal":"bn-IN", - "external":"bn-IN", - "dictionary":"bn-IN", - "native":"\u09ac\u09be\u0982\u09b2\u09be (\u09ad\u09be\u09b0\u09a4)" - }, - "de":{ - "English":"German", - "internal":"de", - "external":"de", - "dictionary":"de-DE", - "native":"Deutsch" - }, - "da":{ - "English":"Danish", - "internal":"da", - "external":"da", - "dictionary":"da", - "native":"Dansk" - }, - "pt-BR":{ - "English":"Portuguese (Brazilian)", - "internal":"pt-BR", - "external":"pt-BR", - "dictionary":"pt-BR", - "native":"Portugu\u00eas (do Brasil)" - }, - "nb-NO":{ - "English":"Norwegian (Bokm\u00e5l)", - "internal":"nb-NO", - "external":"nb-NO", - "dictionary":"nb-NO", - "native":"Norsk bokm\u00e5l" - }, - "gu-IN":{ - "English":"Gujarati", - "internal":"gu-IN", - "external":"gu-IN", - "dictionary":"gu-IN", - "native":"\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0" - }, - "sr-CYRL":{ - "English":"Serbian", - "internal":"sr-CYRL", - "external":"sr-CYRL", - "dictionary":"sr-Cyrl", - "native":"\u0421\u0440\u043f\u0441\u043a\u0438" - }, - "ga-IE":{ - "English":"Irish (Ireland)", - "internal":"ga-IE", - "external":"ga-IE", - "dictionary":"ga-IE", - "native":"Gaeilge (\u00c9ire)" - }, - "el":{ - "English":"Greek", - "internal":"el", - "external":"el", - "dictionary":"el", - "native":"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac" - }, - "eo":{ - "English":"Esperanto", - "internal":"eo", - "external":"eo", - "dictionary":"eo", - "native":"Esperanto" - }, - "eu":{ - "English":"Basque", - "internal":"eu", - "external":"eu", - "dictionary":"eu", - "native":"Euskara" - }, - "et":{ - "English":"Estonian", - "internal":"et", - "external":"et", - "dictionary":"et", - "native":"eesti keel" - }, - "es":{ - "English":"Spanish", - "internal":"es", - "external":"es", - "dictionary":"es-ES", - "native":"Espa\u00f1ol" - }, - "ru":{ - "English":"Russian", - "internal":"ru", - "external":"ru", - "dictionary":"ru", - "native":"\u0420\u0443\u0441\u0441\u043a\u0438\u0439" - }, - "rw":{ - "English":"Kinyarwanda", - "internal":"rw", - "external":"rw", - "dictionary":"rw", - "native":"Ikinyarwanda" - }, - "wo":{ - "English":"Wolof", - "internal":"wo", - "external":"wo", - "dictionary":"wo", - "native":"Wolof" - }, - "rm":{ - "English":"Romansh", - "internal":"rm", - "external":"rm", - "dictionary":"rm", - "native":"rumantsch" - }, - "ro":{ - "English":"Romanian", - "internal":"ro", - "external":"ro", - "dictionary":"ro", - "native":"rom\u00e2n\u0103" - }, - "dsb":{ - "English":"Lower Sorbian", - "internal":"dsb", - "external":"dsb", - "dictionary":"dsb", - "native":"Dolnoserb\u0161\u0107ina" - }, - "hsb":{ - "English":"Upper Sorbian", - "internal":"hsb", - "external":"hsb", - "dictionary":"hsb", - "native":"Hornjoserbsce" - }, - "be":{ - "English":"Belarusian", - "internal":"be", - "external":"be", - "dictionary":"be", - "native":"\u0411\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f" - }, - "bg":{ - "English":"Bulgarian", - "internal":"bg", - "external":"bg", - "dictionary":"bg", - "native":"\u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438" - }, - "uk":{ - "English":"Ukrainian", - "internal":"uk", - "external":"uk", - "dictionary":"uk", - "native":"\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430" - }, - "ast":{ - "English":"Asturian", - "internal":"ast", - "external":"ast", - "dictionary":"ast-ES", - "native":"Asturianu" - }, - "br-FR":{ - "English":"Breton", - "internal":"br-FR", - "external":"br-FR", - "dictionary":"br-FR", - "native":"Brezhoneg" - }, - "tt-RU":{ - "English":"Tatar", - "internal":"tt-RU", - "external":"tt-RU", - "dictionary":"tt-RU", - "native":"Tatar\u00e7a" - }, - "ss":{ - "English":"Siswati", - "internal":"ss", - "external":"ss", - "dictionary":"ss", - "native":"siSwati" - }, - "ja":{ - "English":"Japanese", - "internal":"ja", - "external":"ja", - "dictionary":"ja", - "native":"\u65e5\u672c\u8a9e" - }, - "ta-IN":{ - "English":"Tamil (India)", - "internal":"ta-IN", - "external":"ta-IN", - "dictionary":"ta-IN", - "native":"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd (\u0b87\u0ba8\u0bcd\u0ba4\u0bbf\u0baf\u0bbe)" - }, - "hy-AM":{ - "English":"Armenian", - "internal":"hy-AM", - "external":"hy-AM", - "dictionary":"hy-AM", - "native":"\u0540\u0561\u0575\u0565\u0580\u0565\u0576" - }, - "pt-PT":{ - "English":"Portuguese (Portugal)", - "internal":"pt-PT", - "external":"pt-PT", - "dictionary":"pt-PT", - "native":"Portugu\u00eas (Europeu)" - }, - "oc":{ - "English":"Occitan (Lengadocian)", - "internal":"oc", - "external":"oc", - "dictionary":"oc", - "native":"occitan (lengadocian)" - }, - "no":{ - "dictionary":"nn-NO", - "English":"Norwegian (Nynorsk)", - "internal":"no", - "external":"no", - "native":"Norsk nynorsk" - }, - "fy-NL":{ - "English":"Frisian", - "internal":"fy-NL", - "external":"fy-NL", - "dictionary":"fy-NL", - "native":"Frysk" - }, - "or":{ - "English":"Oriya", - "internal":"or", - "external":"or", - "dictionary":"or", - "native":"\u0b13\u0b21\u0b3c\u0b3f\u0b06" - }, - "xh":{ - "English":"Xhosa", - "internal":"xh", - "external":"xh", - "dictionary":"xh", - "native":"isiXhosa" - }, - "nso":{ - "English":"Northern Sotho", - "internal":"nso", - "external":"nso", - "dictionary":"nso", - "native":"Sepedi" - }, - "ta-LK":{ - "English":"Tamil (Sri Lanka)", - "internal":"ta-LK", - "external":"ta-LK", - "dictionary":"ta-LK", - "native":"\u0ba4\u0bae\u0bbf\u0bb4\u0bcd (\u0b87\u0bb2\u0b99\u0bcd\u0b95\u0bc8)" - }, - "ca":{ - "English":"Catalan", - "internal":"ca", - "external":"ca", - "dictionary":"ca", - "native":"catal\u00e0" - }, - "cy":{ - "English":"Welsh", - "internal":"cy", - "external":"cy", - "dictionary":"cy", - "native":"Cymraeg" - }, - "cs":{ - "English":"Czech", - "internal":"cs", - "external":"cs", - "dictionary":"cs", - "native":"\u010ce\u0161tina" - }, - "lv":{ - "English":"Latvian", - "internal":"lv", - "external":"lv", - "dictionary":"lv", - "native":"Latvie\u0161u" - }, - "hi-IN":{ - "English":"Hindi (India)", - "internal":"hi-IN", - "external":"hi-IN", - "dictionary":"hi-IN", - "native":"\u0939\u093f\u0928\u094d\u0926\u0940 (\u092d\u093e\u0930\u0924)" - }, - "fj-FJ":{ - "English":"Fijian", - "internal":"fj-FJ", - "external":"fj-FJ", - "dictionary":"fj-FJ", - "native":"Vosa vaka-Viti" - }, - "is":{ - "English":"Icelandic", - "internal":"is", - "external":"is", - "dictionary":"is", - "native":"\u00edslenska" - }, - "pl":{ - "English":"Polish", - "internal":"pl", - "external":"pl", - "dictionary":"pl", - "native":"Polski" - }, - "hr":{ - "English":"Croatian", - "internal":"hr", - "external":"hr", - "dictionary":"hr", - "native":"Hrvatski" - }, - "en-US":{ - "English":"English", - "internal":"en-US", - "external":"en-US", - "dictionary":"en-US", - "native":"English" - }, - "hu":{ - "English":"Hungarian", - "internal":"hu", - "external":"hu", - "dictionary":"hu", - "native":"Magyar" - }, - "hi":{ - "English":"Hindi", - "internal":"hi", - "external":"hi", - "dictionary":"hi", - "native":"\u0939\u093f\u0928\u094d\u0926\u0940" - }, - "he":{ - "English":"Hebrew", - "internal":"he", - "external":"he", - "dictionary":"he", - "native":"\u05e2\u05d1\u05e8\u05d9\u05ea" - }, - "mg":{ - "English":"Malagasy", - "internal":"mg", - "external":"mg", - "dictionary":"mg", - "native":"Malagasy" - }, - "fur":{ - "dictionary":"fur-IT", - "English":"Friulian", - "internal":"fur", - "external":"fur", - "native":"Furlan" - }, - "ml":{ - "English":"Malayalam", - "internal":"ml", - "external":"ml", - "dictionary":"ml", - "native":"\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02" - }, - "mn":{ - "English":"Mongolian", - "internal":"mn", - "external":"mn", - "dictionary":"mn", - "native":"\u041c\u043e\u043d\u0433\u043e\u043b" - }, - "mi":{ - "English":"Maori (Aotearoa)", - "internal":"mi", - "external":"mi", - "dictionary":"mi", - "native":"M\u0101ori (Aotearoa)" - }, - "mk":{ - "English":"Macedonian", - "internal":"mk", - "external":"mk", - "dictionary":"mk", - "native":"\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438" - }, - "ur":{ - "English":"Urdu", - "internal":"ur", - "external":"ur", - "dictionary":"ur", - "native":"\u0627\u064f\u0631\u062f\u0648" - }, - "zh-CN":{ - "English":"Chinese (Simplified)", - "internal":"zh-CN", - "external":"zh-CN", - "dictionary":"zh-CN", - "native":"\u4e2d\u6587 (\u7b80\u4f53)" - }, - "ms":{ - "English":"Malay", - "internal":"ms", - "external":"ms", - "dictionary":"ms", - "native":"\ufe90\ufeeb\ufe8e\ufeb3 \ufee1\ufefc\ufef3\ufeed" - }, - "mr":{ - "English":"Marathi", - "internal":"mr", - "external":"mr", - "dictionary":"mr", - "native":"\u092e\u0930\u093e\u0920\u0940" - }, - "ve":{ - "English":"Venda", - "internal":"ve", - "external":"ve", - "dictionary":"ve", - "native":"Tshiven\u1e13a" - }, - "af":{ - "English":"Afrikaans", - "internal":"af", - "external":"af", - "dictionary":"af-NA", - "native":"Afrikaans" - }, - "vi":{ - "English":"Vietnamese", - "internal":"vi", - "external":"vi", - "dictionary":"vi", - "native":"Ti\u1ebfng Vi\u1ec7t" - }, - "ak":{ - "English":"Akan", - "internal":"ak", - "external":"ak", - "dictionary":"ak-GH", - "native":"Akan" - }, - "it":{ - "English":"Italian", - "internal":"it", - "external":"it", - "dictionary":"it", - "native":"Italiano" - }, - "as":{ - "English":"Assamese", - "internal":"as", - "external":"as", - "dictionary":"as-IN", - "native":"\u0985\u09b8\u09ae\u09c0\u09af\u09bc\u09be" - }, - "ar":{ - "English":"Arabic", - "internal":"ar", - "external":"ar", - "dictionary":"ar", - "native":"\u0639\u0631\u0628\u064a" - }, - "sr-LATN":{ - "English":"Serbian", - "internal":"sr-LATN", - "external":"sr-LATN", - "dictionary":"sr-Latn", - "native":"Srpski" - }, - "bn-BD":{ - "English":"Bengali (Bangladesh)", - "internal":"bn-BD", - "external":"bn-BD", - "dictionary":"bn-BD", - "native":"\u09ac\u09be\u0982\u09b2\u09be (\u09ac\u09be\u0982\u09b2\u09be\u09a6\u09c7\u09b6)" - }, - "sv-SE":{ - "English":"Swedish", - "internal":"sv-SE", - "external":"sv-SE", - "dictionary":"sv-SE", - "native":"Svenska" - }, - "id":{ - "English":"Indonesian", - "internal":"id", - "external":"id", - "dictionary":"id", - "native":"Bahasa Indonesia" - }, - "nl":{ - "English":"Dutch", - "internal":"nl", - "external":"nl", - "dictionary":"nl", - "native":"Nederlands" - }, - "zu":{ - "English":"Zulu", - "internal":"zu", - "external":"zu", - "dictionary":"zu", - "native":"isiZulu" - }, - "nr":{ - "English":"Ndebele, South", - "internal":"nr", - "external":"nr", - "dictionary":"nr", - "native":"isiNdebele" - }, - "fr":{ - "English":"French", - "internal":"fr", - "external":"fr", - "dictionary":"fr-FR", - "native":"Fran\u00e7ais" - }, - "fa":{ - "English":"Persian", - "internal":"fa", - "external":"fa", - "dictionary":"fa", - "native":"\u0641\u0627\u0631\u0633\u06cc" - }, - "fi":{ - "English":"Finnish", - "internal":"fi", - "external":"fi", - "dictionary":"fi", - "native":"suomi" - }, - "ka":{ - "English":"Georgian", - "internal":"ka", - "external":"ka", - "dictionary":"ka", - "native":"\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8" - }, - "kk":{ - "English":"Kazakh", - "internal":"kk", - "external":"kk", - "dictionary":"kk", - "native":"\u049a\u0430\u0437\u0430\u049b" - }, - "zh-TW":{ - "English":"Chinese (Traditional)", - "internal":"zh-TW", - "external":"zh-TW", - "dictionary":"zh-TW", - "native":"\u6b63\u9ad4\u4e2d\u6587 (\u7e41\u9ad4)" - }, - "sq":{ - "English":"Albanian", - "internal":"sq", - "external":"sq", - "dictionary":"sq", - "native":"Shqip" - }, - "ko":{ - "English":"Korean", - "internal":"ko", - "external":"ko", - "dictionary":"ko", - "native":"\ud55c\uad6d\uc5b4" - }, - "kn":{ - "English":"Kannada", - "internal":"kn", - "external":"kn", - "dictionary":"kn", - "native":"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1" - }, - "st":{ - "English":"Southern Sotho", - "internal":"st", - "external":"st", - "dictionary":"st", - "native":"Sesotho" - }, - "sk":{ - "English":"Slovak", - "internal":"sk", - "external":"sk", - "dictionary":"sk", - "native":"sloven\u010dina" - }, - "si":{ - "English":"Sinhala", - "internal":"si", - "external":"si", - "dictionary":"si", - "native":"\u0dc3\u0dd2\u0d82\u0dc4\u0dbd" - }, - "ku":{ - "English":"Kurdish", - "internal":"ku", - "external":"ku", - "dictionary":"ku", - "native":"Kurd\u00ee" - }, - "sl":{ - "English":"Slovenian", - "internal":"sl", - "external":"sl", - "dictionary":"sl", - "native":"slovensko" - }, - "ilo":{ - "English":"Iloko", - "internal":"ilo", - "external":"ilo", - "dictionary":"ilo", - "native":"Iloko" - }, - "mai":{ - "English":"Maithili", - "internal":"mai", - "external":"mai", - "dictionary":"mai", - "native":"\u092E\u0948\u0925\u093F\u0932\u0940" - }, - "bs":{ - "English":"Bosnian", - "internal":"bs", - "external":"bs", - "dictionary":"bs_BA", - "native":"Bosanski" - }, - "my":{ - "English":"Burmese", - "internal":"my", - "external":"my", - "dictionary":"my", - "native":"\u1019\u103C\u1014\u103A\u1019\u102C\u1018\u102C\u101E\u102C" + "pa-IN": { + "iso639_1": "pa", + "english": "Punjabi", + "native": "\u0a2a\u0a70\u0a1c\u0a3e\u0a2c\u0a40" + }, + "gd": { + "iso639_1": "gd", + "english": "Scottish Gaelic", + "native": "G\u00e0idhlig" + }, + "gl": { + "iso639_1": "gl", + "english": "Galician", + "native": "Galego" + }, + "ne-NP": { + "iso639_1": "ne", + "english": "Nepali", + "native": "\u0928\u0947\u092a\u093e\u0932\u0940" + }, + "tr": { + "iso639_1": "tr", + "english": "Turkish", + "native": "T\u00fcrk\u00e7e" + }, + "ts": { + "iso639_1": "ts", + "english": "Tsonga", + "native": "Xitsonga" + }, + "tn": { + "iso639_1": "tn", + "english": "Tswana", + "native": "Setswana" + }, + "lt": { + "iso639_1": "lt", + "english": "Lithuanian", + "native": "lietuvi\u0173 kalba" + }, + "th": { + "iso639_1": "th", + "english": "Thai", + "native": "\u0e44\u0e17\u0e22" + }, + "te": { + "iso639_1": "te", + "english": "Telugu", + "native": "\u0c24\u0c46\u0c32\u0c41\u0c17\u0c41" + }, + "ta": { + "iso639_1": "ta", + "english": "Tamil", + "native": "\u0ba4\u0bae\u0bbf\u0bb4\u0bcd" + }, + "bn-IN": { + "iso639_1": "bn", + "english": "Bengali (India)", + "native": "\u09ac\u09be\u0982\u09b2\u09be (\u09ad\u09be\u09b0\u09a4)" + }, + "de": { + "iso639_1": "de", + "english": "German", + "native": "Deutsch" + }, + "da": { + "iso639_1": "da", + "english": "Danish", + "native": "Dansk" + }, + "pt-BR": { + "iso639_1": "pt", + "english": "Portuguese (Brazilian)", + "native": "Portugu\u00eas (do Brasil)" + }, + "nb-NO": { + "iso639_1": "nb", + "english": "Norwegian (Bokm\u00e5l)", + "native": "Norsk bokm\u00e5l" + }, + "gu-IN": { + "iso639_1": "gu", + "english": "Gujarati", + "native": "\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0" + }, + "sr-CYRL": { + "iso639_1": "sr", + "english": "Serbian", + "native": "\u0421\u0440\u043f\u0441\u043a\u0438" + }, + "ga-IE": { + "iso639_1": "ga", + "english": "Irish (Ireland)", + "native": "Gaeilge (\u00c9ire)" + }, + "el": { + "iso639_1": "el", + "english": "Greek", + "native": "\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac" + }, + "eo": { + "iso639_1": "eo", + "english": "Esperanto", + "native": "Esperanto" + }, + "eu": { + "iso639_1": "eu", + "english": "Basque", + "native": "Euskara" + }, + "et": { + "iso639_1": "et", + "english": "Estonian", + "native": "eesti keel" + }, + "es": { + "iso639_1": "es", + "english": "Spanish", + "native": "Espa\u00f1ol" + }, + "ru": { + "iso639_1": "ru", + "english": "Russian", + "native": "\u0420\u0443\u0441\u0441\u043a\u0438\u0439" + }, + "rw": { + "iso639_1": "rw", + "english": "Kinyarwanda", + "native": "Ikinyarwanda" + }, + "wo": { + "iso639_1": "wo", + "english": "Wolof", + "native": "Wolof" + }, + "rm": { + "iso639_1": "rm", + "english": "Romansh", + "native": "rumantsch" + }, + "ro": { + "iso639_1": "ro", + "english": "Romanian", + "native": "rom\u00e2n\u0103" + }, + "dsb": { + "iso639_1": null, + "english": "Lower Sorbian", + "native": "Dolnoserb\u0161\u0107ina" + }, + "hsb": { + "iso639_1": null, + "english": "Upper Sorbian", + "native": "Hornjoserbsce" + }, + "be": { + "iso639_1": "be", + "english": "Belarusian", + "native": "\u0411\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f" + }, + "bg": { + "iso639_1": "bg", + "english": "Bulgarian", + "native": "\u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438" + }, + "uk": { + "iso639_1": "uk", + "english": "Ukrainian", + "native": "\u0423\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430" + }, + "ast": { + "iso639_1": null, + "english": "Asturian", + "native": "Asturianu" + }, + "br-FR": { + "iso639_1": "br", + "english": "Breton", + "native": "Brezhoneg" + }, + "bs": { + "iso639_1": "bs", + "english": "Bosnian", + "native": "Bosanski" + }, + "ss": { + "iso639_1": "ss", + "english": "Siswati", + "native": "siSwati" + }, + "ja": { + "iso639_1": "ja", + "english": "Japanese", + "native": "\u65e5\u672c\u8a9e" + }, + "ta-IN": { + "iso639_1": "ta", + "english": "Tamil (India)", + "native": "\u0ba4\u0bae\u0bbf\u0bb4\u0bcd (\u0b87\u0ba8\u0bcd\u0ba4\u0bbf\u0baf\u0bbe)" + }, + "hy-AM": { + "iso639_1": "hy", + "english": "Armenian", + "native": "\u0540\u0561\u0575\u0565\u0580\u0565\u0576" + }, + "pt-PT": { + "iso639_1": "pt", + "english": "Portuguese (Portugal)", + "native": "Portugu\u00eas (Europeu)" + }, + "ilo": { + "iso639_1": null, + "english": "Iloko", + "native": "Iloko" + }, + "oc": { + "iso639_1": "oc", + "english": "Occitan (Lengadocian)", + "native": "occitan (lengadocian)" + }, + "fy-NL": { + "iso639_1": "fy", + "english": "Frisian", + "native": "Frysk" + }, + "or": { + "iso639_1": "or", + "english": "Oriya", + "native": "\u0b13\u0b21\u0b3c\u0b3f\u0b06" + }, + "xh": { + "iso639_1": "xh", + "english": "Xhosa", + "native": "isiXhosa" + }, + "nso": { + "iso639_1": null, + "english": "Northern Sotho", + "native": "Sepedi" + }, + "ta-LK": { + "iso639_1": "ta", + "english": "Tamil (Sri Lanka)", + "native": "\u0ba4\u0bae\u0bbf\u0bb4\u0bcd (\u0b87\u0bb2\u0b99\u0bcd\u0b95\u0bc8)" + }, + "ca": { + "iso639_1": "ca", + "english": "Catalan", + "native": "catal\u00e0" + }, + "tt-RU": { + "iso639_1": "tt", + "english": "Tatar", + "native": "Tatar\u00e7a" + }, + "cy": { + "iso639_1": "cy", + "english": "Welsh", + "native": "Cymraeg" + }, + "cs": { + "iso639_1": "cs", + "english": "Czech", + "native": "\u010ce\u0161tina" + }, + "lv": { + "iso639_1": "lv", + "english": "Latvian", + "native": "Latvie\u0161u" + }, + "hi-IN": { + "iso639_1": "hi", + "english": "Hindi (India)", + "native": "\u0939\u093f\u0928\u094d\u0926\u0940 (\u092d\u093e\u0930\u0924)" + }, + "fj-FJ": { + "iso639_1": "fj", + "english": "Fijian", + "native": "Vosa vaka-Viti" + }, + "is": { + "iso639_1": "is", + "english": "Icelandic", + "native": "\u00edslenska" + }, + "pl": { + "iso639_1": "pl", + "english": "Polish", + "native": "Polski" + }, + "hr": { + "iso639_1": "hr", + "english": "Croatian", + "native": "Hrvatski" + }, + "en-US": { + "iso639_1": "en", + "english": "English", + "native": "English" + }, + "hu": { + "iso639_1": "hu", + "english": "Hungarian", + "native": "Magyar" + }, + "hi": { + "iso639_1": "hi", + "english": "Hindi", + "native": "\u0939\u093f\u0928\u094d\u0926\u0940" + }, + "he": { + "iso639_1": "he", + "english": "Hebrew", + "native": "\u05e2\u05d1\u05e8\u05d9\u05ea" + }, + "mg": { + "iso639_1": "mg", + "english": "Malagasy", + "native": "Malagasy" + }, + "fur": { + "iso639_1": null, + "english": "Friulian", + "native": "Furlan" + }, + "ml": { + "iso639_1": "ml", + "english": "Malayalam", + "native": "\u0d2e\u0d32\u0d2f\u0d3e\u0d33\u0d02" + }, + "mn": { + "iso639_1": "mn", + "english": "Mongolian", + "native": "\u041c\u043e\u043d\u0433\u043e\u043b" + }, + "mi": { + "iso639_1": "mi", + "english": "Maori (Aotearoa)", + "native": "M\u0101ori (Aotearoa)" + }, + "mk": { + "iso639_1": "mk", + "english": "Macedonian", + "native": "\u041c\u0430\u043a\u0435\u0434\u043e\u043d\u0441\u043a\u0438" + }, + "ur": { + "iso639_1": "ur", + "english": "Urdu", + "native": "\u0627\u064f\u0631\u062f\u0648" + }, + "zh-CN": { + "iso639_1": "zh", + "english": "Chinese (Simplified)", + "native": "\u4e2d\u6587 (\u7b80\u4f53)" + }, + "ms": { + "iso639_1": "ms", + "english": "Malay", + "native": "\ufe90\ufeeb\ufe8e\ufeb3 \ufee1\ufefc\ufef3\ufeed" + }, + "mr": { + "iso639_1": "mr", + "english": "Marathi", + "native": "\u092e\u0930\u093e\u0920\u0940" + }, + "my": { + "iso639_1": "my", + "english": "Burmese", + "native": "\u1019\u103c\u1014\u103a\u1019\u102c\u1018\u102c\u101e\u102c" + }, + "ve": { + "iso639_1": "ve", + "english": "Venda", + "native": "Tshiven\u1e13a" + }, + "af": { + "iso639_1": "af", + "english": "Afrikaans", + "native": "Afrikaans" + }, + "vi": { + "iso639_1": "vi", + "english": "Vietnamese", + "native": "Ti\u1ebfng Vi\u1ec7t" + }, + "ak": { + "iso639_1": "ak", + "english": "Akan", + "native": "Akan" + }, + "it": { + "iso639_1": "it", + "english": "Italian", + "native": "Italiano" + }, + "as": { + "iso639_1": "as", + "english": "Assamese", + "native": "\u0985\u09b8\u09ae\u09c0\u09af\u09bc\u09be" + }, + "ar": { + "iso639_1": "ar", + "english": "Arabic", + "native": "\u0639\u0631\u0628\u064a" + }, + "sr-LATN": { + "iso639_1": "sr", + "english": "Serbian", + "native": "Srpski" + }, + "bn-BD": { + "iso639_1": "bn", + "english": "Bengali (Bangladesh)", + "native": "\u09ac\u09be\u0982\u09b2\u09be (\u09ac\u09be\u0982\u09b2\u09be\u09a6\u09c7\u09b6)" + }, + "sv-SE": { + "iso639_1": "sv", + "english": "Swedish", + "native": "Svenska" + }, + "id": { + "iso639_1": "id", + "english": "Indonesian", + "native": "Bahasa Indonesia" + }, + "nl": { + "iso639_1": "nl", + "english": "Dutch", + "native": "Nederlands" + }, + "no": { + "iso639_1": "no", + "english": "Norwegian (Nynorsk)", + "native": "Norsk nynorsk" + }, + "zu": { + "iso639_1": "zu", + "english": "Zulu", + "native": "isiZulu" + }, + "nr": { + "iso639_1": "nr", + "english": "Ndebele, South", + "native": "isiNdebele" + }, + "fr": { + "iso639_1": "fr", + "english": "French", + "native": "Fran\u00e7ais" + }, + "fa": { + "iso639_1": "fa", + "english": "Persian", + "native": "\u0641\u0627\u0631\u0633\u06cc" + }, + "mai": { + "iso639_1": "bh", + "english": "Maithili", + "native": "\u092e\u0948\u0925\u093f\u0932\u0940" + }, + "fi": { + "iso639_1": "fi", + "english": "Finnish", + "native": "suomi" + }, + "ka": { + "iso639_1": "ka", + "english": "Georgian", + "native": "\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8" + }, + "kk": { + "iso639_1": "kk", + "english": "Kazakh", + "native": "\u049a\u0430\u0437\u0430\u049b" + }, + "zh-TW": { + "iso639_1": "zh", + "english": "Chinese (Traditional)", + "native": "\u6b63\u9ad4\u4e2d\u6587 (\u7e41\u9ad4)" + }, + "sq": { + "iso639_1": "sq", + "english": "Albanian", + "native": "Shqip" + }, + "ko": { + "iso639_1": "ko", + "english": "Korean", + "native": "\ud55c\uad6d\uc5b4" + }, + "kn": { + "iso639_1": "kn", + "english": "Kannada", + "native": "\u0c95\u0ca8\u0ccd\u0ca8\u0ca1" + }, + "st": { + "iso639_1": "st", + "english": "Southern Sotho", + "native": "Sesotho" + }, + "sk": { + "iso639_1": "sk", + "english": "Slovak", + "native": "sloven\u010dina" + }, + "si": { + "iso639_1": "si", + "english": "Sinhala", + "native": "\u0dc3\u0dd2\u0d82\u0dc4\u0dbd" + }, + "ku": { + "iso639_1": "ku", + "english": "Kurdish", + "native": "Kurd\u00ee" + }, + "sl": { + "iso639_1": "sl", + "english": "Slovenian", + "native": "slovensko" } } diff --git a/lib/sumo_locales.py b/lib/sumo_locales.py index 449fd1b0d..70399a1d6 100644 --- a/lib/sumo_locales.py +++ b/lib/sumo_locales.py @@ -2,8 +2,7 @@ from collections import namedtuple import json import os -Language = namedtuple(u'Language', - u'external internal english native dictionary') +Language = namedtuple(u'Language', u'english native iso639_1') file = os.path.join(os.path.dirname(__file__), 'languages.json') locales = json.loads(open(file, 'r').read()) @@ -11,8 +10,5 @@ locales = json.loads(open(file, 'r').read()) LOCALES = {} for k in locales: - LOCALES[k] = Language(locales[k]['external'], locales[k]['internal'], - locales[k]['English'], locales[k]['native'], - locales[k]['dictionary']) - -INTERNAL_MAP = dict([(LOCALES[k].internal, k) for k in LOCALES]) + LOCALES[k] = Language(locales[k]['english'], locales[k]['native'], + locales[k]['iso639_1'])