-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Adding "rest_framework" to settings.py changes translations of gettext #3735
New issue
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
Comments
The Django translation engine doesn't take into account strings that are already translated as part of another application. |
One possible workaround (completely untested): create a |
@claudep In my case _('...') returns the translation from the rest-framework. But I would like to get the translation from django. I guess ugettext(string) works the same: the rest-framework translation gets returned. I guess I am missing something. How to create |
My suggestion was not for your code, but for rest-framework itself, so the string wouldn't be extracted in DRF translation catalogs. |
In django the string "This field is required." gets translated to the german string "Dieses Feld ist zwingend erforderlich."
As soon as I add "rest_framework" to the settings.py the german string changes to "Dieses Feld ist erforderlich."
The german word "zwingend" is missing.
You don't need to understand the german words.
But why does this happen?
Here is the django po file translation:
https://github.com/django/django/blob/master/django/conf/locale/de/LC_MESSAGES/django.po#L611
Where does the other translation come from?
I could not find a po-file in the repo of django-rest-framework
Why does this sentence get translated twice? One time in django, one time in the rest-framework?
The text was updated successfully, but these errors were encountered: