-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Lang.js
35 lines (29 loc) · 999 Bytes
/
Lang.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
/* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD
* license. See http://svn.openlayers.org/trunk/openlayers/license.txt for the
* full text of the license. */
/**
* Namespace: Lang
* Internationalization namespace. Contains dictionaries in various languages
* and methods to set and get the current language.
*/
Lang = {
registerLinks: function () {
var languages = {
'#spanish': 'es',
'#english': 'en'
};
for (var id in languages) {
var domNode = Ext.DomQuery.selectNode(id);
if (domNode) {
domNode.onclick = (function(langcode) {
return function () {
(new Ext.state.CookieProvider).set("locale", langcode);
window.location.reload();
return false;
};
})(languages[id]);
}
}
}
};
Ext.onReady(Lang.registerLinks);