Opened 18 years ago
Closed 18 years ago
#4359 closed (fixed)
[unicode] Translation errors in the admin
Reported by: | anonymous | Owned by: | Malcolm Tredinnick |
---|---|---|---|
Component: | Internationalization | Version: | other branch |
Severity: | Keywords: | admin | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
If I use admin application with unicode branch and LANGUAGE is different from django_language session variable, I have these problems:
Models in auth application are not localized - I think ugettext_lazy should by used for them. It can be solved for example by unicode-lazy-auth.diff patch.
If I apply this patch, new problems appear:
List of groups has bad header - not translation of word "group", but only django.utils.functional.proxy object. It can be solved for example by unicode-default-list-display.diff patch.
Help texts doesn't work - again django.utils.functional.proxy object is rendered. It can be solved for example by unicode-escape-help-text.diff patch.
List of deleted objects doesn'work - - again django.utils.functional.proxy object is rendered. It can be solved for example by unicode-deleted-objects.diff patch. (It happens also when I delete instance of django.contrib.admin.models.Site, so it doesn't depends on the first patch.)
Attachments (4)
Change History (11)
by , 18 years ago
Attachment: | unicode-lazy-auth.diff added |
---|
comment:1 by , 18 years ago
by , 18 years ago
Attachment: | unicode-default-list-display.diff added |
---|
by , 18 years ago
Attachment: | unicode-escape-help-text.diff added |
---|
by , 18 years ago
Attachment: | unicode-deleted-objects.diff added |
---|
comment:2 by , 18 years ago
comment:3 by , 18 years ago
Owner: | changed from | to
---|---|
Summary: | unicode-branch - something is too lazy and something is not lazy enough If I use admin application with unicode branch and LANGUAGE is different from django_language session variable, I have these problems: Models in auth application are not localized - I think ugettext_lazy should by used for them. It can be solved for example by unicode-lazy-auth.diff patch. If I apply this patch, new problems appear: List of groups has bad header - not translation of word "group", but only django.utils.functional.__proxy__ object. It can be solved for example by unicode-default-list-display.diff patch. Help texts doesn't work - again django.utils.functional.__proxy__ object is rendered. It can be solved for example by unicode-escape-help-text.diff patch. unicode-branch - something is too lazy and something is not lazy enough → [unicode] Translation errors in the admin |
comment:4 by , 18 years ago
Owner: | changed from | to
---|
comment:5 by , 18 years ago
Keywords: | unicode-branch removed |
---|---|
Triage Stage: | Unreviewed → Accepted |
In future, please file separate tickets for separate bugs; it makes it much easier to address things on a case-by-case basis.
Thanks for the report and attempts at fixes, though. It gives me a good of where to look.
- The first patch is correct.
- The second patch is the right idea, but needs a little tweaking (because the model might not have a
__unicode__
method. - The third patch is wrong, because help_text can contains links, etc, so should not be escaped. I'll fix it in another way.
- The fourth patch is correct.
comment:6 by , 18 years ago
The second patch was correct -- clearly the original submitter understands the code much better than I do. Third problem was indicative of a larger problem with resolve_variable() and the fourth problem was just a matter of coercing things to unicode correctly.
comment:7 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
The summary should be "unicode-branch - something is too lazy and something is not lazy enough". I am sorry, I don't know how to change it.