- fix if statment

- move `window.EJS_missingLang` to the `this`
This commit is contained in:
Allan Niles 2023-08-12 14:53:17 +00:00 committed by GitHub
parent 909818a6ec
commit f681bfe853
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -234,6 +234,7 @@ class EmulatorJS {
this.debug = (window.EJS_DEBUG_XX === true);
if (this.debug || (window.location && ['localhost', '127.0.0.1'].includes(location.hostname))) this.checkForUpdates();
this.netplayEnabled = (window.EJS_DEBUG_XX === true) && (window.EJS_EXPERIMENTAL_NETPLAY === true);
this.settingsLanguage = window.EJS_settingsLanguage || false;
this.config = config;
this.currentPopup = null;
this.isFastForward = false;
@ -417,6 +418,7 @@ class EmulatorJS {
if (!isNaN(text)) return text;
if (text.includes("EmulatorJS v")) return text;
if (this.config.langJson) {
if (typeof log === "undefined") log = true;
if (!this.config.langJson[text] && log) {
if(!window.EJS_missingLang) window.EJS_missingLang = [];
window.EJS_missingLang.push(text);
@ -3407,9 +3409,9 @@ class EmulatorJS {
if (options.length === 1) return;
let availableOptions = {};
for (let i=0; i<options.length; i++) {
availableOptions[options[i]] = this.localization(options[i], this.config.settingsLanguage);
availableOptions[options[i]] = this.localization(options[i], this.settingsLanguage);
}
addToMenu(this.localization(optionName, this.config.settingsLanguage),
addToMenu(this.localization(optionName, this.settingsLanguage),
name.split("|")[0], availableOptions,
(name.split("|").length > 1) ? name.split("|")[1] : options[0].replace('(Default) ', ''));
})

View file

@ -72,7 +72,6 @@
config.gameId = window.EJS_gameID;
config.backgroundImg = window.EJS_backgroundImage;
config.controlScheme = window.EJS_controlScheme;
config.settingsLanguage = window.EJS_settingsLanguage || false;
if (typeof window.EJS_language === "string" && window.EJS_language !== "en-US") {
try {