當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript locale.service.LocaleService類代碼示例

本文整理匯總了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();
            }
        });
    }
開發者ID:StephenGWills,項目名稱:Evergreen,代碼行數:14,代碼來源:translate.component.ts

示例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.
    }
開發者ID:StephenGWills,項目名稱:Evergreen,代碼行數:15,代碼來源:resolver.service.ts

示例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];
            }
        );
    }
開發者ID:jamesrf,項目名稱:Evergreen,代碼行數:11,代碼來源:nav.component.ts

示例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']));
        }
    }
開發者ID:StephenGWills,項目名稱:Evergreen,代碼行數:20,代碼來源:nav.component.ts

示例5: setLocale

 setLocale(locale: any) {
     this.locale.setLocale(locale.code());
 }
開發者ID:jamesrf,項目名稱:Evergreen,代碼行數:3,代碼來源:nav.component.ts

示例6:

 l => l.code() === this.locale.currentLocaleCode())[0];
開發者ID:jamesrf,項目名稱:Evergreen,代碼行數:1,代碼來源:nav.component.ts


注:本文中的@eg/core/locale.service.LocaleService類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。