Last active
March 7, 2022 17:33
-
-
Save ppowstanski/078e4118734aaff97d9572720b49939f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {HttpClient} from "@angular/common/http"; | |
| import {TranslateLoader} from "@ngx-translate/core"; | |
| import {Observable} from 'rxjs'; | |
| export class TranslateHttpLoader implements TranslateLoader { | |
| constructor(private http: HttpClient, public prefix: string = "/assets/i18n/", public suffix: string = ".json") {} | |
| /** | |
| * Gets the translations from the server | |
| */ | |
| public getTranslation(lang: string): Observable<Object> { | |
| return this.http.get(`${this.prefix}${lang}${this.suffix}`); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment