[ADD] base: support alphabet-specific languages as in Rosetta + enabled Serbian@Latin
bzr revid: odo@openerp.com-20101203160907-59ytzsl8ah2ebtxa
This commit is contained in:
parent
c95efe7997
commit
c744e55ffc
|
@ -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'),
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue