forked from phpvirtualbox/phpvirtualbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettingsGlobalLanguage.html
72 lines (65 loc) · 2.58 KB
/
settingsGlobalLanguage.html
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
<!--
Language Settings
Copyright (C) 2010-2015 Ian Moore (imoore76 at yahoo dot com)
$Id: settingsGlobalLanguage.html 595 2015-04-17 09:50:36Z imoore76 $
-->
<table style='width: auto; margin-left:auto; margin-right:auto;' class='vboxInvisible'>
<tr>
<td style='text-align: left'><span class='translate'>Interface Language:</span></td>
</tr>
<tr>
<td>
<div style='width: 100%; height: 100%;'>
<ul id='vboxLanguageList' class='vboxBordered vboxList vboxHover'>
<li class='vboxListItem'>Default</li>
</ul>
<div id='vboxLanguageName' style='text-align: center; padding: 4px;'></div>
</div>
</td>
</tr>
</table>
<script type='text/javascript'>
/* Fill Languages */
var vboxLanguages = [
{'id':'en','name':'English'},
{'id':'pt_br','name':'Portuguese (Brazil)','name_tr':'Português (Brasil)'},
{'id':'ru','name':'Russian','name_tr':'Русский'},
{'id':'it','name':'Italian','name_tr':'Italiano'},
{'id':'fr','name':'French','name_tr':'Français'},
{'id':'de','name':'German','name_tr':'Deutsch'},
{'id':'es','name':'Spanish','name_tr':'Español'},
{'id':'ja','name':'Japanese','name_tr':'日本語'},
{'id':'pl','name':'Polish','name_tr':'Polski'},
{'id':'zh_cn','name':'Chinese (China)','name_tr':'简体中文 (中国)'},
{'id':'zh_tw','name':'Traditional Chinese','name_tr':'正體中文'},
{'id':'ro','name':'Romanian','name_tr':'Română'},
{'id':'nl','name':'Dutch','name_tr':'Nederlands (Nederland)'},
{'id':'cs','name':'Czech','name_tr':'čeština'},
];
var lList = $('#vboxLanguageList');
$(lList).children().remove();
var defLang = __vboxLangName;
if (!defLang) defLang = 'en';
for(var i = 0; i < vboxLanguages.length; i++) {
var li = $('<li />').data({'language':vboxLanguages[i]}).html((vboxLanguages[i].name_tr ? vboxLanguages[i].name_tr : vboxLanguages[i].name)).attr('class','vboxListItem').hoverClass("vboxHover");
if(defLang == vboxLanguages[i].id) {
$(li).addClass('vboxListItemSelected');
$('#vboxLanguageName').html(vboxLanguages[i].name + (vboxLanguages[i].name_tr ? (' / ' + vboxLanguages[i].name_tr) : ''));
}
$(li).click(function(){
$(this).addClass('vboxListItemSelected').siblings().removeClass('vboxListItemSelected');
$('#vboxLanguageName').html($(this).data('language').name + ($(this).data('language').name_tr ? (' / ' + $(this).data('language').name_tr) : ''));
});
$(lList).append(li);
}
/*
*
* Update Data onSave()
*
*/
$('#vboxSettingsDialog').on('save',function(){
var lang = $('#vboxLanguageList').children('li.vboxListItemSelected').first().data('language');
if(!lang) return;
$('#vboxSettingsDialog').data('language', lang.id);
});
</script>