diff --git a/bin/addons/base/ir/ir_translation.py b/bin/addons/base/ir/ir_translation.py index 6f8a4affbe9..8efeac8a0f8 100644 --- a/bin/addons/base/ir/ir_translation.py +++ b/bin/addons/base/ir/ir_translation.py @@ -57,7 +57,7 @@ class ir_translation(osv.osv): _columns = { 'name': fields.char('Field Name', size=128, required=True), 'res_id': fields.integer('Resource ID', select=True), - 'lang': fields.selection(_get_language, string='Language', size=5), + 'lang': fields.selection(_get_language, string='Language', size=16), 'type': fields.selection(TRANSLATION_TYPE, string='Type', size=16, select=True), 'src': fields.text('Source'), 'value': fields.text('Translation Value'), diff --git a/bin/addons/base/module/module.py b/bin/addons/base/module/module.py index 27979bfb2cc..b3724f1e26d 100644 --- a/bin/addons/base/module/module.py +++ b/bin/addons/base/module/module.py @@ -488,8 +488,6 @@ class module(osv.osv): # unable to find the module. we skip continue for lang in filter_lang: - if len(lang) > 5: - raise osv.except_osv(_('Error'), _('You Can Not Load Translation For language Due To Invalid Language/Country Code')) iso_lang = tools.get_iso_codes(lang) f = addons.get_module_resource(mod.name, 'i18n', iso_lang + '.po') # Implementation notice: we must first search for the full name of diff --git a/bin/addons/base/res/res_lang.py b/bin/addons/base/res/res_lang.py index 1e158a175e6..48c583c54cd 100644 --- a/bin/addons/base/res/res_lang.py +++ b/bin/addons/base/res/res_lang.py @@ -36,8 +36,8 @@ class lang(osv.osv): _columns = { 'name': fields.char('Name', size=64, required=True), - 'code': fields.char('Locale Code', size=5, required=True, help='This field is used to set/get locales for user'), - 'iso_code': fields.char('ISO code', size=5, required=False, help='This ISO code is the name of po files to use for translations'), + 'code': fields.char('Locale Code', size=16, required=True, help='This field is used to set/get locales for user'), + 'iso_code': fields.char('ISO code', size=16, required=False, help='This ISO code is the name of po files to use for translations'), 'translatable': fields.boolean('Translatable'), 'active': fields.boolean('Active'), 'direction': fields.selection([('ltr', 'Left-to-Right'), ('rtl', 'Right-to-Left')], 'Direction',required=True), diff --git a/bin/tools/misc.py b/bin/tools/misc.py index 620302c51f5..0d5f7c67e5b 100644 --- a/bin/tools/misc.py +++ b/bin/tools/misc.py @@ -912,6 +912,8 @@ def get_iso_codes(lang): return lang def get_languages(): + # The codes below are those from Launchpad's Rosetta, with the exception + # of some trivial codes where the Launchpad code is xx and we have xx_XX. languages={ 'ab_RU': u'Abkhazian / аҧсуа', 'ar_AR': u'Arabic / الْعَرَبيّة', @@ -978,7 +980,8 @@ def get_languages(): 'sl_SI': u'Slovenian / slovenščina', 'sk_SK': u'Slovak / Slovenský jazyk', 'sq_AL': u'Albanian / Shqip', - 'sr_RS': u'Serbian / српски језик', + 'sr_RS': u'Serbian (Cyrillic) / српски', + 'sr@latin': u'Serbian (Latin) / srpski', 'sv_SE': u'Swedish / svenska', 'te_IN': u'Telugu / తెలుగు', 'tr_TR': u'Turkish / Türkçe',