-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.js
executable file
·81 lines (69 loc) · 1.63 KB
/
bootstrap.js
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
const i18n_cache = alchemy.shared('I18n.cache'),
countries = alchemy.shared('I18n.countries'),
seen = alchemy.shared('I18n.seen');
/**
* Create an i18n string
*
* @author Jelle De Loecker <[email protected]>
* @since 0.2.0
* @version 0.2.0
*
* @return {I18n}
*/
global.__ = function __(domain, key, parameters) {
var translation;
if (Object.isObject(key)) {
parameters = key;
key = domain;
domain = 'default';
} else if (key == null) {
key = domain;
domain = 'default';
}
translation = new Classes.Alchemy.I18n(domain, key, {parameters: parameters});
return translation;
};
/**
* Create an i18n object
*
* @author Jelle De Loecker <[email protected]>
* @since 0.5.0
* @version 0.6.3
*
* @return {I18n}
*/
Classes.Alchemy.Base.setMethod(function __(domain, key, parameters) {
if (this.conduit) {
return this.conduit.renderer.__(domain, key, parameters);
}
return new Classes.Alchemy.I18n(domain, key, parameters);
});
/**
* Create an i18n object
*
* @author Jelle De Loecker <[email protected]>
* @since 0.5.0
* @version 0.6.0
*
* @return {I18n}
*/
Classes.Alchemy.Base.setMethod(function __d(domain, key, parameters) {
if (this.conduit) {
return this.conduit.renderer.__d(domain, key, parameters);
}
return new Classes.Alchemy.I18n(domain, key, options);
});
/**
* Get the remote translation cache
*
* @author Jelle De Loecker <[email protected]>
* @since 0.7.0
* @version 0.7.0
*
* @return {Cache}
*/
Plugin.getRemoteCache = function getRemoteCache() {
return alchemy.getCache('remote_i18n_microcopy', {
max_age : '2 hours'
});
};