translation

Python googletrans library not translating correctly

余生颓废 提交于 2021-01-27 16:27:55
问题 I'm using the google trans library to translate some comments from different languages to English. But when testing this library no matter what I try to translate it will say that the language 'src' is English. Even setting the 'src' to a specific language doesn't fix this problem. Examples of this can be seen below: Sample Code 1: from googletrans import Translator translator = Translator() print(translator.translate('veritas lux mea')) Output: Translated(src=en, dest=en, text=veritas lux

Python googletrans library not translating correctly

旧街凉风 提交于 2021-01-27 16:26:39
问题 I'm using the google trans library to translate some comments from different languages to English. But when testing this library no matter what I try to translate it will say that the language 'src' is English. Even setting the 'src' to a specific language doesn't fix this problem. Examples of this can be seen below: Sample Code 1: from googletrans import Translator translator = Translator() print(translator.translate('veritas lux mea')) Output: Translated(src=en, dest=en, text=veritas lux

Python googletrans library not translating correctly

霸气de小男生 提交于 2021-01-27 16:26:14
问题 I'm using the google trans library to translate some comments from different languages to English. But when testing this library no matter what I try to translate it will say that the language 'src' is English. Even setting the 'src' to a specific language doesn't fix this problem. Examples of this can be seen below: Sample Code 1: from googletrans import Translator translator = Translator() print(translator.translate('veritas lux mea')) Output: Translated(src=en, dest=en, text=veritas lux

Django: Can't change default language

自古美人都是妖i 提交于 2021-01-27 05:29:58
问题 I have been developing for some time in en-gb language code. Now arriving closer to the release date I was going to switch the default language to en-us , but whatever I do the initial request.LANGUAGE_CODE is set to en-gb even for unregistered users. FYI, I would actually like to keep the time_zone to London and simply change the default language to American English. For now I have changed both just to get it working, but still no joy. #TIME_ZONE = 'Europe/London' TIME_ZONE = 'US/Eastern'

Django: Can't change default language

穿精又带淫゛_ 提交于 2021-01-27 05:27:04
问题 I have been developing for some time in en-gb language code. Now arriving closer to the release date I was going to switch the default language to en-us , but whatever I do the initial request.LANGUAGE_CODE is set to en-gb even for unregistered users. FYI, I would actually like to keep the time_zone to London and simply change the default language to American English. For now I have changed both just to get it working, but still no joy. #TIME_ZONE = 'Europe/London' TIME_ZONE = 'US/Eastern'

Git command when translating files in Django

喜欢而已 提交于 2021-01-27 05:11:17
问题 I have an existing application in Django. I want to add a translation on the page. On page I have: {% trans 'Projects'%} In .po file I added: #: templates/staff/site.html: 200 msgid "Projects" msgid "Projekty" Then executes the command: django-admin.py compilemessages -l pl After this command, I get an error: CommandError: This Should Be Run script from the Django Git checkout or your project or app tree, or with the settings Specified module. 回答1: The error holds the answer, you could be

angular-formio set language in FormBuilder

早过忘川 提交于 2021-01-01 17:57:42
问题 I don't find a solution for changing the language of the FormBuilder. For the renderer it is described by documentation, but it works not in Builder. At the Builder it must be set by options, but the FormioOptions not include the language option. Is there any description or example for usage? HTML Code <div class="content" role="main"> <form-builder [form]="form" (change)="onChange($event)" [options]="formOptions"></form-builder> <button (click)="onClick()">Formular speichern (Ausgabe auf

angular-formio set language in FormBuilder

孤者浪人 提交于 2021-01-01 17:57:00
问题 I don't find a solution for changing the language of the FormBuilder. For the renderer it is described by documentation, but it works not in Builder. At the Builder it must be set by options, but the FormioOptions not include the language option. Is there any description or example for usage? HTML Code <div class="content" role="main"> <form-builder [form]="form" (change)="onChange($event)" [options]="formOptions"></form-builder> <button (click)="onClick()">Formular speichern (Ausgabe auf

How can I add a translation template-tag inside another template-tag in Django?

邮差的信 提交于 2020-12-13 03:45:29
问题 This is my template code: {{ can_edit|yesno:'Allow edit,View Only' }} But I want to translate it automatically from my translation strings, so I did this: {{ can_edit|yesno:'{% trans "option_allow_edit" %},{% trans "option_allow_edit" %}' }} But it doesn't work, because it escapes the {% trans %} tags. How can I do it? 回答1: You should try using the blocktrans template tag. {% blocktrans with editable=can_edit|yesno:'Allow edit,View Only' %} {{ editable }} {% endblocktrans %} 回答2: You can use

How can I add a translation template-tag inside another template-tag in Django?

孤街醉人 提交于 2020-12-13 03:44:26
问题 This is my template code: {{ can_edit|yesno:'Allow edit,View Only' }} But I want to translate it automatically from my translation strings, so I did this: {{ can_edit|yesno:'{% trans "option_allow_edit" %},{% trans "option_allow_edit" %}' }} But it doesn't work, because it escapes the {% trans %} tags. How can I do it? 回答1: You should try using the blocktrans template tag. {% blocktrans with editable=can_edit|yesno:'Allow edit,View Only' %} {{ editable }} {% endblocktrans %} 回答2: You can use