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