@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "private": false,
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "name": "@bettertogether/community-engine-vue",
5
5
  "description": "The Better Together Community Engine is a universal community platform",
6
6
  "author": "Better Together Community Co-op",
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
- existing.global.mergeLocaleMessage(locale, msgs)
93
+ composer.mergeLocaleMessage(locale, msgs)
92
94
  }
93
95
  if (options.locale) {
94
- existing.global.locale.value = options.locale
96
+ composer.locale.value = options.locale
95
97
  }
96
98
  } else {
97
99
  const i18n = createCevI18n(options.messages ?? {}, options.locale ?? 'en')