@@ -30,7 +30,6 @@ export interface I18nOptions {
30
30
> ;
31
31
flatOutput ?: boolean ;
32
32
readonly shouldInline : boolean ;
33
- veCompatLocale ?: string ;
34
33
hasDefinedSourceLocale ?: boolean ;
35
34
}
36
35
@@ -160,50 +159,9 @@ export async function configureI18nBuild<T extends BrowserBuilderSchema | Server
160
159
161
160
const buildOptions = { ...options } ;
162
161
const tsConfig = readTsconfig ( buildOptions . tsConfig , context . workspaceRoot ) ;
163
- const usingIvy = tsConfig . options . enableIvy !== false ;
164
162
const metadata = await context . getProjectMetadata ( context . target ) ;
165
163
const i18n = createI18nOptions ( metadata , buildOptions . localize ) ;
166
164
167
- // Until 11.0, support deprecated i18n options when not using new localize option
168
- // i18nFormat is automatically calculated
169
- if ( buildOptions . localize === undefined && usingIvy ) {
170
- mergeDeprecatedI18nOptions ( i18n , buildOptions . i18nLocale , buildOptions . i18nFile ) ;
171
- } else if ( buildOptions . localize !== undefined && ! usingIvy ) {
172
- if (
173
- buildOptions . localize === true ||
174
- ( Array . isArray ( buildOptions . localize ) && buildOptions . localize . length > 1 )
175
- ) {
176
- throw new Error (
177
- `Localization with multiple locales in one build is not supported with View Engine.` ,
178
- ) ;
179
- }
180
-
181
- for ( const deprecatedOption of [ 'i18nLocale' , 'i18nFormat' , 'i18nFile' ] ) {
182
- // tslint:disable-next-line: no-any
183
- if ( typeof ( buildOptions as any ) [ deprecatedOption ] !== 'undefined' ) {
184
- context . logger . warn (
185
- `Option 'localize' and deprecated '${ deprecatedOption } ' found. Using 'localize'.` ,
186
- ) ;
187
- }
188
- }
189
-
190
- if (
191
- buildOptions . localize === false ||
192
- ( Array . isArray ( buildOptions . localize ) && buildOptions . localize . length === 0 )
193
- ) {
194
- buildOptions . i18nFile = undefined ;
195
- buildOptions . i18nLocale = undefined ;
196
- buildOptions . i18nFormat = undefined ;
197
- }
198
- }
199
-
200
- // Clear deprecated options when using Ivy to prevent unintended behavior
201
- if ( usingIvy ) {
202
- buildOptions . i18nFile = undefined ;
203
- buildOptions . i18nFormat = undefined ;
204
- buildOptions . i18nLocale = undefined ;
205
- }
206
-
207
165
// No additional processing needed if no inlining requested and no source locale defined.
208
166
if ( ! i18n . shouldInline && ! i18n . hasDefinedSourceLocale ) {
209
167
return { buildOptions, i18n } ;
@@ -298,31 +256,6 @@ export async function configureI18nBuild<T extends BrowserBuilderSchema | Server
298
256
desc . translation = loadResult . translations ;
299
257
}
300
258
}
301
-
302
- // Legacy message id's require the format of the translations
303
- if ( usedFormats . size > 0 ) {
304
- buildOptions . i18nFormat = [ ...usedFormats ] [ 0 ] ;
305
- }
306
-
307
- // Provide support for using the Ivy i18n options with VE
308
- if ( ! usingIvy ) {
309
- i18n . veCompatLocale = buildOptions . i18nLocale = [ ...i18n . inlineLocales ] [ 0 ] ;
310
-
311
- if ( buildOptions . i18nLocale !== i18n . sourceLocale ) {
312
- if ( i18n . locales [ buildOptions . i18nLocale ] . files . length > 1 ) {
313
- throw new Error (
314
- 'Localization with View Engine only supports using a single translation file per locale.' ,
315
- ) ;
316
- }
317
- buildOptions . i18nFile = i18n . locales [ buildOptions . i18nLocale ] . files [ 0 ] . path ;
318
- }
319
-
320
- // Clear inline locales to prevent any new i18n related processing
321
- i18n . inlineLocales . clear ( ) ;
322
-
323
- // Update the output path to include the locale to mimic Ivy localize behavior
324
- buildOptions . outputPath = path . join ( buildOptions . outputPath , buildOptions . i18nLocale ) ;
325
- }
326
259
}
327
260
328
261
// If inlining store the output in a temporary location to facilitate post-processing
@@ -341,34 +274,6 @@ export async function configureI18nBuild<T extends BrowserBuilderSchema | Server
341
274
return { buildOptions, i18n } ;
342
275
}
343
276
344
- function mergeDeprecatedI18nOptions (
345
- i18n : I18nOptions ,
346
- i18nLocale : string | undefined ,
347
- i18nFile : string | undefined ,
348
- ) : I18nOptions {
349
- if ( i18nFile !== undefined && i18nLocale === undefined ) {
350
- throw new Error ( `Option 'i18nFile' cannot be used without the 'i18nLocale' option.` ) ;
351
- }
352
-
353
- if ( i18nLocale !== undefined ) {
354
- i18n . inlineLocales . clear ( ) ;
355
- i18n . inlineLocales . add ( i18nLocale ) ;
356
-
357
- if ( i18nFile !== undefined ) {
358
- i18n . locales [ i18nLocale ] = { files : [ { path : i18nFile } ] , baseHref : '' } ;
359
- } else {
360
- // If no file, treat the locale as the source locale
361
- // This mimics deprecated behavior
362
- i18n . sourceLocale = i18nLocale ;
363
- i18n . locales [ i18nLocale ] = { files : [ ] , baseHref : '' } ;
364
- }
365
-
366
- i18n . flatOutput = true ;
367
- }
368
-
369
- return i18n ;
370
- }
371
-
372
277
function findLocaleDataBasePath ( projectRoot : string ) : string | null {
373
278
try {
374
279
const commonPath = path . dirname (
0 commit comments