From 1e6667a9edbc18f1b19da3fd6acc8ee913a97cbd Mon Sep 17 00:00:00 2001 From: Encrylize Date: Tue, 8 Aug 2017 13:42:33 +0200 Subject: [PATCH] Add missing languages (#30) * Add missing languages * Fix Punjabi language code --- googletrans/constants.py | 52 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/googletrans/constants.py b/googletrans/constants.py index a598ae4..d419433 100644 --- a/googletrans/constants.py +++ b/googletrans/constants.py @@ -7,12 +7,21 @@ SPECIAL_CASES = { LANGUAGES = { 'af': 'afrikaans', 'sq': 'albanian', + 'am': 'amharic', 'ar': 'arabic', + 'hy': 'armenian', + 'az': 'azerbaijani', + 'eu': 'basque', 'be': 'belarusian', + 'bn': 'bengali', + 'bs': 'bosnian', 'bg': 'bulgarian', 'ca': 'catalan', + 'ceb': 'cebuano', + 'ny': 'chichewa', 'zh-CN': 'chinese_simplified', 'zh-TW': 'chinese_traditional', + 'co': 'corsican', 'hr': 'croatian', 'cs': 'czech', 'da': 'danish', @@ -23,42 +32,83 @@ LANGUAGES = { 'tl': 'filipino', 'fi': 'finnish', 'fr': 'french', + 'fy': 'frisian', 'gl': 'galician', + 'ka': 'georgian', 'de': 'german', 'el': 'greek', + 'gu': 'gujarati', + 'ht': 'haitian_creole', + 'ha': 'hausa', + 'haw': 'hawaiian', 'iw': 'hebrew', 'hi': 'hindi', + 'hmn': 'hmong', 'hu': 'hungarian', 'is': 'icelandic', + 'ig': 'igbo', 'id': 'indonesian', 'ga': 'irish', 'it': 'italian', 'ja': 'japanese', + 'jw': 'javanese', + 'kn': 'kannada', + 'kk': 'kazakh', + 'km': 'khmer', 'ko': 'korean', + 'ku': 'kurdish', + 'ky': 'kyrgyz', + 'lo': 'lao', 'la': 'latin', 'lv': 'latvian', 'lt': 'lithuanian', + 'lb': 'luxembourgish', 'mk': 'macedonian', + 'mg': 'malagasy', 'ms': 'malay', + 'ml': 'malayalam', 'mt': 'maltese', + 'mi': 'maori', + 'mr': 'marathi', + 'mn': 'mongolian', + 'my': 'myanmar', + 'ne': 'nepali', 'no': 'norwegian', + 'ps': 'pashto', 'fa': 'persian', 'pl': 'polish', 'pt': 'portuguese', + 'pa': 'punjabi', 'ro': 'romanian', 'ru': 'russian', + 'sm': 'samoan', + 'gd': 'scots_gaelic', 'sr': 'serbian', + 'st': 'sesotho', + 'sn': 'shona', + 'sd': 'sindhi', + 'si': 'sinhala', 'sk': 'slovak', 'sl': 'slovenian', + 'so': 'somali', 'es': 'spanish', + 'su': 'sundanese', 'sw': 'swahili', 'sv': 'swedish', + 'tg': 'tajik', + 'ta': 'tamil', + 'te': 'telugu', 'th': 'thai', 'tr': 'turkish', 'uk': 'ukrainian', + 'ur': 'urdu', + 'uz': 'uzbek', 'vi': 'vietnamese', 'cy': 'welsh', + 'xh': 'xhosa', 'yi': 'yiddish', - } + 'yo': 'yoruba', + 'zu': 'zulu' +} LANGCODES = dict(map(reversed, LANGUAGES.items()))