From 3218c60a7053292c55471a7e79aafc6cb411b060 Mon Sep 17 00:00:00 2001 From: "mra (Open ERP)" Date: Fri, 20 Nov 2009 17:03:49 +0530 Subject: [PATCH] [ADD] add new field on res.lang object iso_code which is for file name on i18n (LP synchronization with bzr branch for transaltion) bzr revid: mra@tinyerp.com-20091120113349-gdlq582sd1n52jr4 --- bin/addons/base/res/res_lang.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/bin/addons/base/res/res_lang.py b/bin/addons/base/res/res_lang.py index a2a1b5934da..d45824cc9ec 100644 --- a/bin/addons/base/res/res_lang.py +++ b/bin/addons/base/res/res_lang.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## @@ -34,13 +34,14 @@ class lang(osv.osv): _columns = { 'name': fields.char('Name', size=64, required=True), - 'code': fields.char('Code', size=5, 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'), 'translatable': fields.boolean('Translatable'), 'active': fields.boolean('Active'), 'direction': fields.selection([('ltr', 'Left-to-Right'), ('rtl', 'Right-to-Left')], 'Direction',required=True), 'date_format':fields.char('Date Format',size=64,required=True), 'time_format':fields.char('Time Format',size=64,required=True), - 'grouping':fields.char('Separator Format',size=64,required=True,help="The Separator Format should be like [,n] where 0 < n :starting from Unit digit.-1 will end the separation. e.g. [3,2,-1] will represent 106500 to be 1,06,500;[1,2,-1] will represent it to be 106,50,0;[3] will represent it as 106,500. Provided ',' as the thousand separator in each case."), + 'grouping':fields.char('Separator Format',size=64,required=True,help="The Separator Format should be like [,n] where 0 < n :starting from Unit digit.-1 will end the separation. e.g. [3,2,-1] will represent 106500 to be 1,06,500;[1,2,-1] will represent it to be 106,50,0;[3] will represent it as 106,500. Provided ',' as the thousand separator in each case."), 'decimal_point':fields.char('Decimal Separator', size=64,required=True), 'thousands_sep':fields.char('Thousands Separator',size=64), } @@ -65,7 +66,7 @@ class lang(osv.osv): thousands_sep = lang_obj.thousands_sep or conv[monetary and 'mon_thousands_sep' or 'thousands_sep'] grouping = eval(lang_obj.grouping) - + if not grouping: return (s, 0) result = "" @@ -107,13 +108,13 @@ class lang(osv.osv): raise ValueError("format() must be given exactly one %char format specifier") lang_obj=self.browse(cr,uid,ids[0]) - + formatted = percent % value # floats and decimal ints need special action! if percent[-1] in 'eEfFgG': seps = 0 parts = formatted.split('.') - + if grouping: parts[0], seps = self._group(cr,uid,ids,parts[0], monetary=monetary)