MCPcopy Index your code
hub / github.com/EmulatorJS/EmulatorJS / localization

Method localization

data/src/emulator.js:481–494  ·  view source on GitHub ↗
(text, log)

Source from the content-addressed store, hash-verified

479 this.elements.parent.appendChild(this.textElem);
480 }
481 localization(text, log) {
482 if (typeof text === "undefined" || text.length === 0) return;
483 text = text.toString();
484 if (text.includes("EmulatorJS v")) return text;
485 if (this.config.langJson) {
486 if (typeof log === "undefined") log = true;
487 if (!this.config.langJson[text] && log) {
488 if (!this.missingLang.includes(text)) this.missingLang.push(text);
489 console.log(`Translation not found for '${text}'. Language set to '${this.config.language}'`);
490 }
491 return this.config.langJson[text] || text;
492 }
493 return text;
494 }
495 checkCompression(data, msg, fileCbFunc) {
496 if (!this.compression) {
497 this.compression = new window.EJS_COMPRESSION(this);

Callers 15

createStartButtonMethod · 0.95
createTextMethod · 0.95
downloadGameCoreMethod · 0.95
gotCoreMethod · 0.95
downloadStartStateMethod · 0.95
downloadGameFileMethod · 0.95
downloadGamePatchMethod · 0.95
downloadGameParentMethod · 0.95
downloadBiosMethod · 0.95
downloadRomMethod · 0.95
gotGameDataMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected