[django-modeltranslation] r150 committed - Fixed non-unicode verbose field names (with actual unicode characters)...

7 views
Skip to first unread message

django-mode...@googlecode.com

unread,
Jul 11, 2012, 4:24:59 PM7/11/12
to django-modeltra...@googlegroups.com
Revision: 150
Author: eschler
Date: Wed Jul 11 13:24:37 2012
Log: Fixed non-unicode verbose field names (with actual unicode
characters) showing up empty in forms. Resolves issue 35.
http://code.google.com/p/django-modeltranslation/source/detail?r=150

Modified:
/trunk/CHANGELOG.txt
/trunk/modeltranslation/utils.py

=======================================
--- /trunk/CHANGELOG.txt Wed Jul 11 05:57:37 2012
+++ /trunk/CHANGELOG.txt Wed Jul 11 13:24:37 2012
@@ -25,6 +25,8 @@
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.
=======================================
--- /trunk/modeltranslation/utils.py Wed Jul 4 03:09:22 2012
+++ /trunk/modeltranslation/utils.py Wed Jul 11 13:24:37 2012
@@ -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_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)
Reply all
Reply to author
Forward
0 new messages