﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
34268	Internationalization does not localize functional model choices	Nima	nobody	"Given a lazy/functional choice generator for a model, Django's internationalization cannot fully comprehend the lazy localizable text generated by the function.

Imagine a base class:
{{{
# gettext_lazy also does not work
from django.utils.translation import gettext as _

class SelectableModelField:
    @classmethod
    def make_choices(cls):
        return [(value, _(key.replace('_', ' '))) for (key, value) in vars(cls).items() 
                if not (key[-1] + key[0]).__contains__('_')]

    bool_choices = ((True, 'Yes'), (False, 'No'))
}}}

which is inherited by:


{{{
class User(models.Model):
    class __UserType__(SelectableModelField):
        basic = 0
        premium = 1
    
    user_type = models.PositiveSmallIntegerField(choices=__UserType__.make_choices())
}}}

the ''django.po'' file will not contain the functionally-generated choices after running ''python manage.py makemessages -l ...''"	New feature	closed	Internationalization	4.2	Normal	invalid	Functional choice generation	Claude Paroz	Unreviewed	0	0	0	0	0	0
