Skip to content

Commit

Permalink
Merge pull request #457 from ZIMkaRU/feature/add-translation-support-…
Browse files Browse the repository at this point in the history
…to-show-about-modal-dialog

Add translation support to show-about-modal-dialog module
  • Loading branch information
ezewer authored Nov 25, 2024
2 parents c6d30cc + 9af72fb commit 8d15e0b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions build/locales/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@
"confirmButtonText": "OK"
}
},
"showAboutModalDialog": {
"confirmButtonText": "OK",
"copyButtonText": "Copy",
"gitHubButtonText": "Open GitHub"
},
"showMessageModalDialog": {
"confirmButtonText": "OK",
"cancelButtonText": "Cancel"
Expand Down
5 changes: 5 additions & 0 deletions build/locales/ru/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@
"confirmButtonText": "OK"
}
},
"showAboutModalDialog": {
"confirmButtonText": "OK",
"copyButtonText": "Копировать",
"gitHubButtonText": "Открыть GitHub"
},
"showMessageModalDialog": {
"confirmButtonText": "OK",
"cancelButtonText": "Отмена"
Expand Down
7 changes: 6 additions & 1 deletion src/show-about-modal-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const {
BrowserWindow
} = require('electron')
const path = require('path')
const i18next = require('i18next')

const getDebugInfo = require('./helpers/get-debug-info')

Expand All @@ -32,7 +33,11 @@ module.exports = () => {
title: productName,
message: productName,
detail,
buttons: ['Copy', 'GitHub', 'OK'],
buttons: [
i18next.t('common.showAboutModalDialog.copyButtonText'),
i18next.t('common.showAboutModalDialog.gitHubButtonText'),
i18next.t('common.showAboutModalDialog.confirmButtonText')
],
defaultId: 2,
cancelId: 2,
icon: path.join(__dirname, '../build/icons/64x64.png')
Expand Down

0 comments on commit 8d15e0b

Please sign in to comment.