@@ -81,7 +81,7 @@ export function createI18nOptions(
81
81
} else if ( inline ) {
82
82
for ( const locale of inline ) {
83
83
if ( ! i18n . locales [ locale ] && i18n . sourceLocale !== locale ) {
84
- throw new Error ( `Requested inline locale '${ locale } ' is not defined for the project.` ) ;
84
+ throw new Error ( `Requested locale '${ locale } ' is not defined for the project.` ) ;
85
85
}
86
86
87
87
i18n . inlineLocales . add ( locale ) ;
@@ -132,7 +132,7 @@ export async function configureI18nBuild<T extends BrowserBuilderSchema | Server
132
132
const projectRoot = path . join ( context . workspaceRoot , ( metadata . root as string ) || '' ) ;
133
133
const usedFormats = new Set < string > ( ) ;
134
134
for ( const [ locale , desc ] of Object . entries ( i18n . locales ) ) {
135
- if ( i18n . inlineLocales . has ( locale ) ) {
135
+ if ( i18n . inlineLocales . has ( locale ) && desc . file ) {
136
136
const result = loader ( path . join ( projectRoot , desc . file ) ) ;
137
137
138
138
usedFormats . add ( result . format ) ;
@@ -191,8 +191,13 @@ function mergeDeprecatedI18nOptions(
191
191
192
192
if ( i18nFile !== undefined ) {
193
193
i18n . locales [ i18nLocale ] = { file : i18nFile } ;
194
- i18n . flatOutput = true ;
194
+ } else {
195
+ // If no file, treat the locale as the source locale
196
+ // This mimics deprecated behavior
197
+ i18n . sourceLocale = i18nLocale ;
195
198
}
199
+
200
+ i18n . flatOutput = true ;
196
201
}
197
202
198
203
return i18n ;
0 commit comments