Skip to content

Commit e2a7df9

Browse files
committed
i18next library has like variable - let's use that instead
1 parent 85c541a commit e2a7df9

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

app/electron/main.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ const selfHost = `http://localhost:${port}`;
2929
// be closed automatically when the JavaScript object is garbage collected.
3030
let win;
3131
let menuBuilder;
32-
let i18nInitialized = false;
3332

3433
async function createWindow() {
3534

@@ -171,9 +170,7 @@ async function createWindow() {
171170

172171
// Set up necessary bindings to update the menu items
173172
// based on the current language selected
174-
i18nextMainBackend.on("initialized", (loaded) => {
175-
i18nInitialized = true;
176-
173+
i18nextMainBackend.on("initialized", (loaded) => {
177174
i18nextMainBackend.changeLanguage("en");
178175
i18nextMainBackend.off("initialized"); // Remove listener to this event as it's not needed anymore
179176
});
@@ -185,7 +182,7 @@ async function createWindow() {
185182
// below code until AFTER the i18n framework has finished its
186183
// "initialized" event.
187184
i18nextMainBackend.on("languageChanged", (lng) => {
188-
if (i18nInitialized){
185+
if (i18nextMainBackend.isInitialized){
189186
menuBuilder.buildMenu(i18nextMainBackend);
190187
}
191188
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "secure-electron-template",
3-
"version": "16.0.1",
3+
"version": "16.0.2",
44
"description": "The best way to build Electron apps with security in mind.",
55
"private": true,
66
"main": "app/electron/main.js",

0 commit comments

Comments
 (0)