+ providers: [
+ {
+ provide: TRANSLATIONS,
+ useFactory: (locale) => {
+ // On dev mode, test localization
+ if (isOnDevLocale()) {
+ locale = getDevLocale()
+ return require(`raw-loader!../locale/target/angular_${locale}.xml`)
+ }
+
+ // Default locale, nothing to translate
+ const completeLocale = getCompleteLocale(locale)
+ if (isDefaultLocale(completeLocale)) return ''
+
+ const fileLocale = buildFileLocale(locale)
+ return require(`raw-loader!../locale/target/angular_${fileLocale}.xml`)
+ },
+ deps: [ LOCALE_ID ]
+ },
+ { provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }
+ ]