diff options
author | csett86 <csett86@web.de> | 2021-06-27 20:57:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-27 20:57:25 +0200 |
commit | 2baa4b528202e09552469dbb4c90bbb783a43e59 (patch) | |
tree | 328243ffa590cd6841e471f02cda9678c74018f5 /app | |
parent | 055d0b1f95954c32e85bd4f97a7670f5162a54f5 (diff) |
refactor: remove dependency to deprected remote module (#593)
the remote module will be removed from electron 14 onwards,
so replace the locale detection with native browser api that
is available in the renderer.
Signed-off-by: Christoph Settgast <csett86@web.de>
Diffstat (limited to 'app')
-rw-r--r-- | app/i18n/index.js | 2 | ||||
-rw-r--r-- | app/preload/preload.js | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/app/i18n/index.js b/app/i18n/index.js index 43ae7ed..50405b6 100644 --- a/app/i18n/index.js +++ b/app/i18n/index.js @@ -16,7 +16,7 @@ const languages = { sq: { translation: require('./lang/sq.json') } }; -const detectedLocale = window.jitsiNodeAPI.getLocale(); +const detectedLocale = navigator.language; i18n .use(initReactI18next) diff --git a/app/preload/preload.js b/app/preload/preload.js index e8d8020..54bf79b 100644 --- a/app/preload/preload.js +++ b/app/preload/preload.js @@ -1,7 +1,7 @@ /* global process */ const createElectronStorage = require('redux-persist-electron-storage'); -const { ipcRenderer, remote } = require('electron'); +const { ipcRenderer } = require('electron'); const os = require('os'); const jitsiMeetElectronUtils = require('jitsi-meet-electron-utils'); const { openExternalLink } = require('../features/utils/openExternalLink'); @@ -15,7 +15,6 @@ window.jitsiNodeAPI = { openExternalLink, platform: process.platform, jitsiMeetElectronUtils, - getLocale: remote.app.getLocale, ipc: { on: (channel, listener) => { if (!whitelistedIpcChannels.includes(channel)) { |