2017-03-10 11:19:46 +01:00
|
|
|
DEFAULT_USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)'
|
2015-07-06 07:31:08 +02:00
|
|
|
|
2020-10-02 20:59:42 +02:00
|
|
|
DEFAULT_SERVICE_URLS = ('translate.google.ac', 'translate.google.ad', 'translate.google.ae',
|
|
|
|
'translate.google.al', 'translate.google.am', 'translate.google.as',
|
|
|
|
'translate.google.at', 'translate.google.az', 'translate.google.ba',
|
|
|
|
'translate.google.be', 'translate.google.bf', 'translate.google.bg',
|
|
|
|
'translate.google.bi', 'translate.google.bj', 'translate.google.bs',
|
|
|
|
'translate.google.bt', 'translate.google.by', 'translate.google.ca',
|
|
|
|
'translate.google.cat', 'translate.google.cc', 'translate.google.cd',
|
|
|
|
'translate.google.cf', 'translate.google.cg', 'translate.google.ch',
|
|
|
|
'translate.google.ci', 'translate.google.cl', 'translate.google.cm',
|
|
|
|
'translate.google.cn', 'translate.google.co.ao', 'translate.google.co.bw',
|
|
|
|
'translate.google.co.ck', 'translate.google.co.cr', 'translate.google.co.id',
|
|
|
|
'translate.google.co.il', 'translate.google.co.in', 'translate.google.co.jp',
|
|
|
|
'translate.google.co.ke', 'translate.google.co.kr', 'translate.google.co.ls',
|
|
|
|
'translate.google.co.ma', 'translate.google.co.mz', 'translate.google.co.nz',
|
|
|
|
'translate.google.co.th', 'translate.google.co.tz', 'translate.google.co.ug',
|
|
|
|
'translate.google.co.uk', 'translate.google.co.uz', 'translate.google.co.ve',
|
|
|
|
'translate.google.co.vi', 'translate.google.co.za', 'translate.google.co.zm',
|
|
|
|
'translate.google.co.zw', 'translate.google.com.af', 'translate.google.com.ag',
|
|
|
|
'translate.google.com.ai', 'translate.google.com.ar', 'translate.google.com.au',
|
|
|
|
'translate.google.com.bd', 'translate.google.com.bh', 'translate.google.com.bn',
|
|
|
|
'translate.google.com.bo', 'translate.google.com.br', 'translate.google.com.bz',
|
|
|
|
'translate.google.com.co', 'translate.google.com.cu', 'translate.google.com.cy',
|
|
|
|
'translate.google.com.do', 'translate.google.com.ec', 'translate.google.com.eg',
|
|
|
|
'translate.google.com.et', 'translate.google.com.fj', 'translate.google.com.gh',
|
|
|
|
'translate.google.com.gi', 'translate.google.com.gt', 'translate.google.com.hk',
|
|
|
|
'translate.google.com.jm', 'translate.google.com.kh', 'translate.google.com.kw',
|
|
|
|
'translate.google.com.lb', 'translate.google.com.ly', 'translate.google.com.mm',
|
|
|
|
'translate.google.com.mt', 'translate.google.com.mx', 'translate.google.com.my',
|
|
|
|
'translate.google.com.na', 'translate.google.com.ng', 'translate.google.com.ni',
|
|
|
|
'translate.google.com.np', 'translate.google.com.om', 'translate.google.com.pa',
|
|
|
|
'translate.google.com.pe', 'translate.google.com.pg', 'translate.google.com.ph',
|
|
|
|
'translate.google.com.pk', 'translate.google.com.pr', 'translate.google.com.py',
|
|
|
|
'translate.google.com.qa', 'translate.google.com.sa', 'translate.google.com.sb',
|
|
|
|
'translate.google.com.sg', 'translate.google.com.sl', 'translate.google.com.sv',
|
|
|
|
'translate.google.com.tj', 'translate.google.com.tr', 'translate.google.com.tw',
|
|
|
|
'translate.google.com.ua', 'translate.google.com.uy', 'translate.google.com.vc',
|
|
|
|
'translate.google.com.vn', 'translate.google.com', 'translate.google.cv',
|
|
|
|
'translate.google.cz', 'translate.google.de', 'translate.google.dj',
|
|
|
|
'translate.google.dk', 'translate.google.dm', 'translate.google.dz',
|
|
|
|
'translate.google.ee', 'translate.google.es', 'translate.google.eu',
|
|
|
|
'translate.google.fi', 'translate.google.fm', 'translate.google.fr',
|
|
|
|
'translate.google.ga', 'translate.google.ge', 'translate.google.gf',
|
|
|
|
'translate.google.gg', 'translate.google.gl', 'translate.google.gm',
|
|
|
|
'translate.google.gp', 'translate.google.gr', 'translate.google.gy',
|
|
|
|
'translate.google.hn', 'translate.google.hr', 'translate.google.ht',
|
|
|
|
'translate.google.hu', 'translate.google.ie', 'translate.google.im',
|
|
|
|
'translate.google.io', 'translate.google.iq', 'translate.google.is',
|
|
|
|
'translate.google.it', 'translate.google.je', 'translate.google.jo',
|
|
|
|
'translate.google.kg', 'translate.google.ki', 'translate.google.kz',
|
|
|
|
'translate.google.la', 'translate.google.li', 'translate.google.lk',
|
|
|
|
'translate.google.lt', 'translate.google.lu', 'translate.google.lv',
|
|
|
|
'translate.google.md', 'translate.google.me', 'translate.google.mg',
|
|
|
|
'translate.google.mk', 'translate.google.ml', 'translate.google.mn',
|
|
|
|
'translate.google.ms', 'translate.google.mu', 'translate.google.mv',
|
|
|
|
'translate.google.mw', 'translate.google.ne', 'translate.google.nf',
|
|
|
|
'translate.google.nl', 'translate.google.no', 'translate.google.nr',
|
|
|
|
'translate.google.nu', 'translate.google.pl', 'translate.google.pn',
|
|
|
|
'translate.google.ps', 'translate.google.pt', 'translate.google.ro',
|
|
|
|
'translate.google.rs', 'translate.google.ru', 'translate.google.rw',
|
|
|
|
'translate.google.sc', 'translate.google.se', 'translate.google.sh',
|
|
|
|
'translate.google.si', 'translate.google.sk', 'translate.google.sm',
|
|
|
|
'translate.google.sn', 'translate.google.so', 'translate.google.sr',
|
|
|
|
'translate.google.st', 'translate.google.td', 'translate.google.tg',
|
|
|
|
'translate.google.tk', 'translate.google.tl', 'translate.google.tm',
|
|
|
|
'translate.google.tn', 'translate.google.to', 'translate.google.tt',
|
|
|
|
'translate.google.us', 'translate.google.vg', 'translate.google.vu',
|
|
|
|
'translate.google.ws')
|
|
|
|
|
2015-07-17 17:19:16 +02:00
|
|
|
SPECIAL_CASES = {
|
|
|
|
'ee': 'et',
|
|
|
|
}
|
|
|
|
|
2015-07-06 07:31:08 +02:00
|
|
|
LANGUAGES = {
|
|
|
|
'af': 'afrikaans',
|
|
|
|
'sq': 'albanian',
|
2017-08-08 13:42:33 +02:00
|
|
|
'am': 'amharic',
|
2015-07-06 07:31:08 +02:00
|
|
|
'ar': 'arabic',
|
2017-08-08 13:42:33 +02:00
|
|
|
'hy': 'armenian',
|
|
|
|
'az': 'azerbaijani',
|
|
|
|
'eu': 'basque',
|
2015-07-06 07:31:08 +02:00
|
|
|
'be': 'belarusian',
|
2017-08-08 13:42:33 +02:00
|
|
|
'bn': 'bengali',
|
|
|
|
'bs': 'bosnian',
|
2015-07-06 07:31:08 +02:00
|
|
|
'bg': 'bulgarian',
|
|
|
|
'ca': 'catalan',
|
2017-08-08 13:42:33 +02:00
|
|
|
'ceb': 'cebuano',
|
|
|
|
'ny': 'chichewa',
|
2017-08-09 13:58:08 +02:00
|
|
|
'zh-cn': 'chinese (simplified)',
|
|
|
|
'zh-tw': 'chinese (traditional)',
|
2017-08-08 13:42:33 +02:00
|
|
|
'co': 'corsican',
|
2015-07-06 07:31:08 +02:00
|
|
|
'hr': 'croatian',
|
|
|
|
'cs': 'czech',
|
|
|
|
'da': 'danish',
|
|
|
|
'nl': 'dutch',
|
|
|
|
'en': 'english',
|
|
|
|
'eo': 'esperanto',
|
|
|
|
'et': 'estonian',
|
|
|
|
'tl': 'filipino',
|
|
|
|
'fi': 'finnish',
|
|
|
|
'fr': 'french',
|
2017-08-08 13:42:33 +02:00
|
|
|
'fy': 'frisian',
|
2015-07-06 07:31:08 +02:00
|
|
|
'gl': 'galician',
|
2017-08-08 13:42:33 +02:00
|
|
|
'ka': 'georgian',
|
2015-07-06 07:31:08 +02:00
|
|
|
'de': 'german',
|
|
|
|
'el': 'greek',
|
2017-08-08 13:42:33 +02:00
|
|
|
'gu': 'gujarati',
|
2017-08-09 13:58:08 +02:00
|
|
|
'ht': 'haitian creole',
|
2017-08-08 13:42:33 +02:00
|
|
|
'ha': 'hausa',
|
|
|
|
'haw': 'hawaiian',
|
2015-07-06 07:31:08 +02:00
|
|
|
'iw': 'hebrew',
|
2020-06-08 12:09:24 +02:00
|
|
|
'he': 'hebrew',
|
2015-07-06 07:31:08 +02:00
|
|
|
'hi': 'hindi',
|
2017-08-08 13:42:33 +02:00
|
|
|
'hmn': 'hmong',
|
2015-07-06 07:31:08 +02:00
|
|
|
'hu': 'hungarian',
|
|
|
|
'is': 'icelandic',
|
2017-08-08 13:42:33 +02:00
|
|
|
'ig': 'igbo',
|
2015-07-06 07:31:08 +02:00
|
|
|
'id': 'indonesian',
|
|
|
|
'ga': 'irish',
|
|
|
|
'it': 'italian',
|
|
|
|
'ja': 'japanese',
|
2017-08-08 13:42:33 +02:00
|
|
|
'jw': 'javanese',
|
|
|
|
'kn': 'kannada',
|
|
|
|
'kk': 'kazakh',
|
|
|
|
'km': 'khmer',
|
2015-07-06 07:31:08 +02:00
|
|
|
'ko': 'korean',
|
2017-08-09 13:58:08 +02:00
|
|
|
'ku': 'kurdish (kurmanji)',
|
2017-08-08 13:42:33 +02:00
|
|
|
'ky': 'kyrgyz',
|
|
|
|
'lo': 'lao',
|
2015-07-06 07:31:08 +02:00
|
|
|
'la': 'latin',
|
|
|
|
'lv': 'latvian',
|
|
|
|
'lt': 'lithuanian',
|
2017-08-08 13:42:33 +02:00
|
|
|
'lb': 'luxembourgish',
|
2015-07-06 07:31:08 +02:00
|
|
|
'mk': 'macedonian',
|
2017-08-08 13:42:33 +02:00
|
|
|
'mg': 'malagasy',
|
2015-07-06 07:31:08 +02:00
|
|
|
'ms': 'malay',
|
2017-08-08 13:42:33 +02:00
|
|
|
'ml': 'malayalam',
|
2015-07-06 07:31:08 +02:00
|
|
|
'mt': 'maltese',
|
2017-08-08 13:42:33 +02:00
|
|
|
'mi': 'maori',
|
|
|
|
'mr': 'marathi',
|
|
|
|
'mn': 'mongolian',
|
2017-08-09 13:58:08 +02:00
|
|
|
'my': 'myanmar (burmese)',
|
2017-08-08 13:42:33 +02:00
|
|
|
'ne': 'nepali',
|
2015-07-06 07:31:08 +02:00
|
|
|
'no': 'norwegian',
|
2020-06-08 17:28:52 +02:00
|
|
|
'or': 'odia',
|
2017-08-08 13:42:33 +02:00
|
|
|
'ps': 'pashto',
|
2015-07-06 07:31:08 +02:00
|
|
|
'fa': 'persian',
|
|
|
|
'pl': 'polish',
|
|
|
|
'pt': 'portuguese',
|
2017-08-08 13:42:33 +02:00
|
|
|
'pa': 'punjabi',
|
2015-07-06 07:31:08 +02:00
|
|
|
'ro': 'romanian',
|
|
|
|
'ru': 'russian',
|
2017-08-08 13:42:33 +02:00
|
|
|
'sm': 'samoan',
|
2017-08-09 13:58:08 +02:00
|
|
|
'gd': 'scots gaelic',
|
2015-07-06 07:31:08 +02:00
|
|
|
'sr': 'serbian',
|
2017-08-08 13:42:33 +02:00
|
|
|
'st': 'sesotho',
|
|
|
|
'sn': 'shona',
|
|
|
|
'sd': 'sindhi',
|
|
|
|
'si': 'sinhala',
|
2015-07-06 07:31:08 +02:00
|
|
|
'sk': 'slovak',
|
|
|
|
'sl': 'slovenian',
|
2017-08-08 13:42:33 +02:00
|
|
|
'so': 'somali',
|
2015-07-06 07:31:08 +02:00
|
|
|
'es': 'spanish',
|
2017-08-08 13:42:33 +02:00
|
|
|
'su': 'sundanese',
|
2015-07-06 07:31:08 +02:00
|
|
|
'sw': 'swahili',
|
|
|
|
'sv': 'swedish',
|
2017-08-08 13:42:33 +02:00
|
|
|
'tg': 'tajik',
|
|
|
|
'ta': 'tamil',
|
|
|
|
'te': 'telugu',
|
2015-07-06 07:31:08 +02:00
|
|
|
'th': 'thai',
|
|
|
|
'tr': 'turkish',
|
|
|
|
'uk': 'ukrainian',
|
2017-08-08 13:42:33 +02:00
|
|
|
'ur': 'urdu',
|
2020-06-08 12:09:59 +02:00
|
|
|
'ug': 'uyghur',
|
2017-08-08 13:42:33 +02:00
|
|
|
'uz': 'uzbek',
|
2015-07-06 07:31:08 +02:00
|
|
|
'vi': 'vietnamese',
|
|
|
|
'cy': 'welsh',
|
2017-08-08 13:42:33 +02:00
|
|
|
'xh': 'xhosa',
|
2015-07-06 07:31:08 +02:00
|
|
|
'yi': 'yiddish',
|
2017-08-08 13:42:33 +02:00
|
|
|
'yo': 'yoruba',
|
2017-10-23 05:41:59 +02:00
|
|
|
'zu': 'zulu',
|
2017-08-08 13:42:33 +02:00
|
|
|
}
|
2017-06-01 15:50:13 +02:00
|
|
|
|
|
|
|
LANGCODES = dict(map(reversed, LANGUAGES.items()))
|
2020-06-14 08:42:32 +02:00
|
|
|
DEFAULT_RAISE_EXCEPTION = False
|
|
|
|
DUMMY_DATA = [[["", None, None, 0]], None, "en", None,
|
|
|
|
None, None, 1, None, [["en"], None, [1], ["en"]]]
|