We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Googletrans version:
I'm submitting a ...
Current behavior:
When I run my code, it gives me an error
File "/home/p4riah/Documents/Scripts/python/multiling.py", line 5, in <module> acquirer = TokenAcquirer() TypeError: __init__() missing 1 required positional argument: 'client'
Expected behavior: Translating text from english and bumping it through 100 random languages and back to english (for funny effect)
Steps to reproduce:
All I did was run the code given below
Related code:
from googletrans import Translator from googletrans.gtoken import TokenAcquirer import random acquirer = TokenAcquirer() text = 'test' tk = acquirer.do(text) langs = [ 'af', 'sq', 'am', 'ar', 'hy', 'az', 'eu', 'be', 'bn', 'bs', 'bg', 'ca', 'ceb', 'ny', 'zh-cn', 'zh-tw', 'co', 'hr', 'cs', 'da', 'nl', 'en', 'eo', 'et', 'tl', 'fi', 'fr', 'fy', 'gl', 'ka', 'de', 'el', 'gu', 'ht', 'ha', 'haw', 'iw', 'he', 'hi', 'hmn', 'hu', 'is', 'ig', 'id', 'ga', 'it', 'ja', 'jw', 'kn', 'kk', 'km', 'ko', 'ku', 'ky', 'lo', 'la', 'lv', 'lt', 'lb', 'mk', 'mg', 'ms', 'ml', 'mt', 'mi', 'mr', 'mn', 'my', 'ne', 'no', 'or', 'ps', 'fa', 'pl', 'pt', 'pa', 'ro', 'ru', 'sm', 'gd', 'sr', 'st', 'sn', 'sd', 'si', 'sk', 'sl', 'so', 'es', 'su', 'sw', 'sv', 'tg', 'ta', 'te', 'th', 'tr', 'uk', 'ur', 'ug', 'uz', 'vi', 'cy', 'xh', 'yi', 'yo', 'zu' ] def translate_text(text, num_languages): translator = Translator() for _ in range(num_languages): translated_text = translator.translate(text, dest=str(random.choice(langs))).text text = translated_text back_to_english = translator.translate(text, dest='en').text return back_to_english text_to_translate = "Hello, how are you?" num_languages = 100 result = translate_text(text_to_translate, num_languages) print("Original Text:", text_to_translate) print("Translated and Back to English:", result)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Googletrans version:
I'm submitting a ...
Current behavior:
When I run my code, it gives me an error
Expected behavior:
Translating text from english and bumping it through 100 random languages and back to english (for funny effect)
Steps to reproduce:
All I did was run the code given below
Related code:
The text was updated successfully, but these errors were encountered: