Total Complexity | 8 |
Complexity/F | 1.33 |
Lines of Code | 29 |
Function Count | 6 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | /* |
||
9 | API.i18n = { |
||
10 | getAcceptLanguages: function() { |
||
11 | if (API.promise) { |
||
12 | return API.api.i18n.getAcceptLanguages(); |
||
13 | } |
||
14 | else { |
||
15 | return new C_Promise(function(){ |
||
16 | API.extension.getAcceptLanguages((function(data){ |
||
17 | this.call_then(data); |
||
18 | }).bind(this)); |
||
19 | }); |
||
20 | } |
||
21 | }, |
||
22 | detectLanguage: function() { |
||
23 | if (API.promise) { |
||
24 | return API.api.i18n.detectLanguage(); |
||
25 | } |
||
26 | else { |
||
27 | return new C_Promise(function(){ |
||
28 | API.api.i18n.detectLanguage((function(isReliable, languages){ |
||
29 | this.call_then(isReliable, languages); |
||
30 | }).bind(this)); |
||
31 | }); |
||
32 | } |
||
33 | }, |
||
34 | getMessage: API.api.i18n.getMessage, |
||
35 | getUILanguage: API.api.i18n.getUILanguage |
||
36 | |||
37 | }; |