* Load a translation file (json) and remember the data. * @param {Module} module The module to load the translation file for. * @param {string} file Path of the file we want to load. * @param {boolean} isFallback Flag to indicate fallback translations.
(module, file, isFallback)
| 86 | * @param {boolean} isFallback Flag to indicate fallback translations. |
| 87 | */ |
| 88 | async load (module, file, isFallback) { |
| 89 | Log.log(`[translator] ${module.name} - Load translation${isFallback ? " fallback" : ""}: ${file}`); |
| 90 | |
| 91 | if (this.translationsFallback[module.name]) { |
| 92 | return; |
| 93 | } |
| 94 | |
| 95 | const json = await loadJSON(module.file(file)); |
| 96 | const property = isFallback ? "translationsFallback" : "translations"; |
| 97 | this[property][module.name] = json; |
| 98 | }, |
| 99 | |
| 100 | /** |
| 101 | * Load the core translations. |