mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-29 02:11:28 -06:00
fix: ELECTRON-1379: fix localisation for "Version" string (#726)
* ELECTRON-1379: fix localisation for "Version" string * ELECTRON-1379: update jest snapshot
This commit is contained in:
parent
3125e9522c
commit
36a68ec01b
@ -5,6 +5,7 @@ exports[`about app should render correctly 1`] = `
|
|||||||
className="AboutApp"
|
className="AboutApp"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
|
alt="Symphony"
|
||||||
className="AboutApp-logo"
|
className="AboutApp-logo"
|
||||||
src="../renderer/assets/symphony-logo.png"
|
src="../renderer/assets/symphony-logo.png"
|
||||||
/>
|
/>
|
||||||
|
@ -406,8 +406,10 @@ export class WindowHandler {
|
|||||||
if (!this.aboutAppWindow || !windowExists(this.aboutAppWindow)) {
|
if (!this.aboutAppWindow || !windowExists(this.aboutAppWindow)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const ABOUT_SYMPHONY_NAMESPACE = 'AboutSymphony';
|
||||||
|
const versionLocalised = i18n.t('Version', ABOUT_SYMPHONY_NAMESPACE)();
|
||||||
const { clientVersion, buildNumber }: IVersionInfo = await versionHandler.getClientVersion();
|
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 });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ interface IState {
|
|||||||
copyWrite?: string;
|
copyWrite?: string;
|
||||||
clientVersion: string;
|
clientVersion: string;
|
||||||
buildNumber: string;
|
buildNumber: string;
|
||||||
|
versionLocalised?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -19,6 +20,7 @@ export default class AboutApp extends React.Component<{}, IState> {
|
|||||||
appName: 'Symphony',
|
appName: 'Symphony',
|
||||||
buildNumber: '',
|
buildNumber: '',
|
||||||
clientVersion: '0',
|
clientVersion: '0',
|
||||||
|
versionLocalised: 'Version',
|
||||||
};
|
};
|
||||||
this.updateState = this.updateState.bind(this);
|
this.updateState = this.updateState.bind(this);
|
||||||
}
|
}
|
||||||
@ -27,13 +29,13 @@ export default class AboutApp extends React.Component<{}, IState> {
|
|||||||
* main render function
|
* main render function
|
||||||
*/
|
*/
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
const { clientVersion, buildNumber } = this.state;
|
const { clientVersion, buildNumber, versionLocalised } = this.state;
|
||||||
const appName = remote.app.getName() || 'Symphony';
|
const appName = remote.app.getName() || 'Symphony';
|
||||||
const versionString = `Version ${clientVersion} (${buildNumber})`;
|
const versionString = `${versionLocalised} ${clientVersion} (${buildNumber})`;
|
||||||
const copyright = `Copyright \xA9 ${new Date().getFullYear()} ${appName}`;
|
const copyright = `Copyright \xA9 ${new Date().getFullYear()} ${appName}`;
|
||||||
return (
|
return (
|
||||||
<div className='AboutApp'>
|
<div className='AboutApp'>
|
||||||
<img className='AboutApp-logo' src='../renderer/assets/symphony-logo.png'/>
|
<img className='AboutApp-logo' src='../renderer/assets/symphony-logo.png' alt='Symphony'/>
|
||||||
<span className='AboutApp-name'>{appName}</span>
|
<span className='AboutApp-name'>{appName}</span>
|
||||||
<span className='AboutApp-versionText'>{versionString}</span>
|
<span className='AboutApp-versionText'>{versionString}</span>
|
||||||
<span className='AboutApp-copyrightText'>{copyright}</span>
|
<span className='AboutApp-copyrightText'>{copyright}</span>
|
||||||
|
Loading…
Reference in New Issue
Block a user