Skip to content

feat(nuxt): add syncI18n option to sync locale with @nuxtjs/i18n - #13

Merged
javipuche merged 1 commit into
mainfrom
feat/sync-i18n
Mar 10, 2026
Merged

javipuche merged 1 commit into
mainfrom
feat/sync-i18n

Conversation

@javipuche

Copy link
Copy Markdown
Member

Summary

  • Adds syncI18n?: boolean option to the Nuxt module
  • When true, the runtime plugin passes nuxtApp.$i18n.locale (a Ref<string>) to FormsPlugin, so changing the i18n language automatically updates validation messages language
  • Falls back to the static locale option if $i18n is not available

Usage

```ts
// nuxt.config.ts
valiform: {
syncI18n: true,
config: './valiform.config'
}
```

Test plan

  • Typecheck passes
  • Changing i18n locale updates valiform validation messages language

🤖 Generated with Claude Code

When syncI18n: true, the runtime plugin passes nuxtApp.$i18n.locale
(a Ref<string>) to FormsPlugin so validation messages language
follows the active i18n locale automatically.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@javipuche
javipuche merged commit 0ed3e4b into main Mar 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant