diff options
author | 2022-03-30 21:47:45 +0200 | |
---|---|---|
committer | 2022-05-16 00:54:57 +0200 | |
commit | 85d91c64b5b3ec31df8acecd68a1fa6a68d57ff9 (patch) | |
tree | 277ab45a66a1c74e2d0a885c8a354aea27128d12 /packages/shared/src/contextBridge | |
parent | feat(main): Translation hot reloading during development (diff) | |
download | sophie-85d91c64b5b3ec31df8acecd68a1fa6a68d57ff9.tar.gz sophie-85d91c64b5b3ec31df8acecd68a1fa6a68d57ff9.tar.zst sophie-85d91c64b5b3ec31df8acecd68a1fa6a68d57ff9.zip |
feat(renderer): Renderer translations
Add react-i18n to make us able to use i18next translations in the
renderer process just like we do in the main process.
Translations are hot-reloaded automatically.
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'packages/shared/src/contextBridge')
-rw-r--r-- | packages/shared/src/contextBridge/SophieRenderer.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/shared/src/contextBridge/SophieRenderer.ts b/packages/shared/src/contextBridge/SophieRenderer.ts index dc77c97..732f941 100644 --- a/packages/shared/src/contextBridge/SophieRenderer.ts +++ b/packages/shared/src/contextBridge/SophieRenderer.ts | |||
@@ -18,11 +18,18 @@ | |||
18 | * SPDX-License-Identifier: AGPL-3.0-only | 18 | * SPDX-License-Identifier: AGPL-3.0-only |
19 | */ | 19 | */ |
20 | 20 | ||
21 | import type { ResourceKey } from 'i18next'; | ||
22 | |||
21 | import { Action } from '../schemas/Action'; | 23 | import { Action } from '../schemas/Action'; |
24 | import { Translation } from '../schemas/Translation'; | ||
22 | import { SharedStoreListener } from '../stores/SharedStoreBase'; | 25 | import { SharedStoreListener } from '../stores/SharedStoreBase'; |
23 | 26 | ||
24 | export default interface SophieRenderer { | 27 | export default interface SophieRenderer { |
25 | onSharedStoreChange(this: void, listener: SharedStoreListener): Promise<void>; | 28 | onSharedStoreChange(this: void, listener: SharedStoreListener): Promise<void>; |
26 | 29 | ||
27 | dispatchAction(this: void, action: Action): void; | 30 | dispatchAction(this: void, action: Action): void; |
31 | |||
32 | getTranslation(this: void, translation: Translation): Promise<ResourceKey>; | ||
33 | |||
34 | onReloadTranslations(this: void, listener: () => void): void; | ||
28 | } | 35 | } |