Skip to content

Commit

Permalink
merge upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieFox authored and GrassBlock1 committed Jun 14, 2024
1 parent 8da6a27 commit a34fa97
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 22 deletions.
70 changes: 49 additions & 21 deletions src/component/message/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@ message.language = {
message.language.list = () => {

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
{ code: 'zh_CN', name: '简体中文'} // Chinese
{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
{code: 'zh_CN', name: '简体中文'} // Chinese
];

list.forEach((item) => {
Expand Down Expand Up @@ -77,11 +77,40 @@ message.get = (stringId) => {

let string;

if (browserDetect().chrome && typeof chrome != 'undefined') {
// if browser is chrome

if ('i18n' in chrome) {
// if installed as extension

string = chrome.i18n.getMessage(stringId);

}

} else if (browserDetect().firefox && typeof browser != 'undefined') {
// if browser is firefox

if ('i18n' in browser) {
// if installed as addon

string = browser.i18n.getMessage(stringId);

} else {

string = message.language.pack.en_GB[stringId].message;

}

} else {

string = message.language.pack.en_GB[stringId].message;

}

switch (state.get.current().language) {

// use system language
case 'system':

if (browserDetect().chrome && typeof chrome != 'undefined') {
// if browser is chrome

Expand Down Expand Up @@ -127,16 +156,15 @@ message.get = (stringId) => {
string = message.language.pack[state.get.current().language][stringId].message;

} else {

// or use default language
string = message.language.pack.en_GB[stringId].message;

}

break;

}


if (string && string.indexOf('{appName}') > -1) {

string = string.replaceAll('{appName}', APP_NAME);
Expand Down
2 changes: 1 addition & 1 deletion src/component/toolbarControl/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import * as form from '../form';
import { Button } from '../button';
import { Dropdown } from '../dropdown';

import { Control_inputButton } from '../control/inputButton';
import { Control_inputButton } from '../control';

import { node } from '../../utility/node';
import { applyCSSVar } from '../../utility/applyCSSVar';
Expand Down

0 comments on commit a34fa97

Please sign in to comment.