improve language select option text

This commit is contained in:
Kuldeep M 2022-01-21 11:44:33 +00:00 committed by GitHub
parent 22233e0dce
commit 83e7631860
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 34 additions and 20 deletions

View File

@ -29,28 +29,42 @@ message.language = {
message.language.list = () => {
return [
{ code: 'system', name: message.get('menuContentLanguageSystem') }, // system
{ name: '', disabled: true },
{ code: 'bn', name: 'বাংলা [bn]' }, // Bengali
{ code: 'de', name: 'Deutsch [de]' }, // German
{ code: 'en_GB', name: 'English [en] (GB)' }, // English GB
{ code: 'en_US', name: 'English [en] (US)' }, // English USA
{ code: 'es', name: 'Español [es]' }, // Spanish
{ code: 'fil', name: 'Filipino [fi]' }, // Filipino
{ code: 'fr', name: 'Français [fr]' }, // French
{ code: 'gu', name: 'ગુજરાતી [gu]' }, // Gujarati
{ code: 'hi', name: 'हिंदी [hi]' }, // Hindi
{ code: 'id', name: 'Indonesia [id]' }, // Indonesian
{ code: 'it', name: 'Italiano [it]' }, // Italian
{ code: 'ja', name: '日本語 [ja]' }, // Japanese
{ code: 'ms', name: 'Melayu [ms]' }, // Malay
{ code: 'pt', name: 'Português [pt]' }, // Portuguese
{ code: 'ru', name: 'Pусский [ru]' }, // Russian
{ code: 'uk', name: 'український [uk]' }, // Ukrainian
{ code: 'vi', name: 'англійська [vi]' } // Vietnamese
const list = [
{ code: 'bn', name: 'বাংলা' }, // Bengali
{ code: 'de', name: 'Deutsch' }, // German
{ code: 'en_GB', name: 'English' }, // English GB
{ code: 'en_US', name: 'English' }, // English USA
{ code: 'es', name: 'Español' }, // Spanish
{ code: 'fil', name: 'Filipino' }, // Filipino
{ code: 'fr', name: 'Français' }, // French
{ code: 'gu', name: 'ગુજરાતી' }, // Gujarati
{ code: 'hi', name: 'हिंदी' }, // Hindi
{ code: 'id', name: 'Indonesia' }, // Indonesian
{ code: 'it', name: 'Italiano' }, // Italian
{ code: 'ja', name: '日本語' }, // Japanese
{ code: 'ms', name: 'Melayu' }, // Malay
{ code: 'pt', name: 'Português' }, // Portuguese
{ code: 'ru', name: 'Pусский' }, // Russian
{ code: 'uk', name: 'український' }, // Ukrainian
{ code: 'vi', name: 'англійська' } // Vietnamese
];
list.forEach((item) => {
if (item.code.indexOf('_') > -1) {
item.name = `${item.name}${(item.code.substring(0, item.code.indexOf('_'))).toUpperCase()} (${item.code.substring(item.code.indexOf('_') + 1, item.code.length)})`;
} else {
item.name = `${item.name}${(item.code).toUpperCase()}`;
}
});
list.unshift({ name: '—', disabled: true });
list.unshift({ code: 'system', name: message.get('menuContentLanguageSystem') });
return list;
};
message.language.name = () => message.language.list().map(item => item.name);