mirror of https://gitlab.com/openlp/web-remote.git
16 lines
498 B
TypeScript
16 lines
498 B
TypeScript
import { TranslateLoader } from '@ngx-translate/core';
|
|
import { Injectable } from '@angular/core';
|
|
import { HttpClient } from '@angular/common/http';
|
|
import { Observable } from 'rxjs';
|
|
|
|
@Injectable({
|
|
providedIn: 'root'
|
|
})
|
|
export class TranslationService implements TranslateLoader {
|
|
constructor(private http: HttpClient) {}
|
|
|
|
getTranslation(language: string): Observable<any> {
|
|
return this.http.get(language === 'default' ? '/assets/en.json' : '/assets/i18n/' + language + '.json');
|
|
}
|
|
}
|