You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#### 1. Setup the `TranslateModule` to use the `MultiTranslateHttpLoader`:
37
+
_The `MultiTranslateHttpLoader` uses HttpBackend to load translations, therefore :_
38
+
1. Create and export a new `HttpLoaderFactory` function
39
+
2. Import the `HttpClientModule` from `@angular/common/http`
40
+
3. Setup the `TranslateModule` to use the `MultiTranslateHttpLoader`
34
41
35
-
The `MultiTranslateHttpLoader` uses HttpClient to load translations, which means that you have to import the HttpClientModule from `@angular/common/http` before the `TranslateModule`:
@@ -59,7 +60,7 @@ export function HttpLoaderFactory(http: HttpClient) {
59
60
loader: {
60
61
provide: TranslateLoader,
61
62
useFactory: HttpLoaderFactory,
62
-
deps: [HttpClient]
63
+
deps: [HttpBackend]
63
64
}
64
65
})
65
66
],
@@ -68,23 +69,26 @@ export function HttpLoaderFactory(http: HttpClient) {
68
69
exportclassAppModule { }
69
70
```
70
71
71
-
The `MultiTranslateHttpLoader` takes a list of translation file configurations. Each configuration has two optional parameters:
72
-
- prefix: string = "/assets/translate/"
73
-
- suffix: string = ".json"
72
+
The `MultiTranslateHttpLoader` takes a list of strings.
74
73
75
-
By using those default parameters, it will load your translations files for the lang "en" from: `/assets/translate/en.json`.
74
+
Those strings, for example `['/assets/i18n/core/', '/assets/i18n/vendors/']`,
75
+
will load your translations files for the lang "en" from : `/assets/i18n/core/en.json` and `/assets/i18n/vendors/en.json`
76
76
77
-
You can change those in the `HttpLoaderFactory` method that we just defined. For example if you want to load the "en" translations from `/assets/translate/core/en.json` and `/assets/translate/shared/en.json` you would use:
77
+
### Custom suffix
78
+
**For now this loader only support the `json` format.**
0 commit comments