Django

Code

Ticket #5287 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

i18n marking breaks choices in admin on being marked for translation

Reported by: kenneth gonsalves <lawgon@thenilgiris.com> Assigned to: nobody
Milestone: Component: Internationalization
Version: SVN Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

when i upgraded to the latest svn head (6022) from 5036, I found that all the places in admin that had dropdowns for choices were blank. I had always marked my choices for translation like so:

article_type = ( ("NW", _("News")), ("FT",_("Features")), )

now, this doesnt work - when I remove the _(), then the choices appear. I am using from django.utils.translation import gettext_lazy as _. I have reported this in the mailing list, but now feel it is a bug.

Attachments

Change History

08/30/07 06:28:00 changed by kenneth gonsalves <lawgon@thenilgiris.com>

  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

if i use 'import gettext as _' everything works. 'import ugettext_lazy as _' also doesnt work

10/03/07 20:54:58 changed by mtredinnick

(In [6452]) Fixed a Python 2.3 Unicode + oldforms problem. Refs #5287.

10/03/07 20:57:55 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

I can only duplicate this problem using python 2.3 and that's now been fixed.

If you are using 2.4 or 2.5 and it's still an issue, can you please reopen and give a small example demonstrating the problem. My test case so far has been this model (with _() bound to ugettext_lazy()):

CHOICES = (('a', _('a')), ('b', _('b')), ('c', _('c')))

class T5287(models.Model):
    type = models.CharField(max_length=5, choices=CHOICES)

    class Admin:
        pass

That displays correctly for me on current trunk (although not with python 2.3 prior to [6452]) and seems to follow your explanation of the problem.


Add/Change #5287 (i18n marking breaks choices in admin on being marked for translation)




Change Properties
Action