Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#12385 closed (fixed)

Fields type descriptions aren't translatable after r11833

Reported by: Ramiro Morales Owned by: Karen Tracey
Component: Internationalization Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 7 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 7 years ago by Karen Tracey

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

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?

comment:2 in reply to:  1 ; Changed 7 years ago by Ramiro Morales

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.

comment:3 in reply to:  2 ; Changed 7 years ago by Karen Tracey

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.

Changed 7 years ago by Ramiro Morales

comment:4 in reply to:  3 Changed 7 years ago by Ramiro Morales

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 Changed 7 years ago by Karen Tracey

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

comment:6 Changed 7 years ago by Karen Tracey

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 Changed 7 years ago by Karen Tracey

(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