Skip to content

Commit

Permalink
feat(nsis): add de, it, fr, hu, pl translations for one-click installer
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed May 8, 2017
1 parent dcd0e17 commit d8aa078
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"isbinaryfile": "^3.0.2",
"js-yaml": "^3.8.3",
"mime": "^1.3.4",
"minimatch": "^3.0.3",
"minimatch": "^3.0.4",
"node-emoji": "^1.5.1",
"node-forge": "^0.7.1",
"normalize-package-data": "^2.3.8",
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"is-ci": "^1.0.10",
"isbinaryfile": "^3.0.2",
"js-yaml": "^3.8.3",
"minimatch": "^3.0.3",
"minimatch": "^3.0.4",
"node-forge": "^0.7.1",
"normalize-package-data": "^2.3.8",
"parse-color": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-builder/src/targets/license.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as path from "path"
import { PlatformPackager } from "../platformPackager"

// "el_GR" "lv_LV" "ko_KR" "tr_TR"
export const bundledLanguages = ["en_US", "de_DE", "fr_FR", "es_ES", "zh_CN", "zh_TW", "ja_JP", "it_IT", "nl_NL", "ru_RU", "pl_PL", "uk_UA", "cs_CZ", "sv_SE", "nb_NO", "da_DK", "pt_PT"]
export const bundledLanguages = ["en_US", "de_DE", "fr_FR", "es_ES", "zh_CN", "zh_TW", "ja_JP", "it_IT", "nl_NL", "ru_RU", "pl_PL", "uk_UA", "cs_CZ", "sv_SE", "nb_NO", "da_DK", "pt_PT", "hu_HU"]
const langToLangWithRegion = new Map<string, string>()
for (const id of bundledLanguages) {
langToLangWithRegion.set(id.substring(0, id.indexOf("_")), id)
Expand Down
9 changes: 7 additions & 2 deletions packages/electron-builder/src/targets/nsis.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import BluebirdPromise from "bluebird-lst"
import _debug from "debug"
import { Arch, Target } from "electron-builder-core"
import { asArray, debug, doSpawn, exec, getPlatformIconFileName, handleProcess, isEmptyOrSpaces, use } from "electron-builder-util"
import { getBinFromBintray } from "electron-builder-util/out/binDownload"
Expand All @@ -17,11 +18,13 @@ import { WinPackager } from "../winPackager"
import { archive } from "./archive"
import { bundledLanguages, getLicenseFiles, lcid, toLangWithRegion } from "./license"

const debugLang = _debug("electron-builder:lang")

// noinspection SpellCheckingInspection
const ELECTRON_BUILDER_NS_UUID = "50e065bc-3134-11e6-9bab-38c9862bdaf3"

// noinspection SpellCheckingInspection
const nsisPathPromise = getBinFromBintray("nsis", "3.0.1.10", "302a8adebf0b553f74cddd494154a586719ff9d4767e94d8a76547a9bb06200c")
const nsisPathPromise = getBinFromBintray("nsis", "3.0.1.11", "f2489ee90a68f9dad28e724e58bc9d4289390db58359500107b4eabc7a12e846")
// noinspection SpellCheckingInspection
const nsisResourcePathPromise = getBinFromBintray("nsis-resources", "3.0.0", "cde0e77b249e29d74250bf006aa355d3e02b32226e1c6431fb48facae41d8a7e")

Expand Down Expand Up @@ -421,7 +424,9 @@ export class NsisTarget extends Target {
let scriptHeader = `!addincludedir "${path.join(__dirname, "..", "..", "templates", "nsis", "include")}"\n`

const addCustomMessageFileInclude = async (input: string) => {
return '!include "' + await this.writeCustomLangFile(computeCustomMessageTranslations(safeLoad(await readFile(path.join(this.nsisTemplatesDir, input), "utf-8"))).join("\n")) + '"\n'
const data = computeCustomMessageTranslations(safeLoad(await readFile(path.join(this.nsisTemplatesDir, input), "utf-8"))).join("\n")
debugLang(data)
return '!include "' + await this.writeCustomLangFile(data) + '"\n'
}

const tasks: Array<() => Promise<any>> = [
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-builder/templates/nsis/langs.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#!insertmacro MUI_LANGUAGE "Slovak"
#!insertmacro MUI_LANGUAGE "Croatian"
#!insertmacro MUI_LANGUAGE "Bulgarian"
#!insertmacro MUI_LANGUAGE "Hungarian"
!insertmacro MUI_LANGUAGE "Hungarian"
#!insertmacro MUI_LANGUAGE "Thai"
#!insertmacro MUI_LANGUAGE "Romanian"
#!insertmacro MUI_LANGUAGE "Latvian"
Expand Down
27 changes: 26 additions & 1 deletion packages/electron-builder/templates/nsis/messages.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,40 @@
win7Required:
de: Windows 7 oder höher wird vorausgesetzt
it: È necessario disporre del sistema operativo Windows 7 e successivi
fr: Windows 7 (ou une version ultérieure) est requis
en: Windows 7 and above is required
ru: Требуется Windows 7 и выше
hu: Windows 7 vagy újabb szükséges
pl: Windows 7 lub nowszy jest wymagany
x64WinRequired:
de: 64-Bit-Windows wird vorausgesetzt
it: È necessario disporre di un sistema operativo Windows a 64 bit
fr: Windows 64 bits est requis
en: 64-bit Windows is required
ru: Требуется Windows 64-bit
hu: 64-bit Windows szükséges
pl: Windows 64-bitowy jest wymagany
appRunning:
de: "${PRODUCT_NAME} ist geöffnet. \nKlicken Sie zum Schliessen auf «OK»."
it: "${PRODUCT_NAME} è in esecuzione. \nPremi OK per chiudere."
fr: "${PRODUCT_NAME} est en cours d’utilisation. \nCliquez sur «OK» pour fermer ce programme."
en: "${PRODUCT_NAME} is running.\nClick OK to close it."
ru: "Приложение ${PRODUCT_NAME} уже запущено.\nНажмите OK для закрытия."
hu: "${PRODUCT_NAME} éppen fut. \nKattiontson az «OK»-ra a bezárásához."
pl: "${PRODUCT_NAME} jest otwarty. Aby zamknąć kliknij na OK."
installing:
de: Installation läuft, bitte warten...
it: Attendere prego. Installazione in corso...
fr: En cours d’installation... Veuillez patienter svp
en: Installing, please wait...
ru: Установка, пожалуйста подождите...
hu: Telepítés, kérem várjon...
pl: Zaczekaj na ukończenie instalacji...
areYouSureToUninstall:
de: Sind Sie sicher, dass Sie ${PRODUCT_NAME} deinstallieren möchten?
it: Sicuro di voler procedere alla disinstallazione di ${PRODUCT_NAME}?
fr: Etes-vous sûr(e) de vouloir désinstaller ${PRODUCT_NAME}?
en: Are you sure you want to uninstall ${PRODUCT_NAME}?
ru: Вы уверены, что хотите удалить ${PRODUCT_NAME}?
ru: Вы уверены, что хотите удалить ${PRODUCT_NAME}?
hu: Biztos benne, hogy szeretné eltávolítani a ${PRODUCT_NAME} alkalmazást?
pl: Czy na pewno chcesz odinstalować ${PRODUCT_NAME}?
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ boxen@^1.0.0:
term-size "^0.1.0"
widest-line "^1.0.0"

brace-expansion@^1.0.0:
brace-expansion@^1.1.7:
version "1.1.7"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.7.tgz#3effc3c50e000531fb720eaff80f0ae8ef23cf59"
dependencies:
Expand Down Expand Up @@ -2317,11 +2317,11 @@ mimic-fn@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18"

"minimatch@2 || 3", minimatch@^3.0.2, minimatch@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774"
"minimatch@2 || 3", minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
dependencies:
brace-expansion "^1.0.0"
brace-expansion "^1.1.7"

[email protected], minimist@~0.0.1:
version "0.0.8"
Expand Down

0 comments on commit d8aa078

Please sign in to comment.