remove local language select in favour of os level language
This commit is contained in:
parent
515a8cc3b1
commit
3dfa2a7a6d
|
@ -1,18 +1,12 @@
|
|||
import { message } from '../../message';
|
||||
|
||||
import { state } from '../../state';
|
||||
import { data } from '../../data';
|
||||
import { header } from '../../header';
|
||||
import { groupAndBookmark } from '../../groupAndBookmark';
|
||||
import { menu } from '../../menu';
|
||||
import { toolbar } from '../../toolbar';
|
||||
|
||||
import { APP_NAME } from '../../../constant';
|
||||
|
||||
import { Alert } from '../../alert';
|
||||
import { Link } from '../../link';
|
||||
|
||||
import { Control_select } from '../../control/select';
|
||||
|
||||
import { node } from '../../../utility/node';
|
||||
|
||||
|
@ -34,26 +28,26 @@ languageSetting.language = (parent) => {
|
|||
|
||||
};
|
||||
|
||||
languageSetting.control.language.selected = new Control_select({
|
||||
path: 'language.selected',
|
||||
id: 'language-selected',
|
||||
labelText: message.get('menuContentLanguageSelect'),
|
||||
srOnly: true,
|
||||
option: message.language.list(),
|
||||
selected: selectedLanguageIndex(),
|
||||
action: () => {
|
||||
|
||||
state.get.current().language = message.language.code()[languageSetting.control.language.selected.selected()];
|
||||
data.save();
|
||||
toolbar.bar.render();
|
||||
header.item.clear();
|
||||
header.item.render();
|
||||
groupAndBookmark.render();
|
||||
menu.close();
|
||||
menu.open();
|
||||
|
||||
}
|
||||
});
|
||||
// languageSetting.control.language.selected = new Control_select({
|
||||
// path: 'language.selected',
|
||||
// id: 'language-selected',
|
||||
// labelText: message.get('menuContentLanguageSelect'),
|
||||
// srOnly: true,
|
||||
// option: message.language.list(),
|
||||
// selected: selectedLanguageIndex(),
|
||||
// action: () => {
|
||||
//
|
||||
// state.get.current().language = message.language.code()[languageSetting.control.language.selected.selected()];
|
||||
// data.save();
|
||||
// toolbar.bar.render();
|
||||
// header.item.clear();
|
||||
// header.item.render();
|
||||
// groupAndBookmark.render();
|
||||
// menu.close();
|
||||
// menu.open();
|
||||
//
|
||||
// }
|
||||
// });
|
||||
|
||||
languageSetting.control.link = new Link({
|
||||
text: message.get('menuContentLanguageAlertLink'),
|
||||
|
@ -64,14 +58,14 @@ languageSetting.language = (parent) => {
|
|||
languageSetting.control.alert = new Alert({
|
||||
iconName: 'globe',
|
||||
children: [
|
||||
node(`p:${message.get('menuContentLanguageAlertPara')}`),
|
||||
node(`p:${message.get('menuContentLanguageAlertPara') || 'Text'}`),
|
||||
node('p', languageSetting.control.link.link())
|
||||
]
|
||||
});
|
||||
|
||||
parent.appendChild(
|
||||
node('div', [
|
||||
languageSetting.control.language.selected.wrap(),
|
||||
// languageSetting.control.language.selected.wrap(),
|
||||
languageSetting.control.alert.wrap()
|
||||
])
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue