@sit-onyx/nuxt 1.0.0-beta.284 → 1.0.0-beta.286

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sit-onyx/nuxt",
3
3
  "configKey": "onyx",
4
- "version": "1.0.0-beta.283",
4
+ "version": "1.0.0-beta.285",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.1",
7
7
  "unbuild": "unknown"
package/dist/module.mjs CHANGED
@@ -45,8 +45,8 @@ const module = defineNuxtModule({
45
45
  });
46
46
  };
47
47
  nuxt.hook("i18n:registerModule", registerOnyxLocales);
48
- addPlugin({ src: resolve("./runtime/plugins/onyx") });
49
48
  }
49
+ addPlugin({ src: resolve("./runtime/plugins/onyx") });
50
50
  }
51
51
  });
52
52
  function getModuleIndex(modules, ...moduleNames) {
@@ -3,23 +3,27 @@ import { defineNuxtPlugin, useNuxtApp, useRouter } from "nuxt/app";
3
3
  import { createOnyx } from "sit-onyx";
4
4
  export default defineNuxtPlugin({
5
5
  name: "onyx:plugin",
6
- // @ts-ignore: dependency comes from @nuxtjs/i18n
7
- dependsOn: ["i18n:plugin"],
6
+ dependsOn: [],
7
+ // "parallel: false" is the current default but to be resistant for future changes, we explicitly set it to false here
8
+ // see: https://github.com/SchwarzIT/onyx/pull/3832#discussion_r2244487744
9
+ parallel: false,
8
10
  setup: (app) => {
9
- const { t: translate, localeProperties } = useNuxtApp().$i18n;
11
+ const i18n = useNuxtApp().$i18n;
10
12
  const router = useRouter();
11
- const t = computed(() => {
12
- return (key, placeholders) => {
13
- return translate(`onyx.${key}`, placeholders?.n ?? 1, { named: placeholders });
14
- };
15
- });
13
+ const getI18nOptions = () => {
14
+ if (!i18n) return;
15
+ const t = computed(() => {
16
+ return (key, placeholders) => {
17
+ return i18n.t(`onyx.${key}`, placeholders?.n ?? 1, { named: placeholders });
18
+ };
19
+ });
20
+ const locale = computed(() => i18n.localeProperties.value.language ?? "en-US");
21
+ return { t, locale };
22
+ };
16
23
  app.vueApp.use(
17
24
  createOnyx({
18
- i18n: {
19
- locale: computed(() => localeProperties.value.language ?? "en-US"),
20
- t
21
- },
22
- router
25
+ router,
26
+ i18n: getI18nOptions()
23
27
  })
24
28
  );
25
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sit-onyx/nuxt",
3
- "version": "1.0.0-beta.284",
3
+ "version": "1.0.0-beta.286",
4
4
  "description": "A Nuxt module to easily integrate onyx into Nuxt projects",
5
5
  "type": "module",
6
6
  "author": "Schwarz IT KG",
@@ -37,10 +37,10 @@
37
37
  "nuxt": "^4.0.1",
38
38
  "typescript": "5.8.3",
39
39
  "vue-i18n": "^11.1.11",
40
- "sit-onyx": "^1.0.0-beta.284"
40
+ "sit-onyx": "^1.0.0-beta.285"
41
41
  },
42
42
  "peerDependencies": {
43
- "sit-onyx": "^1.0.0-beta.284"
43
+ "sit-onyx": "^1.0.0-beta.285"
44
44
  },
45
45
  "scripts": {
46
46
  "dev": "nuxi dev playground",