Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#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)

12385-class-attribute-for-i18n.diff (19.6 KB ) - added by Ramiro Morales 14 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 by Karen Tracey, 14 years ago

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?

in reply to:  1 ; comment:2 by Ramiro Morales, 14 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.

in reply to:  2 ; comment:3 by Karen Tracey, 14 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 Ramiro Morales, 14 years ago

in reply to:  3 comment:4 by Ramiro Morales, 14 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 Karen Tracey, 14 years ago

Owner: changed from nobody to Karen Tracey
Triage Stage: UnreviewedAccepted

comment:6 by Karen Tracey, 14 years ago

Resolution: fixed
Status: newclosed

(In [11878]) Fixed #12385: Made built-in field type descriptions in admindocs translatable again. Many thanks to Ramiro for the problem report and patch.

comment:7 by Karen Tracey, 14 years ago

(In [11879]) [1.1.X] Fixed #12385: Made built-in field type descriptions in admindocs translatable again. Many thanks to Ramiro for the problem report and patch.

r11878 from trunk.

Note: See TracTickets for help on using tickets.
Back to Top