{"id":22477,"library":"translators","title":"Translators","description":"A Python library for free, multiple, and enjoyable translations. Version 6.0.4 supports over 50 translation services including Google, Bing, DeepL, and Yandex. Active development with frequent updates.","status":"active","version":"6.0.4","language":"python","source_language":"en","source_url":"https://github.com/UlionTse/translators","tags":["translation","text","nlp","api"],"install":[{"cmd":"pip install translators","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Use 'import translators as ts' to avoid name conflicts and access all functions.","wrong":"from translators import *","symbol":"translators","correct":"import translators as ts"}],"quickstart":{"code":"import translators as ts\n\n# Translate text from English to Chinese\ntranslation = ts.translate_text('Hello, world!', translator='google', from_language='en', to_language='zh')\nprint(translation)\n\n# List available translators\nprint(ts.translators_pool())","lang":"python","description":"Basic usage: translate text with a specified service and language codes."},"warnings":[{"fix":"Update function calls to use new parameter names: translator, from_language, to_language.","message":"In version 6.0, the function signature changed: 'translator' parameter renamed from 'translator' (was 'engine' in v5). Also 'from_language' and 'to_language' replaced 'from_lang' and 'to_lang'.","severity":"breaking","affected_versions":"<6.0"},{"fix":"Add time.sleep(1) between requests or use a rotating proxy list.","message":"Some translators (e.g., Google) may rate-limit or block requests. Use sleep delays or proxies to avoid issues.","severity":"gotcha","affected_versions":"all"},{"fix":"Verify language support before translating.","message":"Not all translators support all language pairs. Check supported languages with ts.get_languages(translator_name).","severity":"gotcha","affected_versions":"all"},{"fix":"Use time.sleep() instead.","message":"The 'translators' parameter 'sleep_seconds' is deprecated in favor of setting delays manually.","severity":"deprecated","affected_versions":">=6.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Check the translator name and language codes; use try/except to handle failures.","cause":"The translation failed due to an unsupported language pair or service unavailability.","error":"KeyError: 'translation'"},{"fix":"Run 'pip install translators' in your terminal or environment.","cause":"The library is not installed in the current Python environment.","error":"ModuleNotFoundError: No module named 'translators'"},{"fix":"Replace 'engine=' with 'translator=' and 'from_lang=' with 'from_language=', 'to_lang=' with 'to_language='.","cause":"Using old parameter name 'engine' which was renamed to 'translator' in v6.","error":"TypeError: translate_text() got an unexpected keyword argument 'engine'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}