@@ -70,10 +70,30 @@ export function HttpLoaderFactory(_httpBackend: HttpBackend) {
7070export class AppModule { }
7171```
7272
73- The ` MultiTranslateHttpLoader ` takes a list of strings .
73+ The ` MultiTranslateHttpLoader ` takes a list of ` string[] ` or ` ITranslationResource[] ` .
7474
75- Those strings, for example ` ['/assets/i18n/core/', '/assets/i18n/vendors/'] ` ,
75+ ### String[ ]
76+ For example ` ['/assets/i18n/core/', '/assets/i18n/vendors/'] ` ,
7677will load your translations files for the lang "en" from : ` /assets/i18n/core/en.json ` and ` /assets/i18n/vendors/en.json `
7778
79+ ### Custom suffix
80+ ** For now this loader only support the ` json ` format.**
81+
82+ Instead of an array of ` string[] ` ,
83+ you may pass a list of parameters:
84+ - ` prefix: string = '/assets/i18n/' `
85+ - ` suffix: string = '.json' `
86+
87+ ``` typescript
88+ export function HttpLoaderFactory(_httpBackend : HttpBackend ) {
89+ return new MultiTranslateHttpLoader (_httpBackend , [
90+ {prefix: ' ./assets/i18n/core/' , suffix: ' .json' },
91+ {prefix: ' ./assets/i18n/vendors/' }, // , "suffix: '.json'" being the default value
92+ ]);
93+ }
94+ ```
7895
7996The loader will merge all translation files from the server using [ deepmerge] ( https://github.com/KyleAMathews/deepmerge ) .
97+
98+ ## Authors and acknowledgment
99+ * Former maintainer [ Dennis Keil] ( https://github.com/denniske )
0 commit comments