@antelopejs/dms-frontend 0.3.3 → 0.3.4

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
  "name": "@antelopejs/dms-frontend",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Frontend-agnostic loader for AntelopeJS DMS, shipping the Vue 3 renderer (Vite, Inertia, SSR)",
5
5
  "keywords": [
6
6
  "antelope",
@@ -59,7 +59,7 @@
59
59
  "test": "node --import tsx --test tests/*.test.ts tests/*.test.mts",
60
60
  "test:real-source": "pnpm run build && node dist/verify-source-runner.js",
61
61
  "format": "oxfmt .",
62
- "lint": "oxlint && oxfmt --check .",
62
+ "lint": "oxlint && oxfmt --check . && antelopejs-check-interface-ranges",
63
63
  "typecheck": "tsc --noEmit",
64
64
  "lint:fix": "oxlint --fix --max-warnings=1000000 && oxfmt .",
65
65
  "knip": "knip --dependencies",
@@ -76,7 +76,7 @@
76
76
  "unzipper": "^0.12.3"
77
77
  },
78
78
  "devDependencies": {
79
- "@antelopejs/tooling-configs": ">=0.0.6 <1.0.0",
79
+ "@antelopejs/tooling-configs": ">=0.0.7 <1.0.0",
80
80
  "@inertiajs/vue3": "^3.7.1",
81
81
  "@types/figlet": "^1.7.0",
82
82
  "@types/node": "^24.8.1",
@@ -2,6 +2,7 @@ import UApp from "@nuxt/ui/components/App.vue";
2
2
  import UIcon from "@nuxt/ui/runtime/vue/components/Icon.vue";
3
3
  import { useToast } from "@nuxt/ui/composables/useToast";
4
4
  import { useAppConfig } from "@nuxt/ui/runtime/vue/composables/useAppConfig";
5
+ import { en as uiEn, fr as uiFr } from "@nuxt/ui/locale";
5
6
  import ui from "@nuxt/ui/vue-plugin";
6
7
  import { useHead } from "@unhead/vue";
7
8
  import type { VueHeadClient } from "@unhead/vue/types";
@@ -80,6 +81,19 @@ const SSR_ASYNC_DATA_ID = "dms-ssr-async-data";
80
81
  export const SSR_ASYNC_COMPONENTS_ID = "dms-ssr-async-components";
81
82
  const DEFAULT_LOCALE = "en";
82
83
 
84
+ /**
85
+ * Nuxt UI ships its own strings (placeholders, empty states, aria labels).
86
+ * Only the locales the DMS translates are imported: the full catalog would
87
+ * weigh on every bundle. A locale missing here falls back to English.
88
+ */
89
+ const UI_LOCALES = { en: uiEn, fr: uiFr };
90
+
91
+ type UiLocale = (typeof UI_LOCALES)[keyof typeof UI_LOCALES];
92
+
93
+ function uiLocale(locale: string): UiLocale {
94
+ return UI_LOCALES[locale as keyof typeof UI_LOCALES] ?? UI_LOCALES.en;
95
+ }
96
+
83
97
  function pageLocale(props: DmsPageProps): string {
84
98
  const language = props.user?.language;
85
99
  if (typeof language !== "string") return DEFAULT_LOCALE;
@@ -164,6 +178,7 @@ const DmsPersistentLayout = defineComponent({
164
178
  error,
165
179
  content,
166
180
  overlays.value,
181
+ i18n.locale.value,
167
182
  );
168
183
  };
169
184
  },
@@ -198,6 +213,7 @@ function renderDmsPersistentLayout(
198
213
  error: DmsPageProps["error"],
199
214
  children: VNode[] | undefined,
200
215
  overlays: string[],
216
+ locale: string,
201
217
  ) {
202
218
  const layout = error ? undefined : getDmsLayout(props);
203
219
  const content = layout
@@ -205,7 +221,7 @@ function renderDmsPersistentLayout(
205
221
  : children;
206
222
  return h(
207
223
  UApp,
208
- { portal: "#dms-overlays" },
224
+ { portal: "#dms-overlays", locale: uiLocale(locale) },
209
225
  {
210
226
  default: () => [
211
227
  ...overlays.map((name) =>