xibman / nuxt-zod-i18n

Easily Translate Zod's error messages on nuxt
http://xibman-nuxt-zod-i18n.nuxt.space/
35 stars 7 forks source link

Unable to load `i18n.config.ts` config file #18

Closed XavierChevalier closed 7 months ago

XavierChevalier commented 10 months ago

Environment

Version

v1.4.0

Reproduction

-

Description

Actually, is not possible to use nuxt-zod-i18n with external @nuxtjs/i18n configuration file like i18n.config.ts.

nuxt-zod-i18n only load i18n configuration from the nuxt.config.ts file. See this line: https://github.com/xibman/nuxt-zod-i18n/blob/0f85d9ac5193b40533ad5d96fcc9e4df783c2a38/src/module.ts#L42

We need to be able to load the configuration of this external file, based on the path defined in the Nuxt configuration or './i18n.config.ts' by default.

export default defineNuxtConfig({
  // ...
  i18n: {
    vueI18n: './my-i18n.config.ts' // optional, './i18n.config.ts' by default 
  }
})

Additional context

No response

Logs

No response

xibman commented 10 months ago

@XavierChevalier Can you explain more why you need this.

Because the configuration contain by vueI18n: './my-i18n.config.ts' is for vue-i18n at runtime.

I'm not really sure this is required

xibman commented 7 months ago

@XavierChevalier any news ?