mirror of https://github.com/morpheus65535/bazarr
269 lines
5.9 KiB
Python
269 lines
5.9 KiB
Python
BASE_URLS = {
|
|
"GOOGLE_TRANSLATE": "https://translate.google.com/m",
|
|
"PONS": "https://en.pons.com/translate/",
|
|
"YANDEX": "https://translate.yandex.net/api/{version}/tr.json/{endpoint}",
|
|
"LINGUEE": "https://www.linguee.com/",
|
|
"MYMEMORY": "http://api.mymemory.translated.net/get",
|
|
"QCRI": "https://mt.qcri.org/api/v1/{endpoint}?",
|
|
"DEEPL": "https://api.deepl.com/{version}/",
|
|
"DEEPL_FREE": "https://api-free.deepl.com/{version}/",
|
|
"MICROSOFT_TRANSLATE": "https://api.cognitive.microsofttranslator.com/translate?api-version=3.0",
|
|
"PAPAGO": "https://papago.naver.com/",
|
|
"PAPAGO_API": "https://openapi.naver.com/v1/papago/n2mt",
|
|
"LIBRE": "https://libretranslate.com/",
|
|
"LIBRE_FREE": "https://libretranslate.de/",
|
|
}
|
|
|
|
GOOGLE_LANGUAGES_TO_CODES = {
|
|
"afrikaans": "af",
|
|
"albanian": "sq",
|
|
"amharic": "am",
|
|
"arabic": "ar",
|
|
"armenian": "hy",
|
|
"assamese": "as",
|
|
"aymara": "ay",
|
|
"azerbaijani": "az",
|
|
"bambara": "bm",
|
|
"basque": "eu",
|
|
"belarusian": "be",
|
|
"bengali": "bn",
|
|
"bhojpuri": "bho",
|
|
"bosnian": "bs",
|
|
"bulgarian": "bg",
|
|
"catalan": "ca",
|
|
"cebuano": "ceb",
|
|
"chichewa": "ny",
|
|
"chinese (simplified)": "zh-CN",
|
|
"chinese (traditional)": "zh-TW",
|
|
"corsican": "co",
|
|
"croatian": "hr",
|
|
"czech": "cs",
|
|
"danish": "da",
|
|
"dhivehi": "dv",
|
|
"dogri": "doi",
|
|
"dutch": "nl",
|
|
"english": "en",
|
|
"esperanto": "eo",
|
|
"estonian": "et",
|
|
"ewe": "ee",
|
|
"filipino": "tl",
|
|
"finnish": "fi",
|
|
"french": "fr",
|
|
"frisian": "fy",
|
|
"galician": "gl",
|
|
"georgian": "ka",
|
|
"german": "de",
|
|
"greek": "el",
|
|
"guarani": "gn",
|
|
"gujarati": "gu",
|
|
"haitian creole": "ht",
|
|
"hausa": "ha",
|
|
"hawaiian": "haw",
|
|
"hebrew": "iw",
|
|
"hindi": "hi",
|
|
"hmong": "hmn",
|
|
"hungarian": "hu",
|
|
"icelandic": "is",
|
|
"igbo": "ig",
|
|
"ilocano": "ilo",
|
|
"indonesian": "id",
|
|
"irish": "ga",
|
|
"italian": "it",
|
|
"japanese": "ja",
|
|
"javanese": "jw",
|
|
"kannada": "kn",
|
|
"kazakh": "kk",
|
|
"khmer": "km",
|
|
"kinyarwanda": "rw",
|
|
"konkani": "gom",
|
|
"korean": "ko",
|
|
"krio": "kri",
|
|
"kurdish (kurmanji)": "ku",
|
|
"kurdish (sorani)": "ckb",
|
|
"kyrgyz": "ky",
|
|
"lao": "lo",
|
|
"latin": "la",
|
|
"latvian": "lv",
|
|
"lingala": "ln",
|
|
"lithuanian": "lt",
|
|
"luganda": "lg",
|
|
"luxembourgish": "lb",
|
|
"macedonian": "mk",
|
|
"maithili": "mai",
|
|
"malagasy": "mg",
|
|
"malay": "ms",
|
|
"malayalam": "ml",
|
|
"maltese": "mt",
|
|
"maori": "mi",
|
|
"marathi": "mr",
|
|
"meiteilon (manipuri)": "mni-Mtei",
|
|
"mizo": "lus",
|
|
"mongolian": "mn",
|
|
"myanmar": "my",
|
|
"nepali": "ne",
|
|
"norwegian": "no",
|
|
"odia (oriya)": "or",
|
|
"oromo": "om",
|
|
"pashto": "ps",
|
|
"persian": "fa",
|
|
"polish": "pl",
|
|
"portuguese": "pt",
|
|
"punjabi": "pa",
|
|
"quechua": "qu",
|
|
"romanian": "ro",
|
|
"russian": "ru",
|
|
"samoan": "sm",
|
|
"sanskrit": "sa",
|
|
"scots gaelic": "gd",
|
|
"sepedi": "nso",
|
|
"serbian": "sr",
|
|
"sesotho": "st",
|
|
"shona": "sn",
|
|
"sindhi": "sd",
|
|
"sinhala": "si",
|
|
"slovak": "sk",
|
|
"slovenian": "sl",
|
|
"somali": "so",
|
|
"spanish": "es",
|
|
"sundanese": "su",
|
|
"swahili": "sw",
|
|
"swedish": "sv",
|
|
"tajik": "tg",
|
|
"tamil": "ta",
|
|
"tatar": "tt",
|
|
"telugu": "te",
|
|
"thai": "th",
|
|
"tigrinya": "ti",
|
|
"tsonga": "ts",
|
|
"turkish": "tr",
|
|
"turkmen": "tk",
|
|
"twi": "ak",
|
|
"ukrainian": "uk",
|
|
"urdu": "ur",
|
|
"uyghur": "ug",
|
|
"uzbek": "uz",
|
|
"vietnamese": "vi",
|
|
"welsh": "cy",
|
|
"xhosa": "xh",
|
|
"yiddish": "yi",
|
|
"yoruba": "yo",
|
|
"zulu": "zu",
|
|
}
|
|
|
|
PONS_CODES_TO_LANGUAGES = {
|
|
"ar": "arabic",
|
|
"bg": "bulgarian",
|
|
"zh-cn": "chinese",
|
|
"cs": "czech",
|
|
"da": "danish",
|
|
"nl": "dutch",
|
|
"en": "english",
|
|
"fr": "french",
|
|
"de": "german",
|
|
"el": "greek",
|
|
"hu": "hungarian",
|
|
"it": "italian",
|
|
"la": "latin",
|
|
"no": "norwegian",
|
|
"pl": "polish",
|
|
"pt": "portuguese",
|
|
"ru": "russian",
|
|
"sl": "slovenian",
|
|
"es": "spanish",
|
|
"sv": "swedish",
|
|
"tr": "turkish",
|
|
"elv": "elvish",
|
|
}
|
|
|
|
LINGUEE_LANGUAGES_TO_CODES = {
|
|
"maltese": "mt",
|
|
"english": "en",
|
|
"german": "de",
|
|
"bulgarian": "bg",
|
|
"polish": "pl",
|
|
"portuguese": "pt",
|
|
"hungarian": "hu",
|
|
"romanian": "ro",
|
|
"russian": "ru",
|
|
# "serbian": "sr",
|
|
"dutch": "nl",
|
|
"slovakian": "sk",
|
|
"greek": "el",
|
|
"slovenian": "sl",
|
|
"danish": "da",
|
|
"italian": "it",
|
|
"spanish": "es",
|
|
"finnish": "fi",
|
|
"chinese": "zh",
|
|
"french": "fr",
|
|
# "croatian": "hr",
|
|
"czech": "cs",
|
|
"laotian": "lo",
|
|
"swedish": "sv",
|
|
"latvian": "lv",
|
|
"estonian": "et",
|
|
"japanese": "ja",
|
|
}
|
|
|
|
DEEPL_LANGUAGE_TO_CODE = {
|
|
"bulgarian": "bg",
|
|
"czech": "cs",
|
|
"danish": "da",
|
|
"german": "de",
|
|
"greek": "el",
|
|
"english": "en",
|
|
"spanish": "es",
|
|
"estonian": "et",
|
|
"finnish": "fi",
|
|
"french": "fr",
|
|
"hungarian": "hu",
|
|
"italian": "it",
|
|
"japanese": "ja",
|
|
"lithuanian": "lt",
|
|
"latvian": "lv",
|
|
"dutch": "nl",
|
|
"polish": "pl",
|
|
"portuguese": "pt",
|
|
"romanian": "ro",
|
|
"russian": "ru",
|
|
"slovak": "sk",
|
|
"slovenian": "sl",
|
|
"swedish": "sv",
|
|
"chinese": "zh",
|
|
}
|
|
|
|
PAPAGO_LANGUAGE_TO_CODE = {
|
|
"ko": "Korean",
|
|
"en": "English",
|
|
"ja": "Japanese",
|
|
"zh-CN": "Chinese",
|
|
"zh-TW": "Chinese traditional",
|
|
"es": "Spanish",
|
|
"fr": "French",
|
|
"vi": "Vietnamese",
|
|
"th": "Thai",
|
|
"id": "Indonesia",
|
|
}
|
|
|
|
QCRI_LANGUAGE_TO_CODE = {"Arabic": "ar", "English": "en", "Spanish": "es"}
|
|
|
|
LIBRE_LANGUAGES_TO_CODES = {
|
|
"English": "en",
|
|
"Arabic": "ar",
|
|
"Chinese": "zh",
|
|
"French": "fr",
|
|
"German": "de",
|
|
"Hindi": "hi",
|
|
"Indonesian": "id",
|
|
"Irish": "ga",
|
|
"Italian": "it",
|
|
"Japanese": "ja",
|
|
"Korean": "ko",
|
|
"Polish": "pl",
|
|
"Portuguese": "pt",
|
|
"Russian": "ru",
|
|
"Spanish": "es",
|
|
"Turkish": "tr",
|
|
"Vietnamese": "vi",
|
|
}
|