diff options
author | Kristóf Marussy <kristof@marussy.com> | 2022-03-30 13:34:40 +0200 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2022-05-16 00:54:57 +0200 |
commit | 0f8c96d26a74865a35440338739de037bf984315 (patch) | |
tree | 77767c4107b72ee763115ddb4ecad64d898bdafd /packages/main/src/stores/MainStore.ts | |
parent | feat(main): Add localization support (diff) | |
download | sophie-0f8c96d26a74865a35440338739de037bf984315.tar.gz sophie-0f8c96d26a74865a35440338739de037bf984315.tar.zst sophie-0f8c96d26a74865a35440338739de037bf984315.zip |
feat(main): Translation hot reloading during development
Signed-off-by: Kristóf Marussy <kristof@marussy.com>
Diffstat (limited to 'packages/main/src/stores/MainStore.ts')
-rw-r--r-- | packages/main/src/stores/MainStore.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/main/src/stores/MainStore.ts b/packages/main/src/stores/MainStore.ts index 873f998..93cabb9 100644 --- a/packages/main/src/stores/MainStore.ts +++ b/packages/main/src/stores/MainStore.ts | |||
@@ -96,6 +96,13 @@ const MainStore = types | |||
96 | case 'reload-all-services': | 96 | case 'reload-all-services': |
97 | self.services.forEach((service) => service.reload()); | 97 | self.services.forEach((service) => service.reload()); |
98 | break; | 98 | break; |
99 | case 'reload-all-translations': | ||
100 | if (self.i18n !== undefined) { | ||
101 | self.i18n.reloadTranslations().catch((error) => { | ||
102 | log.error('Failed to reload translations', error); | ||
103 | }); | ||
104 | } | ||
105 | break; | ||
99 | case 'dispatch-service-action': { | 106 | case 'dispatch-service-action': { |
100 | const { serviceId, serviceAction } = action; | 107 | const { serviceId, serviceAction } = action; |
101 | const service = self.shared.servicesById.get(serviceId); | 108 | const service = self.shared.servicesById.get(serviceId); |