#12385 closed (fixed)
Fields type descriptions aren't translatable after r11833
Reported by: | Ramiro Morales | Owned by: | Karen Tracey |
---|---|---|---|
Component: | Internationalization | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Noted this after updating a translation, found all the previosuly translated description for builtin model fields commented out like this
#~ msgid "Boolean (Either True, False or None)" #~ msgstr "Booleano (Verdadero, Falso o Nulo)"
at the end of django.po
.
This is because xgettext
can't examine Python docstrings in search of marked-for-translation strings.
At some point during #7977 life, using a class attribute had been considered but the docstring approach was chosen in the end.
Attachments (1)
Change History (8)
follow-up: 2 comment:1 by , 15 years ago
follow-up: 3 comment:2 by , 15 years ago
Has patch: | set |
---|
Replying to kmtracey:
Taking another look at the alternative descriptor approach, I don't think the patch for it preserves the ability for makemessages to find the strings either?
Correct. it still wasn't completely right from the point of view of correctly supporting i18n.
But I guess it could be done that way
I've implemented that in the attached patch.
whereas for docstrings there's no hope?
AFAIK, no.
follow-up: 4 comment:3 by , 15 years ago
Replying to ramiro:
Replying to kmtracey:
Taking another look at the alternative descriptor approach, I don't think the patch for it preserves the ability for makemessages to find the strings either?
Correct. it still wasn't completely right from the point of view of correctly supporting i18n.
But I guess it could be done that way
I've implemented that in the attached patch.
I think maybe you uploaded the wrong patch? What's attached is the same as the original descriptor patch on the other ticket.
by , 15 years ago
Attachment: | 12385-class-attribute-for-i18n.diff added |
---|
comment:4 by , 15 years ago
Replying to kmtracey:
I think maybe you uploaded the wrong patch? What's attached is the same as the original descriptor patch on the other ticket.
Yes, sorry. I even managed to repeat the error once more. 12385-class-attribute-for-i18n.diff
is the correct patch.
comment:5 by , 15 years ago
Owner: | changed from | to
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:6 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Oh darn. I missed that those strings had been translated. The docstring approach looked much more natural to me. Taking another look at the alternative descriptor approach, I don't think the patch for it preserves the ability for makemessages to find the strings either? But I guess it could be done that way, whereas for docstrings there's no hope?