├── setup.cfg ├── .github └── ISSUE_TEMPLATE │ ├── config.yml │ ├── gui_discussion.yml │ ├── feature_request.yml │ └── bug_report.yml ├── docs └── translators_logo.png ├── requirements.txt ├── MANIFEST.in ├── pyproject.toml ├── translators ├── __init__.py └── cli.py ├── setup.py ├── change_log.txt ├── LICENSE ├── README_history.md └── README.md /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | description_file = README.md 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false -------------------------------------------------------------------------------- /docs/translators_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UlionTse/translators/HEAD/docs/translators_logo.png -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | lxml 2 | tqdm 3 | exejs 4 | httpx 5 | pathos 6 | requests 7 | niquests 8 | cloudscraper 9 | cryptography 10 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.md 2 | include *.txt 3 | include *.cfg 4 | include *.toml 5 | include LICENSE 6 | recursive-include translators *.py 7 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools", "wheel"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [tool.isort] 6 | src_paths = ["translators"] 7 | -------------------------------------------------------------------------------- /translators/__init__.py: -------------------------------------------------------------------------------- 1 | __version__ = "6.0.1" 2 | __author__ = "UlionTse" 3 | 4 | 5 | from translators.server import ( 6 | translate_text, 7 | translate_html, 8 | translators_pool, 9 | get_languages, 10 | get_region_of_server, 11 | preaccelerate_and_speedtest, 12 | ) 13 | 14 | 15 | __all__ = ( 16 | "__version__", 17 | "__author__", 18 | "translate_text", 19 | "translate_html", 20 | "translators_pool", 21 | "get_languages", 22 | "get_region_of_server", 23 | "preaccelerate_and_speedtest", 24 | ) 25 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/gui_discussion.yml: -------------------------------------------------------------------------------- 1 | name: GUI Discussion 2 | description: File a GUI discussion 3 | title: "[GUI]: " 4 | assignees: 5 | - UlionTse 6 | - Azornes 7 | body: 8 | - type: markdown 9 | attributes: 10 | value: | 11 | Thanks for taking the time to fill out this GUI discussion! 12 | - type: checkboxes 13 | id: discussion-tips 14 | attributes: 15 | label: discussion Tips 16 | description: To improve discussion efficiency, please read [GUI(ocrTranslator) from third-party](https://github.com/UlionTse/translators/issues/120#issuecomment-1523482625) first. 17 | options: 18 | - label: I'm sure I've read this project's README. 19 | required: true 20 | - type: textarea 21 | id: what-happened 22 | attributes: 23 | label: What happened about GUI(more backend)? 24 | description: Also tell us, what did you expect to happen? 25 | placeholder: Tell us what you see! 26 | value: "A bug happened!" 27 | validations: 28 | required: true 29 | - type: dropdown 30 | id: runtime-environment 31 | attributes: 32 | label: Runtime Environment 33 | description: What runtime environment(OS) are you running? 34 | options: 35 | - "Linux Ubuntu (default)" 36 | - "Linux CentOS" 37 | - "Windows" 38 | - "MacOS" 39 | - "Other" 40 | validations: 41 | required: true 42 | - type: input 43 | id: region 44 | attributes: 45 | label: Country/Region 46 | description: What Country(Region) are you running? (Translation services may be different in different regions) 47 | placeholder: Tell us what you see! 48 | value: "Qatar (example)" 49 | validations: 50 | required: true 51 | - type: textarea 52 | id: logs 53 | attributes: 54 | label: Relevant log output 55 | description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. 56 | render: sh 57 | validations: 58 | required: false 59 | - type: textarea 60 | id: screenshot 61 | attributes: 62 | label: "Screenshots" 63 | description: If applicable, add screenshots to help explain your problem. 64 | value: | 65 | ![DESCRIPTION](LINK.png) 66 | render: Markdown 67 | validations: 68 | required: false 69 | - type: checkboxes 70 | id: terms 71 | attributes: 72 | label: Code of Conduct 73 | description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/UlionTse/translators/blob/master/LICENSE) 74 | options: 75 | - label: I agree to follow this project's Code of Conduct 76 | required: true -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature Request 2 | description: File a feature request 3 | title: "[Feature]: " 4 | assignees: 5 | - UlionTse 6 | body: 7 | - type: markdown 8 | attributes: 9 | value: | 10 | Thanks for taking the time to fill out this feature request! 11 | - type: textarea 12 | id: expect-to-happened 13 | attributes: 14 | label: Expect to happened 15 | description: What happened, and what did you expect to happen? 16 | placeholder: Tell us what you see! 17 | value: "A feature I have expected ..." 18 | validations: 19 | required: true 20 | - type: dropdown 21 | id: expected-app-version 22 | attributes: 23 | label: Expected APP Version 24 | description: What version of App(or PYPI) did you expect? 25 | options: 26 | - next newest version 27 | - a future version 28 | validations: 29 | required: true 30 | - type: dropdown 31 | id: expected-python-version 32 | attributes: 33 | label: Expected Python Version 34 | description: What version of python did you expect? 35 | options: 36 | - ">=3.12 (default)" 37 | - ">=3.11" 38 | - ">=3.10" 39 | - ">=3.9" 40 | - ">=3.8" 41 | - "<3.8" 42 | validations: 43 | required: true 44 | - type: dropdown 45 | id: expected-runtime-environment 46 | attributes: 47 | label: Expected Runtime Environment 48 | description: What runtime environment(OS) did you expect? 49 | options: 50 | - "NoArch (default)" 51 | - "Linux Ubuntu" 52 | - "Linux CentOS" 53 | - "Windows" 54 | - "MacOS" 55 | - "Other" 56 | validations: 57 | required: true 58 | - type: input 59 | id: region 60 | attributes: 61 | label: Country/Region 62 | description: What Country(Region) did you expect? (Translation services may be different in different regions) 63 | placeholder: Tell us what you see! 64 | value: "Qatar(example)" 65 | validations: 66 | required: true 67 | - type: textarea 68 | id: expected-output 69 | attributes: 70 | label: Expected Output 71 | description: Please copy and paste any expected output. This will be automatically formatted into code, so no need for backticks. 72 | render: sh 73 | validations: 74 | required: false 75 | - type: checkboxes 76 | id: terms 77 | attributes: 78 | label: Code of Conduct 79 | description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/UlionTse/translators/blob/master/LICENSE) 80 | options: 81 | - label: I agree to follow this project's Code of Conduct 82 | required: true -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug Report 2 | description: File a bug report 3 | title: "[Bug]: " 4 | assignees: 5 | - UlionTse 6 | body: 7 | - type: markdown 8 | attributes: 9 | value: | 10 | Thanks for taking the time to fill out this bug report! 11 | - type: checkboxes 12 | id: debug-tips 13 | attributes: 14 | label: Debug Tips 15 | description: To improve debug efficiency, please read [Issues of README](https://github.com/UlionTse/translators#issues) first. 16 | options: 17 | - label: I'm sure I've read this project's Issues of README. 18 | required: true 19 | - type: textarea 20 | id: what-happened 21 | attributes: 22 | label: What happened? 23 | description: Also tell us, what did you expect to happen? 24 | placeholder: Tell us what you see! 25 | value: "A bug happened!" 26 | validations: 27 | required: true 28 | - type: input 29 | id: app-version 30 | attributes: 31 | label: APP Version 32 | description: What version of App(or PYPI) are you running? 33 | placeholder: Tell us what you see! 34 | value: "5.9.3 (default)" 35 | validations: 36 | required: true 37 | - type: dropdown 38 | id: python-version 39 | attributes: 40 | label: Python Version 41 | description: What version of python are you running? 42 | options: 43 | - "3.12 (default)" 44 | - "3.11" 45 | - "3.10" 46 | - "3.9" 47 | - "3.8" 48 | - "<3.8" 49 | validations: 50 | required: true 51 | - type: dropdown 52 | id: runtime-environment 53 | attributes: 54 | label: Runtime Environment 55 | description: What runtime environment(OS) are you running? 56 | options: 57 | - "Linux Ubuntu (default)" 58 | - "Linux CentOS" 59 | - "Windows" 60 | - "MacOS" 61 | - "Other" 62 | validations: 63 | required: true 64 | - type: input 65 | id: region 66 | attributes: 67 | label: Country/Region 68 | description: What Country(Region) are you running? (Translation services may be different in different regions) 69 | placeholder: Tell us what you see! 70 | value: "Qatar (example)" 71 | validations: 72 | required: true 73 | - type: textarea 74 | id: logs 75 | attributes: 76 | label: Relevant log output 77 | description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. 78 | render: sh 79 | validations: 80 | required: false 81 | - type: textarea 82 | id: screenshot 83 | attributes: 84 | label: "Screenshots" 85 | description: If applicable, add screenshots to help explain your problem. 86 | value: | 87 | ![DESCRIPTION](LINK.png) 88 | render: Markdown 89 | validations: 90 | required: false 91 | - type: checkboxes 92 | id: terms 93 | attributes: 94 | label: Code of Conduct 95 | description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/UlionTse/translators/blob/master/LICENSE) 96 | options: 97 | - label: I agree to follow this project's Code of Conduct 98 | required: true -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | # author=UlionTse 3 | 4 | import re 5 | import pathlib 6 | import setuptools 7 | 8 | 9 | NAME = "translators" 10 | PACKAGE = "translators" 11 | 12 | AUTHOR = "UlionTse" 13 | AUTHOR_EMAIL = "uliontse@outlook.com" 14 | HOMEPAGE_URL = "https://github.com/uliontse/translators" 15 | DESCRIPTION = "Translators is a library that aims to bring free, multiple, enjoyable translations to individuals and students in Python." 16 | LONG_DESCRIPTION = pathlib.Path('README.md').read_text(encoding='utf-8') 17 | VERSION_TEXT = pathlib.Path(f'{PACKAGE}/__init__.py').read_text(encoding='utf-8') 18 | VERSION = re.compile('^__version__\\s*=\\s*[\'"]([^\'"]*)[\'"]', re.MULTILINE).search(VERSION_TEXT).group(1) 19 | 20 | 21 | setuptools.setup( 22 | name=NAME, 23 | version=VERSION, 24 | description=DESCRIPTION, 25 | long_description=LONG_DESCRIPTION, 26 | long_description_content_type="text/markdown", 27 | author=AUTHOR, 28 | author_email=AUTHOR_EMAIL, 29 | license="GPLv3", 30 | packages=setuptools.find_packages(), 31 | include_package_data=True, 32 | package_dir={"translators": "translators"}, 33 | url=HOMEPAGE_URL, 34 | project_urls={ 35 | 'Source': 'https://github.com/UlionTse/translators', 36 | 'Changelog': 'https://github.com/UlionTse/translators/blob/master/change_log.txt', 37 | 'Documentation': 'https://github.com/UlionTse/translators/blob/master/README.md', 38 | }, 39 | classifiers=[ 40 | "Development Status :: 5 - Production/Stable", 41 | "Environment :: Web Environment", 42 | "Intended Audience :: Developers", 43 | "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", 44 | "Programming Language :: Python :: 3 :: Only", 45 | "Programming Language :: Python :: 3.8", 46 | "Programming Language :: Python :: 3.9", 47 | "Programming Language :: Python :: 3.10", 48 | "Programming Language :: Python :: 3.11", 49 | "Programming Language :: Python :: 3.12", 50 | "Programming Language :: Python :: 3.13", 51 | ], 52 | keywords=[ 53 | 'translate', 'translate_text', 'translate_html', 54 | 'alibaba', 'apertium', 'argos', 'baidu', 'bing', 55 | 'caiyun', 'cloudTranslation', 'deepl', 'elia', 'google', 56 | 'hujiang', 'iciba', 'iflytek', 'iflyrec', 'itranslate', 57 | 'judic', 'languageWire', 'lingvanex', 'mglip', 'mirai', 58 | 'modernMt', 'myMemory', 'niutrans', 'papago', 'qqFanyi', 59 | 'qqTranSmart', 'reverso', 'sogou', 'sysTran', 'tilde', 60 | 'translateCom', 'translateMe', 'utibet', 'volcEngine', 'yandex', 61 | 'yeekit', 'youdao', 62 | ], 63 | install_requires=[ 64 | 'httpx>=0.28.1', 65 | 'requests>=2.32.3', 66 | 'niquests>=3.14.0', 67 | 'exejs>=0.0.4', 68 | 'lxml>=5.4.0', 69 | 'tqdm>=4.67.1', 70 | 'pathos>=0.3.4', 71 | 'cloudscraper>=1.2.71', 72 | 'cryptography>=42.0.4', 73 | ], 74 | python_requires='>=3.8', 75 | extras_require={'pypi': ['build>=1.2.2', 'twine>=6.1.0', 'setuptools>=75.3.0']}, 76 | zip_safe=False, 77 | entry_points={ 78 | 'console_scripts': 79 | [ 80 | 'fanyi = translators.cli:translate_cli' 81 | ] 82 | }, 83 | ) 84 | -------------------------------------------------------------------------------- /translators/cli.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | # author=UlionTse 3 | 4 | """ 5 | Copyright (C) 2017 UlionTse 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | 20 | Email: uliontse@outlook.com 21 | 22 | translators Copyright (C) 2017 UlionTse 23 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 24 | This is free software, and you are welcome to redistribute it 25 | under certain conditions; type `show c' for details. 26 | """ 27 | 28 | import os 29 | import sys 30 | import platform 31 | import argparse 32 | 33 | from . import __version__, translate_text, translate_html 34 | 35 | 36 | def translate_cli() -> None: 37 | parser = argparse.ArgumentParser( 38 | description='Translators(fanyi for CLI) is a library that aims to bring free, multiple, enjoyable translations ' 39 | 'to individuals and students in Python.' 40 | ) 41 | parser.add_argument( 42 | 'input', 43 | help='Raw text or path to a file to be translated.' 44 | ) 45 | parser.add_argument( 46 | '--translator', 47 | action='store', 48 | default='bing', 49 | type=str, 50 | dest='translator', 51 | help='eg: bing, google, yandex, etc...', 52 | ) 53 | parser.add_argument( 54 | '--from', 55 | action='store', 56 | default='auto', 57 | type=str, 58 | dest='from_language', 59 | help='from_language, default `auto` detected.', 60 | ) 61 | parser.add_argument( 62 | '--to', 63 | action='store', 64 | default='en', 65 | type=str, 66 | dest='to_language', 67 | help='to_language, default `en`.', 68 | ) 69 | parser.add_argument( 70 | '--is_html', 71 | action='store', 72 | default=0, 73 | type=int, 74 | dest='is_html', 75 | help='is_html, default `0`.', 76 | ) 77 | parser.add_argument( 78 | '--version', 79 | action='version', 80 | version='Translators(fanyi for CLI) {} - Python {}'.format(__version__, platform.python_version()), 81 | help='show version information.', 82 | ) 83 | args = parser.parse_args() 84 | 85 | if os.path.exists(args.input): 86 | try: 87 | with open(args.input, 'r', encoding='utf-8') as file: 88 | query_text = file.read() 89 | except Exception as e: 90 | print(str(e)) 91 | sys.exit(1) 92 | else: 93 | query_text = args.input 94 | 95 | try: 96 | translate_fn = translate_html if bool(args.is_html) else translate_text 97 | result = translate_fn( 98 | query_text=query_text, 99 | translator=args.translator, 100 | from_language=args.from_language, 101 | to_language=args.to_language, 102 | ) 103 | print(result) 104 | except Exception as e: 105 | print(str(e)) 106 | sys.exit(1) 107 | return 108 | 109 | 110 | if __name__ == '__main__': 111 | translate_cli() 112 | -------------------------------------------------------------------------------- /change_log.txt: -------------------------------------------------------------------------------- 1 | 1.0.1 2 | build translate_api on 10, 10, 2017. 3 | 4 | ...(history) 5 | 6 | 2.2.2 7 | add `proxy`. 8 | 9 | 2.4.0 10 | add `youdao`. 11 | 12 | 2.4.2 13 | translate.google() 14 | 15 | 2.4.4 16 | simple README.rst 17 | add github homepage 18 | 19 | 3.0.0 20 | Due to incompatible code changes made in version 2.4.2, I should not upgrade the minor version number, 21 | but the major version number. This is a modification. Thanks for Sabrina's reminding. 22 | 23 | 4.0.0 24 | `translate_api` --> 'translators' 25 | Implementing multiple translators is my pursuit, and the existing module name is ambiguous, 26 | so upgrading the module name is something I have been exploring and thinking about. 27 | Now the name `translators` is more in line with the meaning of the module itself, 28 | and now I have no hesitation to upgrade, although the code upgrade and optimization is limited. 29 | 30 | upgraded `Warning`. 31 | 32 | 4.0.1 33 | fix "translators.google.cn" 34 | 35 | 4.0.2 36 | On PYPI, rst --> md. 37 | 38 | 4.0.4 39 | print --> raise,warn 40 | add 'zh-cn' 41 | del client=t 42 | 43 | 4.0.6 44 | raise fixed 45 | add license in code 46 | 47 | 4.0.8 48 | recover youdao() 49 | 50 | 4.1.0 51 | add tencent() 52 | 53 | 4.2.0 54 | add alibaba() 55 | use **kwargs 56 | proxy --> proxies 57 | make the license more formal 58 | 59 | 4.2.2 60 | from_language default 'auto' 61 | 62 | 4.3.0 63 | add baidu() 64 | 65 | 4.3.2 66 | apis.py (Framing) 67 | 68 | 4.4.0 69 | add bing() 70 | add sogou() 71 | 72 | 4.4.2 73 | make 'get_language_url' of alibaba stronger. 74 | make xpath pattern of bing stronger. 75 | 76 | 4.4.3 77 | fix youdao when from_language='auto' and youdao can not recognize which is language of query_text. 78 | 79 | 4.5.0 80 | add deepl() 81 | add TranslatorError 82 | use magic `sleep_seconds` 83 | upgrade README.md 84 | 85 | 4.5.4 86 | update README.md 87 | update License 88 | 89 | 4.5.8 90 | add `using xxx service backend` 91 | update README.md with issues 92 | upgrade debug log 93 | 94 | 4.5.14 95 | update README.md 96 | 97 | 4.6.0 98 | update README.md 99 | translator & translate-api upgrade version synchronously. 100 | 101 | 4.6.10 102 | make google('emoji') stronger. 103 | make requests of server region stronger. 104 | 105 | 4.6.18 106 | make youdao('sentences length more than 50','errCode40') stronger. 107 | 108 | 4.6.20 109 | make tencent(),deepl() stronger with language_map. 110 | make youdao() stronger with `action` and `lts`. 111 | speed request with `use_cache`. 112 | add type hints for function. 113 | `use_domain` --> `professional_field` 114 | 115 | 4.7.0 116 | add yandex() 117 | `use_cache` deletes if_none(a,b), because b will be computed first, so fix if ... else ... 118 | update README.md 119 | 120 | 121 | 4.7.1 122 | update README.md 123 | 124 | 4.7.2 125 | make deepl() strong with `content-type` of request headers. 126 | 127 | 4.7.3 128 | make output strong with '\n'. 129 | add translate_html(). 130 | 131 | 4.7.5 132 | upgrade translate_html(). 133 | upgrade baidu() by advice of user @mozbugbox. 134 | reuse requests session by advice of user @mozbugbox. #23 135 | 136 | 4.7.6 137 | remove parameter `use_cache`, default cache language_map. 138 | cache `tkk` in google(). 139 | fixed yandex() with `api_url` 140 | 141 | 4.7.7 142 | make `get_language_map` with google stronger. 143 | 144 | 4.7.8 145 | update README.md 146 | 147 | 4.7.9 148 | make `get_tkk` with google stronger. 149 | 150 | 4.7.11 151 | make deepl() stronger. 152 | 153 | 4.7.12 154 | add google_v2(). 155 | absolute import. 156 | 157 | 4.7.13 158 | fix bugs by replacing execjs.get().eval(...) to json.loads(...) for google_v2 159 | 160 | 4.7.14 161 | follow the provider to adjust the strategy for [baidu(), sogou(), youdao()]. 162 | 163 | 4.7.16 164 | make baidu() stronger with js_txt. 165 | 166 | 4.7.20 167 | fix google() can’t get a complete language map, temporary, to be improved. #37 #42 168 | fix bing(). 169 | fix deepl(). add language count from 11 to 24. 170 | fix default `sleep_seconds`. #39 171 | fix limit of `len(query_text)<5000`. #40 172 | add check_query_text(). 173 | make `get_headers()` stronger. 174 | make `translate_html()` time complexity from O(n) to O(1), multiprocessing. 175 | 176 | 4.8.0 177 | fix tencent(). 178 | fix bing(). 179 | fix google() can’t get a complete language map. 180 | delete temp_language_map 181 | fix `request_server_region_info`,can `input`. 182 | 183 | 4.8.1 184 | fix `request_server_region_info`, https -> http, merge user `@dadas190`. 185 | 186 | 4.9.1 187 | add caiyun(). 188 | 189 | 4.9.4 190 | fix `app.().js` changed. 191 | allow setting timeout. #47 192 | 193 | 4.9.5 194 | fix deepl(). The job of fixing `get_language_map()` is user `@BingLingGroup`'s merged. 195 | 196 | 4.10.0 197 | add argos(). 198 | fix caiyun(), update to correct resolution of "getting a change in lang's network address causing content parsing errors". 199 | fix whitespace of output. 200 | 201 | 4.11.0 202 | add iciba(). 203 | add iflytek(). 204 | fix caiyun() about `auto` error. 205 | 206 | 4.11.1 207 | update README.md 208 | update deepl() 209 | 210 | 4.11.3 211 | stronger google() about `consent.google.com`, merged from @mercuree. #57 212 | add param `reset_host_url` to google(). 213 | 214 | 4.11.4 215 | stronger iciba() about sensitive word. 216 | stronger baidu() and iflytek(). 217 | 218 | 5.0.0 219 | In order to avoid the troublesome phenomenon that '4.11.4' is less than '4.9.4', the smaller version number will be one in ten. 220 | fix yandex(). 221 | fix google() about headers. 222 | fix iflytek() about regex of getting language_map and use warn method but raise error about `from_language=auto`. 223 | 224 | 5.0.1 225 | stronger deepl() about `language_map`. 226 | update README.md 227 | 228 | 5.0.2 229 | Continuous follow-up fixes based on service changes:baidu(), deepl(), iflytek(). 230 | add more suitable python version. 231 | 232 | 5.1.0 233 | add reverso(). 234 | add itranslate(). 235 | add translateCom() but from microsoft, like bing(). 236 | change `assert` to `if not ...: raise ...`. 237 | ready to fix ifytek() about [geetest]. 238 | 239 | 5.1.1 240 | update readme.md 241 | 242 | 5.2.1 243 | add papago(). 244 | add utibet(). 245 | pause iflytek() and wait for the fix. 246 | 247 | 5.2.2 248 | fix multiprocessing.pool.close() of translate_html(). #67 249 | recover `query_text`='', return ''. 250 | add and fix input_limit. 251 | 252 | 5.3.0 253 | rebuild baidu() and add 2 versions. 254 | rebuild iflytek() v2. 255 | fix youdao() about get_sign(). #74 256 | stronger google() about parsing data, especially one word own two result. #69 257 | stronger multiprocessing, merged from @llabbasmkhll. #71, #72 258 | 259 | 5.3.1 260 | follow to change and recover iciba(). 261 | stronger papago(). 262 | 263 | 5.4.0 264 | add lingvanex(). 265 | add mglip(). 266 | add niutrans(). 267 | change baidu()'s default `version` to `v1`, and fix regexp bug. #78 268 | 269 | # todo: 270 | add niutrans() but need to debug it. 271 | change baidu()'s default `version` to `v1`, need to debug `v2`. 272 | 273 | 5.4.1 274 | upgrade readme.md 275 | 276 | 5.4.2 277 | fix func request_server_region_info(). 278 | 279 | 5.4.3 280 | fix func en_tran(). 281 | fix iflytek() about getting language_map. 282 | add self.default_country by `os.environ`, merged from @kevindragon #79 283 | stronger papago(). 284 | 285 | 5.4.6 286 | upgrade packaging of project. 287 | upload package to Anaconda. #90 288 | 289 | 290 | 5.4.8 291 | stronger baidu(). 292 | stronger caiyun(). 293 | stronger deepl(). #83 294 | rebuild niutrans(). 295 | stronger parsing data about splitting paragraph. 296 | 297 | 5.5.0 298 | rebuild code structure. 299 | add func translate_text(). 300 | stronger yandex(). 301 | 302 | 5.5.1 303 | add alibaba_v2(). 304 | reuse and update session. 305 | rebuild func index tree. 306 | decorator(get_language_map) 307 | decorator(check_query) 308 | decorator(time_stat) 309 | 310 | 5.5.3 311 | fix Tuple type < python 3.9 #99 312 | update readme.md with new parameters(function). 313 | stronger func time_stat(). 314 | stronger func translate_html(). 315 | 316 | 5.5.4 317 | stronger func check_query(). 318 | add youdao_v2(), youdao_v3(). 319 | stronger google() about parsing data. #100 320 | update readme.md 321 | 322 | 5.5.5 323 | stronger func time_stat(). 324 | stronger google() about parsing data. #101 325 | 326 | 5.5.6 327 | follow to change and recover bing(). #104 328 | follow to change and recover lingnavex(). 329 | 330 | 5.6.0 331 | tencent() --> qqFanyi(). 332 | add qqTranSmart(). 333 | add modernMT(). 334 | add myMemory(). 335 | add iflyrec(). 336 | add volcEngine() but not completed. #106 337 | follow to change and stronger baidu(), itranslate(), lingvanex(). 338 | add func and parameter `update_session_after_freq`. 339 | stronger func get_server_region(). 340 | change sleep_seconds from `random.random()` to default=0. 341 | update readme.md 342 | 343 | 5.6.1 344 | add preaccelerate(). 345 | stronger caiyun(), youdaoV1(). 346 | update readme.md 347 | 348 | 5.6.2 349 | stronger preaccelerate(). 350 | update and change structure of readme.md 351 | 352 | 5.6.3 353 | stronger preaccelerate() and add it to translate_text(). 354 | 355 | 5.7.0 356 | add sysTran() 357 | add apertium() 358 | add cloudYi() 359 | add tilde() 360 | add translateMe() 361 | add marai() #119 362 | add yeekit() 363 | add languageWire() 364 | add elia() 365 | add judic() 366 | stronger preaccelerate() 367 | 368 | 5.7.1 369 | python_requires='>=3.8'. 370 | add parameter `if_check_reset_host_url=True`. #124 371 | fix parameter `input_limit` vs `limit_of_length`. 372 | add information of `professional_field`. 373 | stronger regex. 374 | stronger preaccelerate(). 375 | 376 | 5.7.2 377 | stronger languageWire(). #127 378 | add func uncertified(). #128 379 | check yeekit(), server is bad now. #129 380 | update keywords of setup.py 381 | update readme.md 382 | 383 | 5.7.5 384 | stronger uncertified(). 385 | stronger debug_language_map(). 386 | stronger parameter type. 387 | drop all eval(). 388 | 389 | 5.7.6 390 | stronger translateMe(). 391 | stronger preaccelerate(). 392 | add preaccelerate_and_speedtest(). 393 | stronger debug_language_map(). 394 | fix debug_language_map() with from_language=auto but translator doesn't support auto. 395 | 396 | 5.7.7 397 | update license. 398 | update email. 399 | stronger parameter type. 400 | stronger sysTran(). 401 | check translateMe(), server is bad now. 402 | 403 | 5.7.8 404 | stronger myMemory() and add languages. #132 405 | update readme.md 406 | 407 | 5.7.9 408 | no change (only for updates of conda information) 409 | 410 | 5.8.0 411 | add func get_languages() 412 | stronger code of `update_session_after_freq`. #134 413 | stronger code of `update_session_after_seconds`. 414 | update readme.md 415 | 416 | 5.8.2 417 | stronger reverso(). #135 418 | replace cloudYi() to cloudTranslation(), add v2. 419 | fix alibaba_v1. 420 | update readme.md 421 | 422 | 5.8.3 423 | stronger caiyun(). #138 424 | stronger deepl(). 425 | stronger debug_language_map(). 426 | update niutransV2(). 427 | update readme.md 428 | 429 | 5.8.4 430 | stronger and fix translate_html(). #145 431 | set default parameter `if_ignore_empty_query=True`. 432 | set default parameter `n_jobs=1`. 433 | 434 | 5.8.5 435 | stronger debug_language_map(). #144 436 | delete get_consent_cookie()(And this PR error has never been reproduced by the author). #142 437 | update license. 438 | 439 | 5.8.7 440 | stronger deepl(). 441 | stronger bing(). #122 442 | stronger google(). #142, #144 443 | stronger get_server_region(). #110 444 | 445 | 5.8.8 446 | stronger argos(). 447 | stronger deepl(). 448 | stronger lingvanex(). 449 | 450 | 5.8.9 451 | stronger and update get_server_region(). #147 452 | 453 | 5.9.0 454 | add hujiang(). 455 | stronger iciba(). #151 456 | add bias_of_length with func check_query_text(). #154 457 | 458 | 5.9.1 459 | stronger baidu(). #155 460 | 461 | 5.9.2 462 | fix yandex(). #94 463 | 464 | 5.9.3 465 | stronger papago(). #161 466 | stronger yandex(). #162 467 | stronger argos(). 468 | stronger caiyun(). 469 | stronger lingvanex(). 470 | 471 | 5.9.4 472 | add http_client, (requests, niquests, httpx) 473 | add CLI named `fanyi`. #166 474 | stronger papago 475 | stronger reverso 476 | stronger utibet 477 | 478 | 5.9.6 479 | use exejs, remove pyexecjs. 480 | 481 | 5.9.8 482 | stronger class Region. #167 483 | 484 | 5.9.9 485 | need exejs>=0.0.4 # 169 486 | 487 | 6.0.0 488 | stronger papago(). 489 | stronger reverso() about Cloudflare. #161(reopen) 490 | add http_client, (requests, niquests, httpx, cloudscraper) 491 | stronger fanyi(cli) 492 | 493 | 6.0.1 494 | update Dependency's version 495 | upgrade conda version 496 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . -------------------------------------------------------------------------------- /README_history.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 |

