GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 238aa3...3445b1 )
by Florian
01:11
created

js/lang.js   A

Complexity

Total Complexity 13
Complexity/F 1.3

Size

Lines of Code 87
Function Count 10

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 1 Features 1
Metric Value
cc 0
nc 1
dl 0
loc 87
rs 10
c 3
b 1
f 1
wmc 13
mnd 1
bc 13
fnc 10
bpm 1.3
cpm 1.3
noi 0

8 Functions

Rating   Name   Duplication   Size   Complexity  
A lang.js ➔ mytrans 0 9 2
A Lang.setEN 0 6 1
A Lang.set 0 9 1
A Lang.setRO 0 6 1
A Lang.setDE 0 6 1
A Lang.setPL 0 6 1
A Lang.setNL 0 6 1
B Lang.init 0 28 1
1
/*jslint
2
  regexp: true
3
  indent: 4
4
*/
5
6
/*global
7
  $, document, trackAction, i18next, i18nextXHRBackend, i18nextBrowserLanguageDetector, jqueryI18next
8
*/
9
10
var Lang = {};
11
12
Lang.init = function () {
13
    'use strict';
14
15
    i18next
16
        .use(i18nextXHRBackend)
17
        .use(i18nextBrowserLanguageDetector)
18
        .init({
19
            debug: false,
20
            load: 'all',
21
            resGetPath: 'lang/{{lng}}/{{ns}}.json',
22
            fallbackLng: "en",
23
            backend: {
24
                loadPath: 'lang/{{lng}}/{{ns}}.json'
25
            },
26
            detection: {
27
                order: ['querystring', 'cookie', 'localStorage', 'navigator'],
28
                lookupQuerystring: 'lang',
29
                lookupCookie: 'i18next',
30
                lookupLocalStorage: 'i18nextLng',
31
                caches: ['localStorage', 'cookie']
32
            }
33
        }, function (err) {
34
            if (!err) {
35
                jqueryI18next.init(i18next, $);
36
                $(document).localize();
37
            }
38
        });
39
};
40
41
Lang.set = function (lang) {
42
    'use strict';
43
44
    i18next.changeLanguage(lang, function (err) {
45
        if (!err) {
46
            $(document).localize();
47
        }
48
    });
49
};
50
51
Lang.setEN = function () {
52
    'use strict';
53
54
    trackAction("langEN");
55
    this.set("en");
56
};
57
58
59
Lang.setDE = function () {
60
    'use strict';
61
62
    trackAction("langDE");
63
    this.set("de");
64
};
65
66
Lang.setNL = function () {
67
    'use strict';
68
69
    trackAction("langNL");
70
    this.set("nl");
71
};
72
73
Lang.setRO = function () {
74
    'use strict';
75
76
    trackAction("langRO");
77
    this.set("ro");
78
};
79
80
Lang.setPL = function () {
81
    'use strict';
82
83
    trackAction("langPL");
84
    this.set("pl");
85
};
86
87
88
function mytrans(key) {
89
    'use strict';
90
91
    if (typeof $.t === "function") {
92
        return $.t(key);
93
    }
94
95
    return key;
96
}
97