mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-27 17:31:36 -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"
|
||||
>
|
||||
<img
|
||||
alt="Symphony"
|
||||
className="AboutApp-logo"
|
||||
src="../renderer/assets/symphony-logo.png"
|
||||
/>
|
||||
|
@ -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 });
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -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 (
|
||||
<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-versionText'>{versionString}</span>
|
||||
<span className='AboutApp-copyrightText'>{copyright}</span>
|
||||
|
Loading…
Reference in New Issue
Block a user