import { TranslateLoader } from '@ngx-translate/core';
import { Observable } from 'rxjs';
import { environment } from 'environments/environment';
import { HttpClient } from '@angular/common/http';

export class TranslateServerLoader implements TranslateLoader{
	private languageUrl = `${environment.Server}language`;

	constructor(
		private http: HttpClient
	) {}
	getTranslation(lang: string): Observable<any> {
		return this.http.get(`${this.languageUrl}/${lang}`);
	}
}
