本文整理匯總了TypeScript中@eg/core/locale.service.LocaleService類的典型用法代碼示例。如果您正苦於以下問題:TypeScript service.LocaleService類的具體用法?TypeScript service.LocaleService怎麽用?TypeScript service.LocaleService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了service.LocaleService類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: ngOnInit
ngOnInit() {
// Default to the login locale
this.selectedLocale = this.locale.currentLocaleCode();
this.locales = [];
this.locale.supportedLocales().subscribe(l => this.locales.push(l));
this.onOpen$.subscribe(() => {
const elm = this.renderer.selectRootElement('#translation-input');
if (elm) {
elm.focus();
elm.select();
}
});
}
示例2: resolve
/**
* Loads pre-auth data common to all applications.
* No auth token is available at this level. When needed, auth is
* enforced by application/group-specific resolvers at lower levels.
*/
resolve(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot): Promise<void> {
OpenSRF.locale = this.locale.currentLocaleCode();
this.idl.parseIdl();
return this.org.fetchOrgs(); // anonymous PCRUD.
}
示例3: ngOnInit
ngOnInit() {
this.locale.supportedLocales().subscribe(
l => this.locales.push(l),
err => {},
() => {
this.currentLocale = this.locales.filter(
l => l.code() === this.locale.currentLocaleCode())[0];
}
);
}
示例4: ngOnInit
ngOnInit() {
this.locale.supportedLocales().subscribe(
l => this.locales.push(l),
err => {},
() => {
this.currentLocale = this.locales.filter(
l => l.code() === this.locale.currentLocaleCode())[0];
}
);
// NOTE: this can eventually go away.
// Avoid attempts to fetch org settings if the user has not yet
// logged in (e.g. this is the login page).
if (this.user()) {
this.org.settings('ui.staff.angular_catalog.enabled')
.then(settings => this.showAngularCatalog =
Boolean(settings['ui.staff.angular_catalog.enabled']));
}
}
示例5: setLocale
setLocale(locale: any) {
this.locale.setLocale(locale.code());
}
示例6:
l => l.code() === this.locale.currentLocaleCode())[0];