[imp] added loading of encoding parameters
bzr revid: nicolas.vanhoren@openerp.com-20110816122450-1cpa3oq8j31hr4xd
This commit is contained in:
parent
f713807311
commit
81ea898b8c
|
@ -175,7 +175,15 @@ class WebClient(openerpweb.Controller):
|
||||||
for x in po:
|
for x in po:
|
||||||
if x.id:
|
if x.id:
|
||||||
transl["messages"].append({'id': x.id, 'string': x.string})
|
transl["messages"].append({'id': x.id, 'string': x.string})
|
||||||
return {"modules": transs}
|
lang_model = req.session.model('res.lang')
|
||||||
|
ids = lang_model.search([("code", "=", lang)])
|
||||||
|
if ids:
|
||||||
|
lang_obj = lang_model.read(ids[0], ["direction", "date_format", "time_format",
|
||||||
|
"grouping", "decimal_point", "thousands_sep"])
|
||||||
|
else:
|
||||||
|
lang_obj = None
|
||||||
|
return {"modules": transs,
|
||||||
|
"lang_parameters": lang_obj}
|
||||||
|
|
||||||
|
|
||||||
class Database(openerpweb.Controller):
|
class Database(openerpweb.Controller):
|
||||||
|
|
|
@ -566,6 +566,12 @@ openerp.base.OldWidget = openerp.base.Widget.extend({
|
||||||
openerp.base.TranslationDataBase = openerp.base.Class.extend({
|
openerp.base.TranslationDataBase = openerp.base.Class.extend({
|
||||||
init: function() {
|
init: function() {
|
||||||
this.db = {};
|
this.db = {};
|
||||||
|
this.parameters = {"direction": 'ltr',
|
||||||
|
"date_format": '%m/%d/%Y',
|
||||||
|
"time_format": '%H:%M:%S',
|
||||||
|
"grouping": "[]",
|
||||||
|
"decimal_point": ".",
|
||||||
|
"thousands_sep": ","};
|
||||||
},
|
},
|
||||||
set_bundle: function(translation_bundle) {
|
set_bundle: function(translation_bundle) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
@ -577,6 +583,9 @@ openerp.base.TranslationDataBase = openerp.base.Class.extend({
|
||||||
_.each(modules, function(name) {
|
_.each(modules, function(name) {
|
||||||
self.add_module_translation(translation_bundle.modules[name]);
|
self.add_module_translation(translation_bundle.modules[name]);
|
||||||
});
|
});
|
||||||
|
if (translation_bundle.lang_parameters) {
|
||||||
|
this.parameters = translation_bundle.lang_parameters;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
add_module_translation: function(mod) {
|
add_module_translation: function(mod) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
Loading…
Reference in New Issue