修改语言。

This commit is contained in:
tengge1 2019-08-03 20:36:25 +08:00
parent 46fdbbc590
commit a96bb42ebc
3 changed files with 21 additions and 1 deletions

View File

@ -634,4 +634,5 @@ L_PARTITION_DIAGRAM = '分区图';
L_DIG = '挖坑';
L_EDIT_SCRIPT = '编辑脚本';
L_DELETE_SCRIPT = '删除脚本';
L_SCALE_LOCKED = '锁定缩放';
L_SCALE_LOCKED = '锁定缩放';
L_LANGUAGE = '语言';

View File

@ -12,6 +12,8 @@ class OptionsMenu extends React.Component {
this.handleRendererOptions = this.handleRendererOptions.bind(this);
this.handleHelperOptions = this.handleHelperOptions.bind(this);
this.handleFilterOptions = this.handleFilterOptions.bind(this);
this.handleChangeEnglish = this.handleChangeEnglish.bind(this);
this.handleChangeChinese = this.handleChangeChinese.bind(this);
}
render() {
@ -23,6 +25,10 @@ class OptionsMenu extends React.Component {
<MenuItemSeparator />
<MenuItem title={L_RENDERER} onClick={this.handleHelperOptions}></MenuItem>
<MenuItem title={L_FILTER} onClick={this.handleFilterOptions}></MenuItem>
<MenuItem title={L_LANGUAGE}>
<MenuItem title={'English'} onClick={this.handleChangeEnglish}></MenuItem>
<MenuItem title={'汉语'} onClick={this.handleChangeChinese}></MenuItem>
</MenuItem>
</MenuItem>;
}
@ -77,6 +83,18 @@ class OptionsMenu extends React.Component {
this.optionsWindow.show();
this.optionsWindow.changeTab(L_FILTER);
}
// ---------------------------- -------------------------------------------------
handleChangeEnglish() {
window.localStorage.setItem('lang', 'en-US');
window.location.reload();
}
handleChangeChinese() {
window.localStorage.setItem('lang', 'zh-CN');
window.location.reload();
}
}
export default OptionsMenu;

View File

@ -633,4 +633,5 @@ Object.assign(window, {
L_EDIT_SCRIPT: 'Edit Script',
L_DELETE_SCRIPT: 'Delete Script',
L_SCALE_LOCKED: 'Scale Locked',
L_LANGUAGE: 'Language',
});