blob: 50167f07c2f68c5453cc09b2923159e2ae931771 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
odoo.define('mail/static/src/models/locale/locale.js', function (require) {
'use strict';
const { registerNewModel } = require('mail/static/src/model/model_core.js');
const { attr } = require('mail/static/src/model/model_field.js');
function factory(dependencies) {
class Locale extends dependencies['mail.model'] {
//----------------------------------------------------------------------
// Private
//----------------------------------------------------------------------
/**
* @private
* @returns {string}
*/
_computeLanguage() {
return this.env._t.database.parameters.code;
}
/**
* @private
* @returns {string}
*/
_computeTextDirection() {
return this.env._t.database.parameters.direction;
}
}
Locale.fields = {
/**
* Language used by interface, formatted like {language ISO 2}_{country ISO 2} (eg: fr_FR).
*/
language: attr({
compute: '_computeLanguage',
}),
textDirection: attr({
compute: '_computeTextDirection',
}),
};
Locale.modelName = 'mail.locale';
return Locale;
}
registerNewModel('mail.locale', factory);
});
|