Skip to content

Commit e70c037

Browse files
author
Raphael Balet
committed
update - readme : suffix & prefix logic
1 parent 9e9d1e9 commit e70c037

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,30 @@ export function HttpLoaderFactory(_httpBackend: HttpBackend) {
7070
export 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/']`,
7677
will 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

7996
The 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

Comments
 (0)