@@ -128,7 +128,6 @@ function addProjectI18NOptions(
128
128
function addBuilderI18NOptions ( recorder : UpdateRecorder , builderConfig : JsonAstObject , projectConfig : JsonAstObject ) {
129
129
const options = getAllOptions ( builderConfig ) ;
130
130
131
- let hasi18n = false ;
132
131
for ( const option of options ) {
133
132
const localeId = findPropertyInAstObject ( option , 'i18nLocale' ) ;
134
133
if ( localeId && localeId . kind === 'string' ) {
@@ -146,37 +145,6 @@ function addBuilderI18NOptions(recorder: UpdateRecorder, builderConfig: JsonAstO
146
145
if ( i18nFormat ) {
147
146
removePropertyInAstObject ( recorder , option , 'i18nFormat' ) ;
148
147
}
149
-
150
- hasi18n = ! ! ( hasi18n || i18nFormat || i18nFile || localeId ) ;
151
- }
152
-
153
- if ( hasi18n ) {
154
- const options = findPropertyInAstObject ( builderConfig , 'options' ) ;
155
- if ( ! options || options . kind !== 'object' ) {
156
- return ;
157
- }
158
-
159
- // Don't add localize option of it's already present in the main options
160
- if ( findPropertyInAstObject ( options , 'i18nLocale' ) || findPropertyInAstObject ( options , 'localize' ) ) {
161
- return ;
162
- }
163
-
164
- // Get sourceLocale from extract-i18n builder
165
- const extractI18nConfig = getProjectTarget ( projectConfig , 'extract-i18n' , Builders . ExtractI18n ) ;
166
- let sourceLocale : string | undefined ;
167
-
168
- if ( extractI18nConfig && extractI18nConfig . kind === 'object' ) {
169
- const i18nOptions = getAllOptions ( extractI18nConfig ) ;
170
- sourceLocale = i18nOptions
171
- . map ( o => {
172
- const sourceLocale = findPropertyInAstObject ( o , 'i18nLocale' ) ;
173
-
174
- return sourceLocale && sourceLocale . value ;
175
- } )
176
- . find ( x => ! ! x ) as string ;
177
- }
178
-
179
- insertPropertyInAstObjectInOrder ( recorder , options , 'localize' , [ sourceLocale || 'en-US' ] , 12 ) ;
180
148
}
181
149
}
182
150
0 commit comments