@ngx-easy-i18n-js/http-loader
Version:
Http loader for ngx-easy-i18n-js
25 lines (24 loc) • 832 B
TypeScript
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { EasyI18nMessages } from 'easy-i18n-js';
import { EasyI18nLoader } from '@ngx-easy-i18n-js/core';
export interface IHttpEasyI18nLoaderOptions {
/**
* Url prefix, default '/assets/i18n/' or Array of prefix
*/
prefix?: string | string[];
/**
* Url suffix, default '.json'
*/
suffix?: string;
}
export declare class HttpEasyI18nLoader extends EasyI18nLoader {
private httpClient;
private options;
constructor(httpClient: HttpClient, options?: IHttpEasyI18nLoaderOptions);
/**
* Return messages with locale with HttpClient `${this.options.prefix ?? ''}${locale}${this.options.suffix ?? ''}`
* @param locale
*/
getMessages(locale: string): Observable<EasyI18nMessages>;
}