Skip to content

Commit

Permalink
WIP(nsis): translate custom strings
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Apr 7, 2017
1 parent 897fcf2 commit fa50854
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 17 deletions.
1 change: 1 addition & 0 deletions .idea/dictionaries/develar.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
osx_image: xcode8.3
#osx_image: xcode8.3

matrix:
include:
Expand Down
28 changes: 23 additions & 5 deletions packages/electron-builder/templates/nsis/messages.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
win7Required:
en: "Windows 7 and above is required"
ru: "Требуется Windows 7 и выше"
en: Windows 7 and above is required
ru: Требуется Windows 7 и выше
x64WinRequired:
en: "64-bit Windows is required"
ru: "Требуется Windows 64-bit"
en: 64-bit Windows is required
ru: Требуется Windows 64-bit
appRunning:
en: "${PRODUCT_NAME} is running.\nClick OK to close it."
ru: "Приложение ${PRODUCT_NAME} уже запущено.\nНажмите OK для закрытия."
ru: "Приложение ${PRODUCT_NAME} уже запущено.\nНажмите OK для закрытия."
chooseInstallationOptions:
en: Choose Installation Options
ru: Выберите опции установки
chooseUninstallationOptions:
en: Choose Uninstallation Options
ru: Выберите опции удаления
freshInstallForAll:
en: Fresh install for all users.
ru: Новая установка для всех пользователей.
freshInstallForCurrent:
en: Fresh install for current user only.
ru: Новая установка только для текущего пользователя.
onlyForMe:
en: Only for &me
ru: Только для &меня
forAll:
en: Anyone who uses this computer (&all users)
ru: Для &всех пользователей данного компьютера
16 changes: 8 additions & 8 deletions packages/electron-builder/templates/nsis/multiUserUi.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ Var RadioButtonLabel1
Abort
${endif}

!insertmacro MUI_HEADER_TEXT "Choose Uninstallation Options" "Which installation should be removed?"
!insertmacro MUI_HEADER_TEXT "$(chooseUninstallationOptions)" "Which installation should be removed?"
!else
!insertmacro MUI_HEADER_TEXT "Choose Installation Options" "Who should this application be installed for?"
!insertmacro MUI_HEADER_TEXT "$(chooseInstallationOptions)" "Who should this application be installed for?"
!endif

!insertmacro MUI_PAGE_FUNCTION_CUSTOM PRE
Expand All @@ -88,12 +88,12 @@ Var RadioButtonLabel1

!ifndef BUILD_UNINSTALLER
${NSD_CreateLabel} 0u 0u 300u 20u "Please select whether you wish to make this software available to all users or just yourself"
StrCpy $8 "Anyone who uses this computer (&all users)"
StrCpy $9 "Only for &me"
StrCpy $8 "$(forAll)"
StrCpy $9 "$(onlyForMe)"
!else
${NSD_CreateLabel} 0u 0u 300u 20u "This software is installed both per-machine (all users) and per-user. $\r$\nWhich installation you wish to remove?"
StrCpy $8 "Anyone who uses this computer (&all users)"
StrCpy $9 "Only for &me"
StrCpy $8 "$(forAll)"
StrCpy $9 "$(onlyForMe)"
!endif
Pop $MultiUser.InstallModePage.Text

Expand Down Expand Up @@ -198,7 +198,7 @@ Var RadioButtonLabel1
StrCpy $7 "There is a per-user installation. ($perUserInstallationFolder)$\r$\nWill uninstall."
!endif
${else}
StrCpy $7 "Fresh install for current user only."
StrCpy $7 "$(freshInstallForCurrent)"
${endif}
SendMessage $0 ${BCM_SETSHIELD} 0 0 ; hide SHIELD
${else} ; all users
Expand All @@ -209,7 +209,7 @@ Var RadioButtonLabel1
StrCpy $7 "There is a per-machine installation. ($perMachineInstallationFolder)$\r$\nWill uninstall."
!endif
${else}
StrCpy $7 "Fresh install for all users"
StrCpy $7 "$(freshInstallForAll)"
${endif}
${ifNot} ${UAC_IsAdmin}
StrCpy $7 "$7 (will prompt for admin credentials)"
Expand Down
4 changes: 2 additions & 2 deletions test/out/linux/__snapshots__/debTest.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Array [
exports[`arm deb 3`] = `
Object {
"Architecture": "armv7l",
"Depends": "gconf2, gconf-service, libnotify4, libappindicator1, libxtst6, libnss3",
"Depends": "gconf2, gconf-service, libnotify4, libappindicator1, libxtst6, libnss3, libxss1",
"Description": "
Test Application (test quite “ #378)",
"Homepage": "http://foo.example.com",
Expand Down Expand Up @@ -264,7 +264,7 @@ Array [
exports[`deb 3`] = `
Object {
"Architecture": "amd64",
"Depends": "gconf2, gconf-service, libnotify4, libappindicator1, libxtst6, libnss3",
"Depends": "gconf2, gconf-service, libnotify4, libappindicator1, libxtst6, libnss3, libxss1",
"Description": "
Test Application (test quite “ #378)",
"Homepage": "http://foo.example.com",
Expand Down
3 changes: 2 additions & 1 deletion test/src/helpers/packTester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,12 @@ function parseDebControl(info: string): any {
async function checkMacResult(packager: Packager, packagerOptions: PackagerOptions, checkOptions: AssertPackOptions, packedAppDir: string) {
const appInfo = packager.appInfo
const info = parsePlist(await readFile(path.join(packedAppDir, "Contents", "Info.plist"), "utf8"))

expect(info).toMatchObject({
CFBundleDisplayName: appInfo.productName,
CFBundleIdentifier: "org.electron-builder.testApp",
LSApplicationCategoryType: "your.app.category.type",
CFBundleVersion: `${appInfo.version}.${(process.env.TRAVIS_BUILD_NUMBER || process.env.CIRCLE_BUILD_NUM)}`
CFBundleVersion: info.CFBundleVersion === "50" ? "50" : `${appInfo.version}.${(process.env.TRAVIS_BUILD_NUMBER || process.env.CIRCLE_BUILD_NUM)}`
})

// checked manually, remove to avoid mismatch on CI server (where TRAVIS_BUILD_NUMBER is defined and different on each test run)
Expand Down

0 comments on commit fa50854

Please sign in to comment.