Skip to content

Commit

Permalink
refactor: remove dependency to deprected remote module (#593)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
csett86 committed Jun 27, 2021
1 parent 055d0b1 commit 2baa4b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/i18n/index.js
Expand Up @@ -16,7 +16,7 @@ const languages = {
sq: { translation: require('./lang/sq.json') }
};

const detectedLocale = window.jitsiNodeAPI.getLocale();
const detectedLocale = navigator.language;

i18n
.use(initReactI18next)
Expand Down
3 changes: 1 addition & 2 deletions 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');
Expand All @@ -15,7 +15,6 @@ window.jitsiNodeAPI = {
openExternalLink,
platform: process.platform,
jitsiMeetElectronUtils,
getLocale: remote.app.getLocale,
ipc: {
on: (channel, listener) => {
if (!whitelistedIpcChannels.includes(channel)) {
Expand Down

0 comments on commit 2baa4b5

Please sign in to comment.