translation

How to fix: AttributeError: 'NoneType' object has no attribute 'group'

How to fix: AttributeError: 'NoneType' object has no attribute 'group' Question: I am running the following code:- from googletrans import Translator, constants from pprint import print # init the Google API translator translator = Translator() # translate a spanish text to english text (by default) translation = translator.translate("Hola Mundo") print("{} ({}) –> {} ({})".format(translation.origin, translation.src, …

Total answers: 2

Custom audio input bytes to azure cognitive speech translation service in Python

Custom audio input bytes to azure cognitive speech translation service in Python Question: I am in need to able to translate custom audio bytes which I can get from any source and translate the voice into the language I need (currently Hindi). I have been trying to pass custom audio bytes using following code in …

Total answers: 3

Is it possible replace one character by two using maketrans?

Is it possible replace one character by two using maketrans? Question: I want to replace æ character with ae. How can I obtain it? Here is my try with maketrans and translate: word = ‘være’ letters = (‘å’,’ø’, ‘æ’) replacements = (‘a’,’o’,’ae’) table = word.maketrans(letters, replacements) #table = word.maketrans(”.join(letters),”.join(replacements)) word_translated = word.translate(table) print(word_translated) It generates …

Total answers: 1

Best way of using google translation by Python

Best way of using google translation by Python Question: I am trying to translate large number of text files from English to other several languages. And we use Python in our project, we try to use Google translation service to translate them first then we will correct the mistakes manually. I have come up with …

Total answers: 7

When should I use ugettext_lazy?

When should I use ugettext_lazy? Question: I have a question about using ugettext and ugettext_lazy for translations. I learned that in models I should use ugettext_lazy, while in views ugettext. But are there any other places, where I should use ugettext_lazy too? What about form definitions? Are there any performance diffrences between them? Edit: And …

Total answers: 3