Last active
March 8, 2022 07:51
-
-
Save ppowstanski/a93ea09dd9170a6fea38ceb1ca49f6a4 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