@bettertogether/community-engine-vue 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/i18n/index.js +5 -3
package/package.json
CHANGED
package/src/i18n/index.js
CHANGED
|
@@ -85,13 +85,15 @@ export function installI18n(app, options = {}) {
|
|
|
85
85
|
const existing = app.config.globalProperties.$i18n
|
|
86
86
|
|
|
87
87
|
if (existing) {
|
|
88
|
-
// Merge CEV bt.* into the host app's existing i18n instance
|
|
88
|
+
// Merge CEV bt.* into the host app's existing i18n instance.
|
|
89
|
+
// $i18n is already the global composer (i18n.global), not the i18n instance itself.
|
|
90
|
+
const composer = existing.global ?? existing
|
|
89
91
|
const merged = buildMessages(options.messages ?? {})
|
|
90
92
|
for (const [locale, msgs] of Object.entries(merged)) {
|
|
91
|
-
|
|
93
|
+
composer.mergeLocaleMessage(locale, msgs)
|
|
92
94
|
}
|
|
93
95
|
if (options.locale) {
|
|
94
|
-
|
|
96
|
+
composer.locale.value = options.locale
|
|
95
97
|
}
|
|
96
98
|
} else {
|
|
97
99
|
const i18n = createCevI18n(options.messages ?? {}, options.locale ?? 'en')
|