Spaces:
Runtime error
Runtime error
File size: 2,562 Bytes
9583ddb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
target_lang_dict = {
"Afrikaans": "af",
"Albanian": "sq",
"Arabic": "ar",
"Aragonese": "an",
"Armenian": "hy",
"Asturian": "ast",
"Azerbaijani": "az",
"Bashkir": "ba",
"Basque": "eu",
"Bavarian": "bar",
"Belarusian": "be",
"Bengali": "bn",
"Bishnupriya Manipuri": "bpy",
"Bosnian": "bs",
"Breton": "br",
"Bulgarian": "bg",
"Burmese": "my",
"Catalan": "ca",
"Cebuano": "ceb",
"Chechen": "ce",
"Chinese (Simplified)": "zh",
"Chinese (Traditional)": "zh-tw",
"Chuvash": "cv",
"Croatian": "hr",
"Czech": "cs",
"Danish": "da",
"Dutch": "nl",
"English": "en",
"Estonian": "et",
"Finnish": "fi",
"French": "fr",
"Galician": "gl",
"Georgian": "ka",
"German": "de",
"Greek": "el",
"Gujarati": "gu",
"Haitian": "ht",
"Hebrew": "he",
"Hindi": "hi",
"Hungarian": "hu",
"Icelandic": "is",
"Ido": "io",
"Indonesian": "id",
"Irish": "ga",
"Italian": "it",
"Japanese": "ja",
"Javanese": "jv",
"Kannada": "kn",
"Kazakh": "kk",
"Kirghiz": "ky",
"Korean": "ko",
"Latin": "la",
"Latvian": "lv",
"Lithuanian": "lt",
"Lombard": "lmo",
"Low Saxon": "nds",
"Luxembourgish": "lb",
"Macedonian": "mk",
"Malagasy": "mg",
"Malay": "ms",
"Malayalam": "ml",
"Marathi": "mr",
"Minangkabau": "min",
"Nepali": "ne",
"Newar": "new",
"Norwegian (Bokmal)": "nb",
"Norwegian (Nynorsk)": "nn",
"Occitan": "oc",
"Persian (Farsi)": "fa",
"Piedmontese": "pms",
"Polish": "pl",
"Portuguese": "pt",
"Punjabi": "pa",
"Romanian": "ro",
"Russian": "ru",
"Scots": "sco",
"Serbian": "sr",
"Serbo-Croatian": "sh",
"Sicilian": "scn",
"Slovak": "sk",
"Slovenian": "sl",
"South Azerbaijani": "azb",
"Spanish": "es",
"Sundanese": "su",
"Swahili": "sw",
"Swedish": "sv",
"Tagalog": "tl",
"Tajik": "tg",
"Tamil": "ta",
"Tatar": "tt",
"Telugu": "te",
"Turkish": "tr",
"Ukrainian": "uk",
"Urdu": "ur",
"Uzbek": "uz",
"Vietnamese": "vi",
"Volapük": "vo",
"Waray-Waray": "war",
"Welsh": "cy",
"West Frisian": "fy",
"Western Punjabi": "pnb",
"Yoruba": "yo",
"Thai": "th",
"Mongolian": "mn"
}
def select_target_lang_code(lang):
"""
Select the target language code
"""
return target_lang_dict[lang] if lang in target_lang_dict else "en"
lang = select_target_lang_code("Hindi")
print(lang) |