forked from olcxjas-softworks/LarpixClient
update electron to v43
This commit is contained in:
parent
68ac0beedf
commit
fb6c8b6ee9
5385 changed files with 513060 additions and 123058 deletions
18
electron/node_modules/app-builder-lib/out/targets/nsis/nsisLang.js
generated
vendored
18
electron/node_modules/app-builder-lib/out/targets/nsis/nsisLang.js
generated
vendored
|
|
@ -1,14 +1,16 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.addCustomMessageFileInclude = exports.createAddLangsMacro = exports.LangConfigurator = void 0;
|
||||
exports.LangConfigurator = void 0;
|
||||
exports.createAddLangsMacro = createAddLangsMacro;
|
||||
exports.addCustomMessageFileInclude = addCustomMessageFileInclude;
|
||||
const builder_util_1 = require("builder-util");
|
||||
const langs_1 = require("../../util/langs");
|
||||
const debug_1 = require("debug");
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const js_yaml_1 = require("js-yaml");
|
||||
const path = require("path");
|
||||
const langs_1 = require("../../util/langs");
|
||||
const nsisUtil_1 = require("./nsisUtil");
|
||||
const debug = debug_1.default("electron-builder:nsis");
|
||||
const debug = (0, debug_1.default)("electron-builder:nsis");
|
||||
class LangConfigurator {
|
||||
constructor(options) {
|
||||
const rawList = options.installerLanguages;
|
||||
|
|
@ -19,7 +21,7 @@ class LangConfigurator {
|
|||
this.isMultiLang = options.multiLanguageInstaller !== false;
|
||||
}
|
||||
if (this.isMultiLang) {
|
||||
this.langs = rawList == null ? langs_1.bundledLanguages.slice() : builder_util_1.asArray(rawList).map(it => langs_1.toLangWithRegion(it.replace("-", "_")));
|
||||
this.langs = rawList == null ? langs_1.bundledLanguages.slice() : (0, builder_util_1.asArray)(rawList).map(it => (0, langs_1.toLangWithRegion)(it.replace("-", "_")));
|
||||
}
|
||||
else {
|
||||
this.langs = ["en_US"];
|
||||
|
|
@ -57,19 +59,17 @@ function createAddLangsMacro(scriptGenerator, langConfigurator) {
|
|||
}
|
||||
scriptGenerator.macro("addLangs", result);
|
||||
}
|
||||
exports.createAddLangsMacro = createAddLangsMacro;
|
||||
async function writeCustomLangFile(data, packager) {
|
||||
const file = await packager.getTempFile("messages.nsh");
|
||||
await fs_extra_1.outputFile(file, data);
|
||||
await (0, fs_extra_1.outputFile)(file, data);
|
||||
return file;
|
||||
}
|
||||
async function addCustomMessageFileInclude(input, packager, scriptGenerator, langConfigurator) {
|
||||
const data = js_yaml_1.load(await fs_extra_1.readFile(path.join(nsisUtil_1.nsisTemplatesDir, input), "utf-8"));
|
||||
const data = (0, js_yaml_1.load)(await (0, fs_extra_1.readFile)(path.join(nsisUtil_1.nsisTemplatesDir, input), "utf-8"));
|
||||
const instructions = computeCustomMessageTranslations(data, langConfigurator).join("\n");
|
||||
debug(instructions);
|
||||
scriptGenerator.include(await writeCustomLangFile(instructions, packager));
|
||||
}
|
||||
exports.addCustomMessageFileInclude = addCustomMessageFileInclude;
|
||||
function computeCustomMessageTranslations(messages, langConfigurator) {
|
||||
const result = [];
|
||||
const includedLangs = new Set(langConfigurator.langs);
|
||||
|
|
@ -77,7 +77,7 @@ function computeCustomMessageTranslations(messages, langConfigurator) {
|
|||
const langToTranslations = messages[messageId];
|
||||
const unspecifiedLangs = new Set(langConfigurator.langs);
|
||||
for (const lang of Object.keys(langToTranslations)) {
|
||||
const langWithRegion = langs_1.toLangWithRegion(lang);
|
||||
const langWithRegion = (0, langs_1.toLangWithRegion)(lang);
|
||||
if (!includedLangs.has(langWithRegion)) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue