summaryrefslogtreecommitdiffhomepage
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/src/renderer/app.tsx4
-rw-r--r--gui/src/renderer/preload.ts3
-rw-r--r--gui/types/global/index.d.ts7
3 files changed, 12 insertions, 2 deletions
diff --git a/gui/src/renderer/app.tsx b/gui/src/renderer/app.tsx
index f63e03633a..716e5c88e3 100644
--- a/gui/src/renderer/app.tsx
+++ b/gui/src/renderer/app.tsx
@@ -16,7 +16,7 @@ import userInterfaceActions from './redux/userinterface/actions';
import versionActions from './redux/version/actions';
import { ICurrentAppVersionInfo } from '../main';
-import { loadTranslations, messages, relayLocations } from '../shared/gettext';
+import { messages, relayLocations } from '../shared/gettext';
import { IGuiSettingsState, SYSTEM_PREFERRED_LOCALE_KEY } from '../shared/gui-settings-state';
import { IpcRendererEventChannel, IRelayListPair } from '../shared/ipc-event-channel';
import { ILinuxSplitTunnelingApplication } from '../shared/application-types';
@@ -481,7 +481,7 @@ export default class AppRenderer {
private loadTranslations(locale: string) {
for (const catalogue of [messages, relayLocations]) {
- loadTranslations(locale, catalogue);
+ window.loadTranslations(locale, catalogue);
}
}
diff --git a/gui/src/renderer/preload.ts b/gui/src/renderer/preload.ts
new file mode 100644
index 0000000000..4732b792a6
--- /dev/null
+++ b/gui/src/renderer/preload.ts
@@ -0,0 +1,3 @@
+import { loadTranslations } from '../shared/gettext';
+
+window.loadTranslations = (locale, catalogue) => loadTranslations(locale, catalogue);
diff --git a/gui/types/global/index.d.ts b/gui/types/global/index.d.ts
new file mode 100644
index 0000000000..870d164379
--- /dev/null
+++ b/gui/types/global/index.d.ts
@@ -0,0 +1,7 @@
+import Gettext from 'node-gettext';
+
+declare global {
+ interface Window {
+ loadTranslations(locale: string, catalogue: Gettext): void;
+ }
+}