5 | PyPI - Version 6 | Conda - Version 7 | PyPI - License 8 | PyPI - Python 9 | PyPI - Status 10 | PyPI - Wheel 11 | PyPI - Downloads 12 |

13 | 14 | * * * 15 | 16 | **Translators** is a library that aims to bring **free, multiple, enjoyable** translations to individuals and students in Python. 17 | 18 |
19 | Supported Translation Services 20 | 21 | | ID | Translator | Number of Supported Languages | Advantage | Service | Status | 22 | | --- | --------------------------------------------------------------------------------- | ----------------------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ------------------------------- | 23 | | 1 | [Niutrans](https://niutrans.com/trans) | 452 | support the most languages in the world | [Northeastern University](http://english.neu.edu.cn/) / [Niutrans](https://github.com/NiuTrans), China | / | 24 | | 2 | [MyMemory](https://mymemory.translated.net) | 330 | support the most languages in the world | [Translated](https://translatedlabs.com/welcome), Italy | stable | 25 | | 3 | [Alibaba](https://translate.alibaba.com) | 221 | support most languages, support professional field | [Alibaba](https://damo.alibaba.com/about?lang=en), China | stable | 26 | | 4 | [Baidu](https://fanyi.baidu.com) | 201 | support most languages, support professional field, support classical Chinese | [Baidu](https://ir.baidu.com/company-overview), China | stable | 27 | | 5 | [ModernMt](https://www.modernmt.com/translate) | 200 | open-source, support more languages in the world | [Modernmt](https://github.com/modernmt) / [Translated](https://translatedlabs.com/welcome), Italy | stable | 28 | | 6 | [VolcEngine](https://translate.volcengine.com) | 189 | support more languages in the world, support professional field | [ByteDance](https://www.bytedance.com/en/), China | / | 29 | | 7 | [Iciba](https://www.iciba.com/fy) | 187 | support the most languages in the world | [Kingsoft](https://www.wps.com/about-us/) / [Xiaomi](https://www.mi.com/us/about/), China | stable | 30 | | 8 | [Iflytek](https://fanyi.xfyun.cn/console/trans/text) | 137 | support the most languages in the world | [Iflytek](https://www.iflytek.com/en/about-us/about.html), China | / | 31 | | 9 | [Google](https://translate.google.com) | 134 | support more languages in the world | [Google](https://about.google/), America | stable(offline in China inland) | 32 | | 10 | [Bing](https://www.bing.com/Translator) | 128 | support more languages in the world | [Microsoft](https://www.microsoft.com/en-us/about), America | stable | 33 | | 11 | [Lingvanex](https://lingvanex.com/demo) | 112 | support translation of different regions but the same language | [Lingvanex](https://lingvanex.com/about-us/), Cyprus | stable | 34 | | 12 | [Yandex](https://translate.yandex.com) | 102 | support more languages in the world, support word to emoji | [Yandex](https://yandex.com/company/), Russia | stable | 35 | | 13 | [Itranslate](https://itranslate.com/webapp) | 101 | support translation of different regions but the same language, such as en-US, en-UK, en-AU | [Itranslate](https://itranslate.com/about), Austria | stable | 36 | | 14 | [SysTran](https://www.systransoft.com/translate/) | 52 | support more languages in the world | [SysTran](https://www.systransoft.com/systran/), France | stable | 37 | | 15 | [Argos](https://libretranslate.com) | 46 | open-source | [Argos](https://github.com/argosopentech) / [Libre](https://github.com/LibreTranslate), America | stable | 38 | | 16 | [Apertium](https://www.apertium.org/) | 45 | open-source | [Apertium](https://github.com/apertium), Spain | stable | 39 | | 17 | [Reverso](https://www.reverso.net/text-translation) | 42 | popular on Mac and Iphone | [Reverso](https://www.corporate-translation.reverso.com/about-us), France | stable | 40 | | 18 | [Deepl](https://www.deepl.com/translator) | 30 | high quality to translate but response slowly | [Deepl](https://jobs.deepl.com/l/en), Germany | stable | 41 | | 19 | [CloudTranslation](https://www.cloudtranslation.com/#/translate) | 28 | support main languages | [Xiamen University](http://nlp.xmu.edu.cn/) / [CloudTranslation](https://www.cloudtranslation.com/#/about), China | stable | 42 | | 20 | [QQTranSmart](https://transmart.qq.com) | 22 | support main languages | [Tencent](https://www.tencent.com/en-us/about.html), China | stable | 43 | | 21 | [TranslateCom](https://www.translate.com/machine-translation) | 21 | good at English translation | [TranslateCom](https://www.translate.com/about-us), America | stable | 44 | | 22 | [Sogou](https://fanyi.sogou.com/text) | 20 | support more languages in the world | [Tencent](https://www.tencent.com/en-us/about.html), China | stable | 45 | | 23 | [Tilde](https://translate.tilde.com/) | 20 | good at lv, de, fr translation | [Tilde](https://tilde.com/about), Latvia | / | 46 | | 24 | [Caiyun](https://fanyi.caiyunapp.com) | 19 | high quality to translate but response slowly, support professional field | [ColorfulClouds](http://caiyunapp.com/jobs/), China | stable | 47 | | 25 | [QQFanyi](https://fanyi.qq.com) | 17 | support main languages | [Tencent](https://www.tencent.com/en-us/about.html), China | / | 48 | | 26 | [TranslateMe](https://translateme.network/) | 16 | good at English translation | [TranslateMe](https://translateme.network/our-team/) / [Neosus](https://neosus.net/about/), Lithuania | / | 49 | | 27 | [Papago](https://papago.naver.com) | 15 | good at Korean translation | [Naver](https://www.navercorp.com/en/naver/company), South Korea | stable | 50 | | 28 | [Mirai](https://miraitranslate.com/trial/) | 15 | good at Japanese translation | [MiraiTranslate](https://miraitranslate.com/en/company/), Japan | / | 51 | | 29 | [Youdao](https://ai.youdao.com/product-fanyi-text.s) | 12 | support main languages, high quality | [Netease](https://ir.netease.com/company-overview/corporate-profile), China | stable | 52 | | 30 | [Iflyrec](https://fanyi.iflyrec.com) | 12 | good at Chinese translation | [Iflytek](https://www.iflytek.com/en/about-us/about.html), China | stable | 53 | | 31 | [Hujiang](https://dict.hjenglish.com/app/trans) | 12 | supported by baidu | [Hujiang](https://www.hujiang.com/about/intro), China | stable | 54 | | 32 | [Yeekit](https://www.yeekit.com/site/translate) | 10 | support main languages | [CTC](https://www.ctpc.com.cn/cms/enAboutUs.htm), China | / | 55 | | 33 | [LanguageWire](https://www.languagewire.com/en/technology/languagewire-translate) | 8 | good at English translation | [LanguageWire](https://www.languagewire.com/about-us), Denmark | stable | 56 | | 34 | [Elia](https://elia.eus/translator) | 6 | good at Basque translation | [Elhuyar](https://www.elhuyar.eus/eu/nor-gara), Spain | stable | 57 | | 35 | [Judic](https://judic.io/en/translate) | 4 | good at European translation | [CrossLang](https://crosslang.com/about-us/), Belgium | / | 58 | | 36 | [Mglip](http://fy.mglip.com/pc) | 3 | good at Mongolia translation | [Inner Mongolia University](https://www.imu.edu.cn/yw/Home.htm), China | stable | 59 | | 37 | [Utibet](http://mt.utibet.edu.cn/mt) | 2 | good at Tibet translation | [Tibet University](http://www.utibet.edu.cn/), China | stable | 60 | 61 |
62 | 63 |
64 | Installation 65 | 66 | ```sh 67 | # PYPI 68 | pip install --upgrade translators 69 | 70 | # Conda 71 | conda install conda-forge::translators 72 | conda install -c conda-forge translators 73 | 74 | # Source 75 | git clone https://github.com/UlionTse/translators.git 76 | cd translators 77 | python setup.py install 78 | ``` 79 | 80 |
81 | 82 |
83 | Getting Started 84 | 85 | ```python 86 | import translators as ts 87 | 88 | q_text = '季姬寂,集鸡,鸡即棘鸡。棘鸡饥叽,季姬及箕稷济鸡。' 89 | q_html = '''《季姬击鸡记》

还有另一篇文章《施氏食狮史》。

''' 90 | 91 | ### usage 92 | _ = ts.preaccelerate_and_speedtest() # Optional. Caching sessions in advance, which can help improve access speed. 93 | 94 | print(ts.translators_pool) 95 | print(ts.translate_text(q_text)) 96 | print(ts.translate_html(q_html, translator='alibaba')) 97 | 98 | ### parameters 99 | help(ts.translate_text) 100 | 101 | """ 102 | translate_text(query_text: str, translator: str = 'bing', from_language: str = 'auto', to_language: str = 'en', **kwargs) -> Union[str, dict] 103 | :param query_text: str, must. 104 | :param translator: str, default 'alibaba'. 105 | :param from_language: str, default 'auto'. 106 | :param to_language: str, default 'en'. 107 | :param if_use_preacceleration: bool, default False. 108 | :param **kwargs: 109 | :param is_detail_result: bool, default False. 110 | :param http_client: str, default 'requests' (except reverso). Union['requests', 'niquests', 'httpx', 'cloudscraper'] 111 | :param professional_field: str, default None. Support alibaba(), baidu(), caiyun(), cloudTranslation(), elia(), sysTran(), youdao(), volcEngine() only. 112 | :param timeout: float, default None. 113 | :param proxies: dict, default None. 114 | :param sleep_seconds: float, default 0. 115 | :param update_session_after_freq: int, default 1000. 116 | :param update_session_after_seconds: float, default 1500. 117 | :param if_use_cn_host: bool, default False. Support google(), bing() only. 118 | :param reset_host_url: str, default None. Support google(), yandex() only. 119 | :param if_check_reset_host_url: bool, default True. Support google(), yandex() only. 120 | :param if_ignore_empty_query: bool, default False. 121 | :param limit_of_length: int, default 20000. 122 | :param if_ignore_limit_of_length: bool, default False. 123 | :param if_show_time_stat: bool, default False. 124 | :param show_time_stat_precision: int, default 2. 125 | :param if_print_warning: bool, default True. 126 | :param lingvanex_mode: str, default 'B2C', choose from ("B2C", "B2B"). 127 | :param myMemory_mode: str, default "web", choose from ("web", "api"). 128 | :return: str or dict 129 | """ 130 | ``` 131 | 132 |
133 | 134 |
135 | Supported Languages 136 | 137 | | Language | Language of Translator | [Google](https://translate.google.com) | [Yandex](https://translate.yandex.com) | [Bing](https://www.bing.com/Translator) | [Baidu](https://fanyi.baidu.com) | [Alibaba](https://translate.alibaba.com) | [Tencent](https://fanyi.qq.com) | [Youdao](https://fanyi.youdao.com) | [Sogou](https://fanyi.sogou.com) | [Deepl](https://www.deepl.com/translator) | [Caiyun](https://fanyi.caiyunapp.com) | [Argos](https://translate.argosopentech.com) | others... | 138 | | -------------------- | ---------------------- | -------------------------------------- | -------------------------------------- | --------------------------------------- | -------------------------------- | ---------------------------------------- | ------------------------------- | ---------------------------------- | -------------------------------- | ----------------------------------------- | ------------------------------------- | -------------------------------------------- | --------- | 139 | | english | en | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | ... | 140 | | chinese | zh | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | | 141 | | arabic | ar | Y | Y | Y | Y(ara) | Y | Y | Y | Y | | | Y | | 142 | | russian | ru | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | | 143 | | french | fr | Y | Y | Y | Y(fra) | Y | Y | Y | Y | Y | Y | Y | | 144 | | german | de | Y | Y | Y | Y | | Y | Y | Y | Y | | Y | | 145 | | spanish | es | Y | Y | Y | Y(spa) | Y | Y | Y | Y | Y | Y | Y | | 146 | | portuguese | pt | Y | Y | Y(pt/pt-pt) | Y | Y | Y | Y | Y | Y | | Y | | 147 | | italian | it | Y | Y | Y | Y | Y | Y | Y | Y | Y | | Y | | 148 | | japanese | ja | Y | Y | Y | Y(jp) | | Y | Y | Y | Y | Y | Y | | 149 | | korean | ko | Y | Y | Y | Y(kor) | | Y | Y | Y | | | Y | | 150 | | greek | el | Y | Y | Y | Y | | | | Y | Y | | | | 151 | | dutch | nl | Y | Y | Y | Y | | | Y | Y | Y | | | | 152 | | hindi | hi | Y | Y | Y | | | Y | | Y | | | Y | | 153 | | turkish | tr | Y | Y | Y | | Y | Y | | Y | | | Y | | 154 | | malay | ms | Y | Y | Y | | | Y | | Y | | | | | 155 | | thai | th | Y | Y | Y | Y | Y | Y | | Y | | | | | 156 | | vietnamese | vi | Y | Y | Y | Y(vie) | Y | Y | Y | Y | | | Y | | 157 | | indonesian | id | Y | Y | Y | | Y | Y | Y | Y | | | Y | | 158 | | hebrew | he | Y(iw) | Y | Y | | | | | Y | | | | | 159 | | polish | pl | Y | Y | Y | Y | | | | Y | Y | | Y | | 160 | | mongolian | mn | Y | Y | | | | | | | | | | | 161 | | czech | cs | Y | Y | Y | Y | | | | Y | Y | | | | 162 | | hungarian | hu | Y | Y | Y | Y | | | | Y | Y | | | | 163 | | estonian | et | Y | Y | Y | Y(est) | | | | Y | Y | | | | 164 | | bulgarian | bg | Y | Y | Y | Y(bul) | | | | Y | Y | | | | 165 | | danish | da | Y | Y | Y | Y(dan) | | | | Y | Y | | | | 166 | | finnish | fi | Y | Y | Y | Y(fin) | | | | Y | Y | | | | 167 | | romanian | ro | Y | Y | Y | Y(rom) | | | | Y | Y | | | | 168 | | swedish | sv | Y | Y | Y | Y(swe) | | | | Y | Y | | | | 169 | | slovenian | sl | Y | Y | Y | Y(slo) | | | | Y | Y | | | | 170 | | persian/farsi | fa | Y | Y | Y | | | | | Y | | | | | 171 | | bosnian | bs | Y | Y | Y(bs-Latn) | | | | | Y(bs-Latn) | | | | | 172 | | serbian | sr | Y | Y | Y(sr-Latn/sr-Cyrl) | | | | | Y(sr-Latn/sr-Cyrl) | | | | | 173 | | fijian | fj | | | Y | | | | | Y | | | | | 174 | | filipino | tl | Y | Y | Y(fil) | | | | | Y(fil) | | | | | 175 | | haitiancreole | ht | Y | Y | Y | | | | | Y | | | | | 176 | | catalan | ca | Y | Y | Y | | | | | Y | | | | | 177 | | croatian | hr | Y | Y | Y | | | | | Y | | | | | 178 | | latvian | lv | Y | Y | Y | | | | | Y | Y | | | | 179 | | lithuanian | lt | Y | Y | Y | | | | | Y | Y | | | | 180 | | urdu | ur | Y | Y | Y | | | | | Y | | | | | 181 | | ukrainian | uk | Y | Y | Y | | | | | Y | | | | | 182 | | welsh | cy | Y | Y | Y | | | | | Y | | | | | 183 | | tahiti | ty | | | Y | | | | | Y | | | | | 184 | | tongan | to | | | Y | | | | | Y | | | | | 185 | | swahili | sw | Y | Y | Y | | | | | Y | | | | | 186 | | samoan | sm | Y | | Y | | | | | Y | | | | | 187 | | slovak | sk | Y | Y | Y | | | | | Y | Y | | | | 188 | | afrikaans | af | Y | Y | Y | | | | | Y | | | | | 189 | | norwegian | no | Y | Y | Y | | | | | Y | | | | | 190 | | bengali | bn | Y | Y | Y(bn-BD) | | | | | Y | | | | | 191 | | malagasy | mg | Y | Y | Y | | | | | Y | | | | | 192 | | maltese | mt | Y | Y | Y | | | | | Y | | | | | 193 | | queretaro otomi | otq | | | Y | | | | | Y | | | | | 194 | | klingon/tlhingan hol | tlh | | | Y | | | | | Y | | | | | 195 | | gujarati | gu | Y | Y | Y | | | | | | | | | | 196 | | tamil | ta | Y | Y | Y | | | | | | | | | | 197 | | telugu | te | Y | Y | Y | | | | | | | | | | 198 | | punjabi | pa | Y | Y | Y | | | | | | | | | | 199 | | amharic | am | Y | Y | | | | | | | | | | | 200 | | azerbaijani | az | Y | Y | | | | | | | | | | | 201 | | bashkir | ba | | Y | | | | | | | | | | | 202 | | belarusian | be | Y | Y | | | | | | | | | | | 203 | | cebuano | ceb | Y | Y | | | | | | | | | | | 204 | | chuvash | cv | | Y | | | | | | | | | | | 205 | | esperanto | eo | Y | Y | | | | | | | | | | | 206 | | basque | eu | Y | Y | | | | | | | | | | | 207 | | irish | ga | Y | Y | Y | | | | | | | | | | 208 | | emoji | emj | | Y | | | | | | | | | | | 209 | | ... | ... | | | | | | | | | | | | | 210 | 211 |
212 | About Chinese Language 213 | 214 | | Language | Language of Translator | [Google](https://translate.google.com) | [Yandex](https://translate.yandex.com) | [Bing](https://www.bing.com/Translator) | [Baidu](https://fanyi.baidu.com) | [Alibaba](https://translate.alibaba.com) | [Tencent](https://fanyi.qq.com) | [Youdao](https://fanyi.youdao.com) | [Sogou](https://fanyi.sogou.com) | [Iciba](https://www.iciba.com/fy) | [Iflytek](https://fanyi.xfyun.cn/console/trans/text) | [Caiyun](https://fanyi.caiyunapp.com) | [Deepl](https://www.deepl.com/translator) | [Argos](https://translate.argosopentech.com) | [Itranslate](https://itranslate.com/webapp) | [Reverso](https://www.reverso.net/text-translation) | [TranslateCom](https://www.translate.com/machine-translation) | [Papago](https://papago.naver.com) | [Utibet](http://mt.utibet.edu.cn/mt) | 215 | | ------------- | ---------------------- | -------------------------------------- | -------------------------------------- | --------------------------------------- | -------------------------------- | ---------------------------------------- | ------------------------------- | ---------------------------------- | -------------------------------- | --------------------------------- | ---------------------------------------------------- | ------------------------------------- | ----------------------------------------- | -------------------------------------------- | ------------------------------------------- | --------------------------------------------------- | ------------------------------------------------------------- | ---------------------------------- | ------------------------------------ | 216 | | Chinese(简体) | zh-CHS | Y(zh-CN) | Y(zh) | Y(zh-Hans) | Y(zh) | Y(zh) | Y(zh) | Y | Y | Y(zh) | Y(zh) | Y(zh) | Y(zh) | Y(zh) | Y(zh-CN) | Y(zh/chi) | ... | Y(zh-CN) | Y(zh) | 217 | | Chinese(繁体) | zh-CHT | Y(zh-TW) | | Y(zh-Hant) | Y(cht) | Y(zh-TW) | | | Y | Y(cnt) | | | | | Y(zh-TW) | | | Y(zh-TW) | | 218 | | Chinese(文言文) | wyw | | | | Y | | | | | | | | | | | | | | | 219 | | Chinese(粤语) | yue | | | Y | Y | | | | Y | Y | Y | | | | Y(zh-HK) | | | | | 220 | | Chinese(内蒙语) | mn | N[外蒙] | N[外蒙] | | | | | | | | Y[内蒙] | | | | N[外蒙] | | | | | 221 | | Chinese(维吾尔语) | uy | | | | | | | | | Y | | | | | | | | | | 222 | | Chinese(藏语) | ti | | | | | | | | | Y | | | | | | | | | Y | 223 | | Chinese(白苗文) | mww | | | Y | | | | | Y | Y | | | | | | | | | | 224 | | Chinese(彝语) | ii | | | | | | | | | | Y | | | | | | | | | 225 | | Chinese(苗语) | hmn | | | | | | | | | | | | | | Y | | | | | 226 | | Chinese(壮语) | zyb | | | | | | | | | | | | | | | | | | | 227 | 228 |
229 |
230 | 231 |
232 | Debug Tips 233 | 234 | ### Linux Runtime Environment 235 | 236 | 1. To support javascript runtime environment, you should [download and install Node.js](https://nodejs.org/en/download/). 237 | 2. Function baidu() doesn't work on Linux without desktop. 238 | 239 | ### HttpError 4xx 240 | 241 | 1. Check whether you made high frequency requests, especially httperror 429. 242 | 2. Check whether this service is provided in your region. 243 | 3. Detail to solve [HttpError](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) itself. 244 | 4. [Issue me](https://github.com/UlionTse/translators/issues), thanks. 245 | 246 | ### NetworkError or ProxyError 247 | 248 | 1. Check whether the network is connected correctly. 249 | 2. Check the proxy are enabled on your computer. If it is enabled, try turning it off or otherwise. 250 | 251 |
252 | 253 |
254 | Star History 255 | 256 | [![Star History Chart](https://api.star-history.com/svg?repos=UlionTse/translators&type=Date)](https://star-history.com/#UlionTse/translators&Date) 257 | 258 |
259 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 |

5 | PyPI - Version 6 | Conda - Version 7 | PyPI - License 8 | PyPI - Python 9 | PyPI - Status 10 | PyPI - Wheel 11 | PyPI - Downloads 12 |

13 | 14 | * * * 15 | 16 | **Translators** is a library that aims to bring **free, multiple, enjoyable** translations to individuals and students in Python. 17 | 18 | - [Supported Translation Services](#supported-translation-services) 19 | - [Installation](#installation) 20 | - [Getting Started](#getting-started) 21 | - [Command Line Interface](#Command-Line-Interface) 22 | - [Supported Languages](#supported-languages) 23 | - [Debug Tips](#debug-tips) 24 | - [Star History](#star-history) 25 | 26 | ## Supported Translation Services 27 | 28 | | ID | Translator | Number of Supported Languages | Advantage | Service | Status | 29 | | --- | --------------------------------------------------------------------------------- | ----------------------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ------------------------------- | 30 | | 1 | [Niutrans](https://niutrans.com/trans) | 452 | support the most languages in the world | [Northeastern University](http://english.neu.edu.cn/) / [Niutrans](https://github.com/NiuTrans), China | / | 31 | | 2 | [MyMemory](https://mymemory.translated.net) | 330 | support the most languages in the world | [Translated](https://translatedlabs.com/welcome), Italy | stable | 32 | | 3 | [Alibaba](https://translate.alibaba.com) | 221 | support most languages, support professional field | [Alibaba](https://damo.alibaba.com/about?lang=en), China | stable | 33 | | 4 | [Baidu](https://fanyi.baidu.com) | 201 | support most languages, support professional field, support classical Chinese | [Baidu](https://ir.baidu.com/company-overview), China | stable | 34 | | 5 | [ModernMt](https://www.modernmt.com/translate) | 200 | open-source, support more languages in the world | [Modernmt](https://github.com/modernmt) / [Translated](https://translatedlabs.com/welcome), Italy | stable | 35 | | 6 | [VolcEngine](https://translate.volcengine.com) | 189 | support more languages in the world, support professional field | [ByteDance](https://www.bytedance.com/en/), China | / | 36 | | 7 | [Iciba](https://www.iciba.com/fy) | 187 | support the most languages in the world | [Kingsoft](https://www.wps.com/about-us/) / [Xiaomi](https://www.mi.com/us/about/), China | stable | 37 | | 8 | [Iflytek](https://fanyi.xfyun.cn/console/trans/text) | 137 | support the most languages in the world | [Iflytek](https://www.iflytek.com/en/about-us/about.html), China | / | 38 | | 9 | [Google](https://translate.google.com) | 134 | support more languages in the world | [Google](https://about.google/), America | stable(offline in China inland) | 39 | | 10 | [Bing](https://www.bing.com/Translator) | 128 | support more languages in the world | [Microsoft](https://www.microsoft.com/en-us/about), America | stable | 40 | | 11 | [Lingvanex](https://lingvanex.com/demo) | 112 | support translation of different regions but the same language | [Lingvanex](https://lingvanex.com/about-us/), Cyprus | stable | 41 | | 12 | [Yandex](https://translate.yandex.com) | 102 | support more languages in the world, support word to emoji | [Yandex](https://yandex.com/company/), Russia | stable | 42 | | 13 | [Itranslate](https://itranslate.com/webapp) | 101 | support translation of different regions but the same language, such as en-US, en-UK, en-AU | [Itranslate](https://itranslate.com/about), Austria | stable | 43 | | 14 | [SysTran](https://www.systransoft.com/translate/) | 52 | support more languages in the world | [SysTran](https://www.systransoft.com/systran/), France | stable | 44 | | 15 | [Argos](https://libretranslate.com) | 46 | open-source | [Argos](https://github.com/argosopentech) / [Libre](https://github.com/LibreTranslate), America | stable | 45 | | 16 | [Apertium](https://www.apertium.org/) | 45 | open-source | [Apertium](https://github.com/apertium), Spain | stable | 46 | | 17 | [Reverso](https://www.reverso.net/text-translation) | 42 | popular on Mac and Iphone | [Reverso](https://www.corporate-translation.reverso.com/about-us), France | stable | 47 | | 18 | [Deepl](https://www.deepl.com/translator) | 30 | high quality to translate but response slowly | [Deepl](https://jobs.deepl.com/l/en), Germany | stable | 48 | | 19 | [CloudTranslation](https://www.cloudtranslation.com/#/translate) | 28 | support main languages | [Xiamen University](http://nlp.xmu.edu.cn/) / [CloudTranslation](https://www.cloudtranslation.com/#/about), China | stable | 49 | | 20 | [QQTranSmart](https://transmart.qq.com) | 22 | support main languages | [Tencent](https://www.tencent.com/en-us/about.html), China | stable | 50 | | 21 | [TranslateCom](https://www.translate.com/machine-translation) | 21 | good at English translation | [TranslateCom](https://www.translate.com/about-us), America | stable | 51 | | 22 | [Sogou](https://fanyi.sogou.com/text) | 20 | support more languages in the world | [Tencent](https://www.tencent.com/en-us/about.html), China | stable | 52 | | 23 | [Tilde](https://translate.tilde.com/) | 20 | good at lv, de, fr translation | [Tilde](https://tilde.com/about), Latvia | / | 53 | | 24 | [Caiyun](https://fanyi.caiyunapp.com) | 19 | high quality to translate but response slowly, support professional field | [ColorfulClouds](http://caiyunapp.com/jobs/), China | stable | 54 | | 25 | [QQFanyi](https://fanyi.qq.com) | 17 | support main languages | [Tencent](https://www.tencent.com/en-us/about.html), China | / | 55 | | 26 | [TranslateMe](https://translateme.network/) | 16 | good at English translation | [TranslateMe](https://translateme.network/our-team/) / [Neosus](https://neosus.net/about/), Lithuania | / | 56 | | 27 | [Papago](https://papago.naver.com) | 15 | good at Korean translation | [Naver](https://www.navercorp.com/en/naver/company), South Korea | stable | 57 | | 28 | [Mirai](https://miraitranslate.com/trial/) | 15 | good at Japanese translation | [MiraiTranslate](https://miraitranslate.com/en/company/), Japan | / | 58 | | 29 | [Youdao](https://ai.youdao.com/product-fanyi-text.s) | 12 | support main languages, high quality | [Netease](https://ir.netease.com/company-overview/corporate-profile), China | stable | 59 | | 30 | [Iflyrec](https://fanyi.iflyrec.com) | 12 | good at Chinese translation | [Iflytek](https://www.iflytek.com/en/about-us/about.html), China | stable | 60 | | 31 | [Hujiang](https://dict.hjenglish.com/app/trans) | 12 | supported by baidu | [Hujiang](https://www.hujiang.com/about/intro), China | stable | 61 | | 32 | [Yeekit](https://www.yeekit.com/site/translate) | 10 | support main languages | [CTC](https://www.ctpc.com.cn/cms/enAboutUs.htm), China | / | 62 | | 33 | [LanguageWire](https://www.languagewire.com/en/technology/languagewire-translate) | 8 | good at English translation | [LanguageWire](https://www.languagewire.com/about-us), Denmark | stable | 63 | | 34 | [Elia](https://elia.eus/translator) | 6 | good at Basque translation | [Elhuyar](https://www.elhuyar.eus/eu/nor-gara), Spain | stable | 64 | | 35 | [Judic](https://judic.io/en/translate) | 4 | good at European translation | [CrossLang](https://crosslang.com/about-us/), Belgium | / | 65 | | 36 | [Mglip](http://fy.mglip.com/pc) | 3 | good at Mongolia translation | [Inner Mongolia University](https://www.imu.edu.cn/yw/Home.htm), China | / | 66 | | 37 | [Utibet](http://mt.utibet.edu.cn/mt) | 2 | good at Tibet translation | [Tibet University](http://www.utibet.edu.cn/), China | stable | 67 | 68 | ## Installation 69 | 70 | ```sh 71 | # PYPI 72 | pip install --upgrade translators 73 | 74 | # Conda 75 | conda install conda-forge::translators 76 | 77 | # Source 78 | git clone https://github.com/UlionTse/translators.git 79 | cd translators 80 | python setup.py install 81 | ``` 82 | 83 | ## Getting Started 84 | 85 | ```python 86 | import translators as ts 87 | 88 | q_text = '季姬寂,集鸡,鸡即棘鸡。棘鸡饥叽,季姬及箕稷济鸡。' 89 | q_html = '''《季姬击鸡记》

还有另一篇文章《施氏食狮史》。

''' 90 | 91 | ### usage 92 | _ = ts.preaccelerate_and_speedtest() # Optional. Caching sessions in advance, which can help improve access speed. 93 | 94 | print(ts.translators_pool) 95 | print(ts.translate_text(q_text)) 96 | print(ts.translate_html(q_html, translator='alibaba')) 97 | 98 | ### parameters 99 | help(ts.translate_text) 100 | 101 | """ 102 | translate_text(query_text: str, translator: str = 'bing', from_language: str = 'auto', to_language: str = 'en', **kwargs) -> Union[str, dict] 103 | :param query_text: str, must. 104 | :param translator: str, default 'alibaba'. 105 | :param from_language: str, default 'auto'. 106 | :param to_language: str, default 'en'. 107 | :param if_use_preacceleration: bool, default False. 108 | :param **kwargs: 109 | :param is_detail_result: bool, default False. 110 | :param http_client: str, default 'requests' (except reverso). Union['requests', 'niquests', 'httpx', 'cloudscraper'] 111 | :param professional_field: str, default None. Support alibaba(), baidu(), caiyun(), cloudTranslation(), elia(), sysTran(), youdao(), volcEngine() only. 112 | :param timeout: Optional[float], default None. 113 | :param proxies: Optional[dict], default None. 114 | :param sleep_seconds: float, default 0. 115 | :param update_session_after_freq: int, default 1000. 116 | :param update_session_after_seconds: float, default 1500. 117 | :param if_use_cn_host: bool, default False. Support google(), bing() only. 118 | :param reset_host_url: str, default None. Support google(), yandex() only. 119 | :param if_check_reset_host_url: bool, default True. Support google(), yandex() only. 120 | :param if_ignore_empty_query: bool, default False. 121 | :param limit_of_length: int, default 20000. 122 | :param if_ignore_limit_of_length: bool, default False. 123 | :param if_show_time_stat: bool, default False. 124 | :param show_time_stat_precision: int, default 2. 125 | :param if_print_warning: bool, default True. 126 | :param lingvanex_mode: str, default 'B2C', choose from ("B2C", "B2B"). 127 | :param myMemory_mode: str, default "web", choose from ("web", "api"). 128 | :return: str or dict 129 | """ 130 | ``` 131 | 132 | ## Command Line Interface 133 | 134 | You can leverage a simple CLI named **fanyi** that ships with **translators**. 135 | 136 | ```sh 137 | >fanyi --help ─╯ 138 | usage: fanyi input [--help] [--translator] [--from] [--to] [--is_html] [--version] 139 | 140 | Translators(fanyi for CLI) is a library that aims to bring free, multiple, enjoyable translations to individuals and students in Python. 141 | 142 | positional arguments: 143 | input raw text or path to a file to be translated. 144 | 145 | options: 146 | --help show help information. 147 | --translator e.g. bing, google, yandex, etc... 148 | --from from_language, default `auto` detected. 149 | --to to_language, default `en`. 150 | --is_html is_html, default `0`. 151 | --version Show version information. 152 | ``` 153 | 154 | ## Supported Languages 155 | 156 | | Language | Language of Translator | [Google](https://translate.google.com) | [Yandex](https://translate.yandex.com) | [Bing](https://www.bing.com/Translator) | [Baidu](https://fanyi.baidu.com) | [Alibaba](https://translate.alibaba.com) | [Tencent](https://fanyi.qq.com) | [Youdao](https://fanyi.youdao.com) | [Sogou](https://fanyi.sogou.com) | [Deepl](https://www.deepl.com/translator) | [Caiyun](https://fanyi.caiyunapp.com) | [Argos](https://translate.argosopentech.com) | others... | 157 | | -------------------- | ---------------------- | -------------------------------------- | -------------------------------------- | --------------------------------------- | -------------------------------- | ---------------------------------------- | ------------------------------- | ---------------------------------- | -------------------------------- | ----------------------------------------- | ------------------------------------- | -------------------------------------------- | --------- | 158 | | english | en | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | ... | 159 | | chinese | zh | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | | 160 | | arabic | ar | Y | Y | Y | Y(ara) | Y | Y | Y | Y | | | Y | | 161 | | russian | ru | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | | 162 | | french | fr | Y | Y | Y | Y(fra) | Y | Y | Y | Y | Y | Y | Y | | 163 | | german | de | Y | Y | Y | Y | | Y | Y | Y | Y | | Y | | 164 | | spanish | es | Y | Y | Y | Y(spa) | Y | Y | Y | Y | Y | Y | Y | | 165 | | portuguese | pt | Y | Y | Y(pt/pt-pt) | Y | Y | Y | Y | Y | Y | | Y | | 166 | | italian | it | Y | Y | Y | Y | Y | Y | Y | Y | Y | | Y | | 167 | | japanese | ja | Y | Y | Y | Y(jp) | | Y | Y | Y | Y | Y | Y | | 168 | | korean | ko | Y | Y | Y | Y(kor) | | Y | Y | Y | | | Y | | 169 | | greek | el | Y | Y | Y | Y | | | | Y | Y | | | | 170 | | dutch | nl | Y | Y | Y | Y | | | Y | Y | Y | | | | 171 | | hindi | hi | Y | Y | Y | | | Y | | Y | | | Y | | 172 | | turkish | tr | Y | Y | Y | | Y | Y | | Y | | | Y | | 173 | | malay | ms | Y | Y | Y | | | Y | | Y | | | | | 174 | | thai | th | Y | Y | Y | Y | Y | Y | | Y | | | | | 175 | | vietnamese | vi | Y | Y | Y | Y(vie) | Y | Y | Y | Y | | | Y | | 176 | | indonesian | id | Y | Y | Y | | Y | Y | Y | Y | | | Y | | 177 | | hebrew | he | Y(iw) | Y | Y | | | | | Y | | | | | 178 | | polish | pl | Y | Y | Y | Y | | | | Y | Y | | Y | | 179 | | mongolian | mn | Y | Y | | | | | | | | | | | 180 | | czech | cs | Y | Y | Y | Y | | | | Y | Y | | | | 181 | | hungarian | hu | Y | Y | Y | Y | | | | Y | Y | | | | 182 | | estonian | et | Y | Y | Y | Y(est) | | | | Y | Y | | | | 183 | | bulgarian | bg | Y | Y | Y | Y(bul) | | | | Y | Y | | | | 184 | | danish | da | Y | Y | Y | Y(dan) | | | | Y | Y | | | | 185 | | finnish | fi | Y | Y | Y | Y(fin) | | | | Y | Y | | | | 186 | | romanian | ro | Y | Y | Y | Y(rom) | | | | Y | Y | | | | 187 | | swedish | sv | Y | Y | Y | Y(swe) | | | | Y | Y | | | | 188 | | slovenian | sl | Y | Y | Y | Y(slo) | | | | Y | Y | | | | 189 | | persian/farsi | fa | Y | Y | Y | | | | | Y | | | | | 190 | | bosnian | bs | Y | Y | Y(bs-Latn) | | | | | Y(bs-Latn) | | | | | 191 | | serbian | sr | Y | Y | Y(sr-Latn/sr-Cyrl) | | | | | Y(sr-Latn/sr-Cyrl) | | | | | 192 | | fijian | fj | | | Y | | | | | Y | | | | | 193 | | filipino | tl | Y | Y | Y(fil) | | | | | Y(fil) | | | | | 194 | | haitiancreole | ht | Y | Y | Y | | | | | Y | | | | | 195 | | catalan | ca | Y | Y | Y | | | | | Y | | | | | 196 | | croatian | hr | Y | Y | Y | | | | | Y | | | | | 197 | | latvian | lv | Y | Y | Y | | | | | Y | Y | | | | 198 | | lithuanian | lt | Y | Y | Y | | | | | Y | Y | | | | 199 | | urdu | ur | Y | Y | Y | | | | | Y | | | | | 200 | | ukrainian | uk | Y | Y | Y | | | | | Y | | | | | 201 | | welsh | cy | Y | Y | Y | | | | | Y | | | | | 202 | | tahiti | ty | | | Y | | | | | Y | | | | | 203 | | tongan | to | | | Y | | | | | Y | | | | | 204 | | swahili | sw | Y | Y | Y | | | | | Y | | | | | 205 | | samoan | sm | Y | | Y | | | | | Y | | | | | 206 | | slovak | sk | Y | Y | Y | | | | | Y | Y | | | | 207 | | afrikaans | af | Y | Y | Y | | | | | Y | | | | | 208 | | norwegian | no | Y | Y | Y | | | | | Y | | | | | 209 | | bengali | bn | Y | Y | Y(bn-BD) | | | | | Y | | | | | 210 | | malagasy | mg | Y | Y | Y | | | | | Y | | | | | 211 | | maltese | mt | Y | Y | Y | | | | | Y | | | | | 212 | | queretaro otomi | otq | | | Y | | | | | Y | | | | | 213 | | klingon/tlhingan hol | tlh | | | Y | | | | | Y | | | | | 214 | | gujarati | gu | Y | Y | Y | | | | | | | | | | 215 | | tamil | ta | Y | Y | Y | | | | | | | | | | 216 | | telugu | te | Y | Y | Y | | | | | | | | | | 217 | | punjabi | pa | Y | Y | Y | | | | | | | | | | 218 | | amharic | am | Y | Y | | | | | | | | | | | 219 | | azerbaijani | az | Y | Y | | | | | | | | | | | 220 | | bashkir | ba | | Y | | | | | | | | | | | 221 | | belarusian | be | Y | Y | | | | | | | | | | | 222 | | cebuano | ceb | Y | Y | | | | | | | | | | | 223 | | chuvash | cv | | Y | | | | | | | | | | | 224 | | esperanto | eo | Y | Y | | | | | | | | | | | 225 | | basque | eu | Y | Y | | | | | | | | | | | 226 | | irish | ga | Y | Y | Y | | | | | | | | | | 227 | | emoji | emj | | Y | | | | | | | | | | | 228 | | ... | ... | | | | | | | | | | | | | 229 | 230 | ### About Chinese Language 231 | 232 | | Language | Language of Translator | [Google](https://translate.google.com) | [Yandex](https://translate.yandex.com) | [Bing](https://www.bing.com/Translator) | [Baidu](https://fanyi.baidu.com) | [Alibaba](https://translate.alibaba.com) | [Tencent](https://fanyi.qq.com) | [Youdao](https://fanyi.youdao.com) | [Sogou](https://fanyi.sogou.com) | [Iciba](https://www.iciba.com/fy) | [Iflytek](https://fanyi.xfyun.cn/console/trans/text) | [Caiyun](https://fanyi.caiyunapp.com) | [Deepl](https://www.deepl.com/translator) | [Argos](https://translate.argosopentech.com) | [Itranslate](https://itranslate.com/webapp) | [Reverso](https://www.reverso.net/text-translation) | [TranslateCom](https://www.translate.com/machine-translation) | [Papago](https://papago.naver.com) | [Utibet](http://mt.utibet.edu.cn/mt) | 233 | | ------------- | ---------------------- | -------------------------------------- | -------------------------------------- | --------------------------------------- | -------------------------------- | ---------------------------------------- | ------------------------------- | ---------------------------------- | -------------------------------- | --------------------------------- | ---------------------------------------------------- | ------------------------------------- | ----------------------------------------- | -------------------------------------------- | ------------------------------------------- | --------------------------------------------------- | ------------------------------------------------------------- | ---------------------------------- | ------------------------------------ | 234 | | Chinese(简体) | zh-CHS | Y(zh-CN) | Y(zh) | Y(zh-Hans) | Y(zh) | Y(zh) | Y(zh) | Y | Y | Y(zh) | Y(zh) | Y(zh) | Y(zh) | Y(zh) | Y(zh-CN) | Y(zh/chi) | ... | Y(zh-CN) | Y(zh) | 235 | | Chinese(繁体) | zh-CHT | Y(zh-TW) | | Y(zh-Hant) | Y(cht) | Y(zh-TW) | | | Y | Y(cnt) | | | | | Y(zh-TW) | | | Y(zh-TW) | | 236 | | Chinese(文言文) | wyw | | | | Y | | | | | | | | | | | | | | | 237 | | Chinese(粤语) | yue | | | Y | Y | | | | Y | Y | Y | | | | Y(zh-HK) | | | | | 238 | | Chinese(内蒙语) | mn | N[外蒙] | N[外蒙] | | | | | | | | Y[内蒙] | | | | N[外蒙] | | | | | 239 | | Chinese(维吾尔语) | uy | | | | | | | | | Y | | | | | | | | | | 240 | | Chinese(藏语) | ti | | | | | | | | | Y | | | | | | | | | Y | 241 | | Chinese(白苗文) | mww | | | Y | | | | | Y | Y | | | | | | | | | | 242 | | Chinese(彝语) | ii | | | | | | | | | | Y | | | | | | | | | 243 | | Chinese(苗语) | hmn | | | | | | | | | | | | | | Y | | | | | 244 | | Chinese(壮语) | zyb | | | | | | | | | | | | | | | | | | | 245 | 246 | 247 | 248 | ## Debug Tips 249 | 250 | ### Linux Runtime Environment 251 | 252 | 1. To support javascript runtime environment, you should [download and install Node.js](https://nodejs.org/en/download/). 253 | 2. Function baidu() doesn't work on Linux without desktop. 254 | 255 | ### HttpError 4xx 256 | 257 | 1. Check whether you made high frequency requests, especially httperror 429. 258 | 2. Check whether this service is provided in your region. 259 | 3. Detail to solve [HttpError](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) itself. 260 | 4. [Issue me](https://github.com/UlionTse/translators/issues), thanks. 261 | 262 | ### NetworkError or ProxyError 263 | 264 | 1. Check whether the network is connected correctly. 265 | 2. Check the proxy are enabled on your computer. If it is enabled, try turning it off or otherwise. 266 | 267 | ## Star History 268 | 269 | [![Star History Chart](https://api.star-history.com/svg?repos=UlionTse/translators&type=Date)](https://star-history.com/#UlionTse/translators&Date) 270 | --------------------------------------------------------------------------------