Skip to content

Commit 28e60ac

Browse files
authored
fix: handle defaultLocale from inline module options (#3799)
1 parent 51f7967 commit 28e60ac

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/prepare/options.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ export function prepareOptions({ options }: I18nNuxtContext, nuxt: Nuxt) {
2323
}
2424

2525
const strategy = nuxt.options.i18n?.strategy || options.strategy
26-
if (strategy.endsWith('_default') && !nuxt.options.i18n?.defaultLocale) {
26+
const defaultLocale = nuxt.options.i18n?.defaultLocale || options.defaultLocale
27+
if (strategy.endsWith('_default') && !defaultLocale) {
2728
logger.warn(
2829
`The \`${strategy}\` i18n strategy${nuxt.options.i18n?.strategy == null ? ' (used by default)' : ''} needs \`defaultLocale\` to be set.`
2930
)

0 commit comments

Comments
 (0)