From 36a68ec01b25fdec964cb39e235c5a07643e80d4 Mon Sep 17 00:00:00 2001 From: Vishwas Shashidhar Date: Fri, 12 Jul 2019 16:34:20 +0530 Subject: [PATCH] fix: ELECTRON-1379: fix localisation for "Version" string (#726) * ELECTRON-1379: fix localisation for "Version" string * ELECTRON-1379: update jest snapshot --- spec/__snapshots__/aboutApp.spec.ts.snap | 1 + src/app/window-handler.ts | 4 +++- src/renderer/components/about-app.tsx | 8 +++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/spec/__snapshots__/aboutApp.spec.ts.snap b/spec/__snapshots__/aboutApp.spec.ts.snap index 2978c883..c0530d08 100644 --- a/spec/__snapshots__/aboutApp.spec.ts.snap +++ b/spec/__snapshots__/aboutApp.spec.ts.snap @@ -5,6 +5,7 @@ exports[`about app should render correctly 1`] = ` className="AboutApp" > Symphony diff --git a/src/app/window-handler.ts b/src/app/window-handler.ts index dce1ec5d..0b257920 100644 --- a/src/app/window-handler.ts +++ b/src/app/window-handler.ts @@ -406,8 +406,10 @@ export class WindowHandler { if (!this.aboutAppWindow || !windowExists(this.aboutAppWindow)) { return; } + const ABOUT_SYMPHONY_NAMESPACE = 'AboutSymphony'; + const versionLocalised = i18n.t('Version', ABOUT_SYMPHONY_NAMESPACE)(); const { clientVersion, buildNumber }: IVersionInfo = await versionHandler.getClientVersion(); - this.aboutAppWindow.webContents.send('about-app-data', { buildNumber, clientVersion }); + this.aboutAppWindow.webContents.send('about-app-data', { buildNumber, clientVersion, versionLocalised }); }); } diff --git a/src/renderer/components/about-app.tsx b/src/renderer/components/about-app.tsx index d19a8d34..e4973a62 100644 --- a/src/renderer/components/about-app.tsx +++ b/src/renderer/components/about-app.tsx @@ -6,6 +6,7 @@ interface IState { copyWrite?: string; clientVersion: string; buildNumber: string; + versionLocalised?: string; } /** @@ -19,6 +20,7 @@ export default class AboutApp extends React.Component<{}, IState> { appName: 'Symphony', buildNumber: '', clientVersion: '0', + versionLocalised: 'Version', }; this.updateState = this.updateState.bind(this); } @@ -27,13 +29,13 @@ export default class AboutApp extends React.Component<{}, IState> { * main render function */ public render(): JSX.Element { - const { clientVersion, buildNumber } = this.state; + const { clientVersion, buildNumber, versionLocalised } = this.state; const appName = remote.app.getName() || 'Symphony'; - const versionString = `Version ${clientVersion} (${buildNumber})`; + const versionString = `${versionLocalised} ${clientVersion} (${buildNumber})`; const copyright = `Copyright \xA9 ${new Date().getFullYear()} ${appName}`; return (
- + Symphony {appName} {versionString} {copyright}