remove local language select in favour of os level language

This commit is contained in:
zombieFox 2024-06-14 00:46:42 +01:00
parent 515a8cc3b1
commit 3dfa2a7a6d
1 changed files with 22 additions and 28 deletions

View File

@ -1,18 +1,12 @@
import { message } from '../../message'; import { message } from '../../message';
import { state } from '../../state'; 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 { APP_NAME } from '../../../constant';
import { Alert } from '../../alert'; import { Alert } from '../../alert';
import { Link } from '../../link'; import { Link } from '../../link';
import { Control_select } from '../../control/select';
import { node } from '../../../utility/node'; import { node } from '../../../utility/node';
@ -34,26 +28,26 @@ languageSetting.language = (parent) => {
}; };
languageSetting.control.language.selected = new Control_select({ // languageSetting.control.language.selected = new Control_select({
path: 'language.selected', // path: 'language.selected',
id: 'language-selected', // id: 'language-selected',
labelText: message.get('menuContentLanguageSelect'), // labelText: message.get('menuContentLanguageSelect'),
srOnly: true, // srOnly: true,
option: message.language.list(), // option: message.language.list(),
selected: selectedLanguageIndex(), // selected: selectedLanguageIndex(),
action: () => { // action: () => {
//
state.get.current().language = message.language.code()[languageSetting.control.language.selected.selected()]; // state.get.current().language = message.language.code()[languageSetting.control.language.selected.selected()];
data.save(); // data.save();
toolbar.bar.render(); // toolbar.bar.render();
header.item.clear(); // header.item.clear();
header.item.render(); // header.item.render();
groupAndBookmark.render(); // groupAndBookmark.render();
menu.close(); // menu.close();
menu.open(); // menu.open();
//
} // }
}); // });
languageSetting.control.link = new Link({ languageSetting.control.link = new Link({
text: message.get('menuContentLanguageAlertLink'), text: message.get('menuContentLanguageAlertLink'),
@ -64,14 +58,14 @@ languageSetting.language = (parent) => {
languageSetting.control.alert = new Alert({ languageSetting.control.alert = new Alert({
iconName: 'globe', iconName: 'globe',
children: [ children: [
node(`p:${message.get('menuContentLanguageAlertPara')}`), node(`p:${message.get('menuContentLanguageAlertPara') || 'Text'}`),
node('p', languageSetting.control.link.link()) node('p', languageSetting.control.link.link())
] ]
}); });
parent.appendChild( parent.appendChild(
node('div', [ node('div', [
languageSetting.control.language.selected.wrap(), // languageSetting.control.language.selected.wrap(),
languageSetting.control.alert.wrap() languageSetting.control.alert.wrap()
]) ])
); );