@@ -7,9 +7,9 @@ import { extendI18n } from '../routing/i18n'
77import { getI18nTarget } from '../compatibility'
88import { localeHead , _useLocaleHead } from '../routing/head'
99import { useLocalePath , useLocaleRoute , useRouteBaseName , useSwitchLocalePath } from '../composables'
10- import { getDefaultLocaleForDomain } from '../shared/locales'
10+ import { createLocaleConfigs , getDefaultLocaleForDomain } from '../shared/locales'
1111import { setupVueI18nOptions } from '../shared/vue-i18n'
12- import { createNuxtI18nContext , useNuxtI18nContext , type NuxtI18nContext } from '../context'
12+ import { createNuxtI18nContext , useLocaleConfigs , useNuxtI18nContext , type NuxtI18nContext } from '../context'
1313import { useI18nDetection , useRuntimeI18n } from '../shared/utils'
1414import { useDetectors } from '../shared/detection'
1515import { resolveSupportedLocale } from '../shared/locales'
@@ -31,6 +31,14 @@ export default defineNuxtPlugin({
3131 getDefaultLocaleForDomain ( useRequestURL ( { xForwardedHost : true } ) . host ) || runtimeI18n . defaultLocale || ''
3232 const optionsI18n = preloadedOptions || ( await setupVueI18nOptions ( _defaultLocale ) )
3333
34+ const localeConfigs = useLocaleConfigs ( )
35+ if ( import . meta. server ) {
36+ localeConfigs . value = useRequestEvent ( ) ! . context . nuxtI18n ?. localeConfigs || { }
37+ } else {
38+ // fallback when server is disabled
39+ localeConfigs . value ??= createLocaleConfigs ( optionsI18n . fallbackLocale )
40+ }
41+
3442 if ( __MULTI_DOMAIN_LOCALES__ ) {
3543 setupMultiDomainLocales ( optionsI18n . defaultLocale )
3644 }
0 commit comments