i18n runtime config options.
Some options can be set via the runtimeConfig
, setting options this way makes it possible to override these after building using environment variables.
If you want to use environment variables to change supported options, you will have to set these in runtimeConfig.public.i18n
.
export default defineNuxtConfig({
modules: ['@nuxtjs/i18n'],
i18n: {
// Leave options unset that you want to set using `runtimeConfig`
// baseUrl: 'https://example.com',
},
runtimeConfig: {
public: {
i18n: {
baseUrl: 'https://example.com',
locales: {}
// other options ...
}
}
}
})
You can read more about how this works in the Nuxt documentation.
runtimeConfig
, options set this way may not support all available types (such as functions) as would normally be possible using the default configuration.The module configuration takes precedence, options set through runtimeConfig
will only be used if they are unset.
These options can be set using runtimeConfig
:
baseUrl
NUXT_PUBLIC_I18N_BASE_URL
This runtime config option is the same as the baseUrl
module option.
baseUrl
module option allows you to set the function, but the runtime config does not due to limitations.locales
locales[code].domain
NUXT_PUBLIC_I18N_LOCALES_{code}_DOMAIN
This runtime config option allows overriding the domain set in the locales
module option.