+ return { library, registerStore }
+ }
+
+ // ###################### Translations ######################
+
+ private async addTranslations (plugin: PluginModel, npmName: string, translationPaths: PackagePluginTranslations) {
+ for (const locale of Object.keys(translationPaths)) {
+ const path = translationPaths[locale]
+ const json = await readJSON(join(this.getPluginPath(plugin.name, plugin.type), path))
+
+ if (!this.translations[locale]) this.translations[locale] = {}
+ this.translations[locale][npmName] = json
+
+ logger.info('Added locale %s of plugin %s.', locale, npmName)
+ }
+ }
+
+ private deleteTranslations (npmName: string) {
+ for (const locale of Object.keys(this.translations)) {
+ delete this.translations[locale][npmName]
+
+ logger.info('Deleted locale %s of plugin %s.', locale, npmName)
+ }