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