mirror of
https://github.com/Hopiu/django-modeltranslation.git
synced 2026-04-24 06:54:44 +00:00
Fixed non-unicode verbose field names (with actual unicode characters) showing up empty in forms. Resolves issue 35.
This commit is contained in:
parent
e2bc3f2d4d
commit
5d0afa21bd
2 changed files with 4 additions and 1 deletions
|
|
@ -25,6 +25,8 @@ CHANGED: Major refactoring of the admin integration. Subclassed BaseModelAdmin
|
|||
exclude and fieldsets options and properly support options in inlines.
|
||||
(resolves issue 72)
|
||||
|
||||
FIXED: Non-unicode verbose field names showing up empty in forms.
|
||||
(resolves issue 35)
|
||||
FIXED: Dynamic TranslationOptions model name.
|
||||
FIXED: Widgets for translated fields are not properly copied from original
|
||||
fields.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from django.utils.encoding import force_unicode
|
||||
from django.utils.translation import get_language as _get_language
|
||||
from django.utils.functional import lazy
|
||||
|
||||
|
|
@ -30,5 +31,5 @@ def build_localized_fieldname(field_name, lang):
|
|||
|
||||
|
||||
def _build_localized_verbose_name(verbose_name, lang):
|
||||
return u'%s [%s]' % (verbose_name, lang)
|
||||
return u'%s [%s]' % (force_unicode(verbose_name), lang)
|
||||
build_localized_verbose_name = lazy(_build_localized_verbose_name, unicode)
|
||||
|
|
|
|||
Loading…
Reference in a new issue