From 335f89fa2667db128864025a9aec6e7e107cd871 Mon Sep 17 00:00:00 2001 From: Vishwas Shashidhar Date: Fri, 25 Jan 2019 12:26:38 +0530 Subject: [PATCH] ELECTRON-1030: add localisation for about symphony window on Windows (#558) * ELECTRON-1030: add localisation for about symphony window on Windows * ELECTRON-1030: add default values for the about app strings --- js/aboutApp/index.js | 7 ++++++- js/aboutApp/renderer.js | 6 ++++-- locale/en-US.json | 4 ++++ locale/en.json | 4 ++++ locale/fr-FR.json | 4 ++++ locale/fr.json | 4 ++++ locale/ja-JP.json | 4 ++++ locale/ja.json | 4 ++++ 8 files changed, 34 insertions(+), 3 deletions(-) diff --git a/js/aboutApp/index.js b/js/aboutApp/index.js index e472bb20..ef4c0023 100644 --- a/js/aboutApp/index.js +++ b/js/aboutApp/index.js @@ -88,7 +88,12 @@ function openAboutWindow(windowName) { // initialize crash reporter initCrashReporterMain({ process: 'about app window' }); initCrashReporterRenderer(aboutWindow, { process: 'render | about app window' }); - aboutWindow.webContents.send('versionInfo', { version, clientVersion, buildNumber }); + aboutWindow.webContents.send('versionInfo', { + version, + clientVersion, + buildNumber, + i18n: i18n.getMessageFor('AboutSymphony') + }); if (!isMac) { // prevents from displaying menu items when "alt" key is pressed aboutWindow.setMenu(null); diff --git a/js/aboutApp/renderer.js b/js/aboutApp/renderer.js index edca9141..b7304c17 100644 --- a/js/aboutApp/renderer.js +++ b/js/aboutApp/renderer.js @@ -19,10 +19,12 @@ function renderDom() { ipcRenderer.on('versionInfo', (event, versionInfo) => { const versionText = document.getElementById('version'); - const { version, clientVersion, buildNumber } = versionInfo; + const { version, clientVersion, buildNumber, i18n } = versionInfo; + + document.title = i18n['About Symphony'] || 'About Symphony'; if (versionText) { - versionText.innerHTML = version ? `Version ${clientVersion}-${version} (${buildNumber})` : 'N/A'; + versionText.innerHTML = version ? `${i18n.Version || 'Version'} ${clientVersion}-${version} (${buildNumber})` : 'N/A'; } }); diff --git a/locale/en-US.json b/locale/en-US.json index d34e21eb..dd4c6403 100644 --- a/locale/en-US.json +++ b/locale/en-US.json @@ -124,6 +124,10 @@ "Pen": "Pen", "Snipping Tool": "Snipping Tool" }, + "AboutSymphony": { + "About Symphony": "About Symphony", + "Version": "Version" + }, "Select All": "Select All", "Services": "Services", "Show All": "Show All", diff --git a/locale/en.json b/locale/en.json index d34e21eb..dd4c6403 100644 --- a/locale/en.json +++ b/locale/en.json @@ -124,6 +124,10 @@ "Pen": "Pen", "Snipping Tool": "Snipping Tool" }, + "AboutSymphony": { + "About Symphony": "About Symphony", + "Version": "Version" + }, "Select All": "Select All", "Services": "Services", "Show All": "Show All", diff --git a/locale/fr-FR.json b/locale/fr-FR.json index fa25992a..40467358 100644 --- a/locale/fr-FR.json +++ b/locale/fr-FR.json @@ -124,6 +124,10 @@ "Pen": "Stylo", "Snipping Tool": "Outil Capture" }, + "AboutSymphony": { + "About Symphony": "À propos de Symphony", + "Version": "Version" + }, "Select All": "Tout sélectionner", "Services": "Services", "Show All": "Tout afficher", diff --git a/locale/fr.json b/locale/fr.json index fa25992a..40467358 100644 --- a/locale/fr.json +++ b/locale/fr.json @@ -124,6 +124,10 @@ "Pen": "Stylo", "Snipping Tool": "Outil Capture" }, + "AboutSymphony": { + "About Symphony": "À propos de Symphony", + "Version": "Version" + }, "Select All": "Tout sélectionner", "Services": "Services", "Show All": "Tout afficher", diff --git a/locale/ja-JP.json b/locale/ja-JP.json index 74d13114..92752acc 100644 --- a/locale/ja-JP.json +++ b/locale/ja-JP.json @@ -124,6 +124,10 @@ "Pen": "ペン", "Snipping Tool": "切り取りツール" }, + "AboutSymphony": { + "About Symphony": "Symphonyについて", + "Version": "バージョン" + }, "Select All": "すべてを選択", "Services": "サービス", "Show All": "すべてを表示", diff --git a/locale/ja.json b/locale/ja.json index d64c9616..3595fa02 100644 --- a/locale/ja.json +++ b/locale/ja.json @@ -124,6 +124,10 @@ "Pen": "ペン", "Snipping Tool": "切り取りツール" }, + "AboutSymphony": { + "About Symphony": "Symphonyについて", + "Version": "バージョン" + }, "Select All": "すべてを選択", "Services": "サービス", "Show All": "すべてを表示",