nz-i18n.service.d.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. import { Observable } from 'rxjs';
  2. import { NzSafeAny } from 'ng-zorro-antd/core/types';
  3. import { DateLocale, NzI18nInterface } from './nz-i18n.interface';
  4. import * as i0 from "@angular/core";
  5. export declare class NzI18nService {
  6. private _locale;
  7. private _change;
  8. private dateLocale;
  9. get localeChange(): Observable<NzI18nInterface>;
  10. constructor();
  11. translate(path: string, data?: NzSafeAny): string;
  12. /**
  13. * Set/Change current locale globally throughout the WHOLE application
  14. * NOTE: If called at runtime, rendered interface may not change along with the locale change,
  15. * because this do not trigger another render schedule.
  16. *
  17. * @param locale The translating letters
  18. */
  19. setLocale(locale: NzI18nInterface): void;
  20. getLocale(): NzI18nInterface;
  21. getLocaleId(): string;
  22. setDateLocale(dateLocale: DateLocale): void;
  23. getDateLocale(): DateLocale;
  24. /**
  25. * Get locale data
  26. *
  27. * @param path dot paths for finding exist value from locale data, eg. "a.b.c"
  28. * @param defaultValue default value if the result is not "truthy"
  29. */
  30. getLocaleData(path: string, defaultValue?: NzSafeAny): NzSafeAny;
  31. private _getObjectPath;
  32. static ɵfac: i0.ɵɵFactoryDeclaration<NzI18nService, never>;
  33. static ɵprov: i0.ɵɵInjectableDeclaration<NzI18nService>;
  34. }