-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocalize.js
More file actions
66 lines (66 loc) · 1.89 KB
/
localize.js
File metadata and controls
66 lines (66 loc) · 1.89 KB
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
var localize={
locals: {
'en': {
click_activation: 'click here to re-send the activation code',
email: "Email",
loading: " Loading...", //space at the beginning
loading_contacts: " Loading Contacts...", //space at the beginning
ratings_body: 'If you enjoy using gNext, whould you mind taking a moment to rate it? It won\'t take more than a minute. Thanks for your support!',
ratings_button_rate:'Rate gNext',
settings_language: "Language",
"": ""
},
'it': {
click_activation: 'clicca qui per ricevere il codice di attivazione',
email: "Email",
loading: " Loading...", //space at the beginning
loading_contacts: " Loading Contacts...", //space at the beginning
ratings_body: 'Se ti piace gNext, che ne dici di spendere un momento per valutarlo? Non richiedera\' piu\' di un minuto. Grazie!',
settings_language: "Lingua",
"": ""
}
},
/* DO NOT CHANGE UNDER THIS */
lang: '',
start: function(lang){
lang=lang.toLowerCase();
this.lang=lang;
var langs=this.locals;
$('.lang').each(function(){
var txt=$(this).data('lang');
var to=$(this).data('lang-to');
if(txt!==''&&typeof langs[lang]!=='undefined'&&typeof langs[lang][txt]!=='undefined'){
switch(to){
case 'text':
$(this).text(langs[lang][txt]);
break;
case 'placeholder':
case 'alt':
case 'title':
$(this).attr(to, langs[lang][txt]);
break;
case 'html':
default:
$(this).html(langs[lang][txt]);
break;
}
}
});
},
get: function(code){
var langs=this.locals, lang=this.lang;
if(code!==''&&typeof langs[lang]!=='undefined'&&typeof langs[lang][code]!=='undefined'){
return langs[lang][code];
}else{
return '';
}
}
};
//localize.start(lang);
//try{
// var userLang = navigator.language||navigator.userLanguage;
// var language=userLang.split("-");
// localize.start(lang);
//}catch(err){
// localize.start('en');
//}