Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions nuxt/runtime/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineNuxtPlugin } from '#app';
import { isRef } from 'vue';
import { FormsPlugin, registerRules } from '@overgaming/valiform';
// @ts-ignore virtual module resolved by Nuxt at build time
import { pluginOptions, valiformConfig } from '#build/valiform/options.mjs';
Expand All @@ -16,9 +17,9 @@ export default defineNuxtPlugin({

if (syncI18n) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const i18nLocale = (nuxtApp as any).$i18n?.locale;
if (i18nLocale) {
opts.locale = i18nLocale;
const i18n = (nuxtApp as any).$i18n;
if (i18n && i18n.locale) {
opts.locale = isRef(i18n.locale) ? i18n.locale : i18n.locale.value || i18n.locale;
}
}

Expand Down