mirror of
https://github.com/Hopiu/django-modeltranslation.git
synced 2026-05-28 05:53:59 +00:00
Fixed tabs don't properly support two-part language codes. Resolves issue 63.
This commit is contained in:
parent
a27e5fc723
commit
6055a1daec
3 changed files with 27 additions and 3 deletions
|
|
@ -1,6 +1,16 @@
|
|||
FIXED: Tabs don't properly support two-part language codes.
|
||||
(resolves issue 63)
|
||||
|
||||
|
||||
v0.3.2
|
||||
======
|
||||
Date: 2011-06-16
|
||||
Packaged from revision 122.
|
||||
|
||||
FIXED: Static files not included during installation.
|
||||
(resolves issue 61)
|
||||
|
||||
|
||||
v0.3.1
|
||||
======
|
||||
Date: 2011-06-07
|
||||
|
|
@ -8,6 +18,7 @@ Packaged from revision 121.
|
|||
|
||||
CHANGED: Renamed media folder to static.
|
||||
|
||||
|
||||
v0.3
|
||||
====
|
||||
Date: 2011-06-03
|
||||
|
|
@ -52,6 +63,7 @@ CHANGED: Refactored creation of translation fields and added handling of
|
|||
correctly.
|
||||
(thanks to jaap, resolves issue 31)
|
||||
|
||||
|
||||
v0.2
|
||||
====
|
||||
Date: 2010-06-15
|
||||
|
|
@ -97,6 +109,7 @@ Packaged from revision 57.
|
|||
FIXED: Removed unused dependency to content type which can break syncdb.
|
||||
(thanks carl.j.meyer, resolves issue 1)
|
||||
|
||||
|
||||
v0.1
|
||||
====
|
||||
Date: 2009-02-22
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ class TranslationAdminBase(object):
|
|||
field.widget = copy(orig_formfield.widget)
|
||||
css_classes = field.widget.attrs.get('class', '').split(' ')
|
||||
css_classes.append('modeltranslation')
|
||||
css_classes.append('modeltranslation-field-%s__%s' % (orig_fieldname,
|
||||
db_field.language))
|
||||
|
||||
if db_field.language == DEFAULT_LANGUAGE:
|
||||
# Add another css class to identify a default modeltranslation
|
||||
|
|
|
|||
|
|
@ -25,9 +25,18 @@ var google, django, gettext;
|
|||
grouped_translations = {};
|
||||
|
||||
translation_fields.each(function (i, el) {
|
||||
var name = $(el).attr('name').split('_'),
|
||||
lang = name.pop();
|
||||
name = name.join('_');
|
||||
// Extract fieldname and original language code from class attribute
|
||||
var css_lang_suffix = 'modeltranslation-field-';
|
||||
var name = '';
|
||||
var lang = '';
|
||||
$.each($(el).attr('class').split(' '), function(j, cls) {
|
||||
if (cls.substring(0, css_lang_suffix.length) === css_lang_suffix) {
|
||||
var v = cls.substring(css_lang_suffix.length,
|
||||
cls.length).split('__');
|
||||
name = v[0];
|
||||
lang = v[1];
|
||||
}
|
||||
});
|
||||
if (!grouped_translations[name]) {
|
||||
grouped_translations[name] = {};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue