mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
Typescript - Fix i18n locale setting issue
This commit is contained in:
parent
c58678eeb2
commit
eeb1ff295e
@ -199,7 +199,7 @@ export class WindowHandler {
|
|||||||
this.mainWindow.webContents.insertCSS(
|
this.mainWindow.webContents.insertCSS(
|
||||||
fs.readFileSync(path.join(__dirname, '..', '/renderer/styles/snack-bar.css'), 'utf8').toString(),
|
fs.readFileSync(path.join(__dirname, '..', '/renderer/styles/snack-bar.css'), 'utf8').toString(),
|
||||||
);
|
);
|
||||||
this.mainWindow.webContents.send('page-load', { isWindowsOS, resources: i18n.loadedResources });
|
this.mainWindow.webContents.send('page-load', { isWindowsOS, locale: i18n.getLocale(), resources: i18n.loadedResources });
|
||||||
this.appMenu = new AppMenu();
|
this.appMenu = new AppMenu();
|
||||||
this.monitorWindowActions();
|
this.monitorWindowActions();
|
||||||
// Ready to show the window
|
// Ready to show the window
|
||||||
|
@ -64,9 +64,11 @@ class Translation {
|
|||||||
/**
|
/**
|
||||||
* Keeps ref of loaded resources from the main process
|
* Keeps ref of loaded resources from the main process
|
||||||
*
|
*
|
||||||
* @param resource
|
* @param locale {LocaleType}
|
||||||
|
* @param resource {JSON}
|
||||||
*/
|
*/
|
||||||
public setResource(resource: JSON): void {
|
public setResource(locale: LocaleType, resource: JSON): void {
|
||||||
|
this.locale = locale;
|
||||||
this.loadedResources = resource;
|
this.loadedResources = resource;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,9 +38,9 @@ const createAPI = () => {
|
|||||||
createAPI();
|
createAPI();
|
||||||
|
|
||||||
// When the window is completely loaded
|
// When the window is completely loaded
|
||||||
ipcRenderer.on('page-load', (_event, { isWindowsOS, resources }) => {
|
ipcRenderer.on('page-load', (_event, { isWindowsOS, locale, resources }) => {
|
||||||
|
|
||||||
i18n.setResource(resources);
|
i18n.setResource(locale, resources);
|
||||||
|
|
||||||
if (isWindowsOS) {
|
if (isWindowsOS) {
|
||||||
// injects custom window title bar
|
// injects custom window title bar
|
||||||
|
Loading…
Reference in New Issue
Block a user