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


TypeScript TranslateService.instant方法代碼示例

本文整理匯總了TypeScript中@ngx-translate/core.TranslateService.instant方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript TranslateService.instant方法的具體用法?TypeScript TranslateService.instant怎麽用?TypeScript TranslateService.instant使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@ngx-translate/core.TranslateService的用法示例。


在下文中一共展示了TranslateService.instant方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: expect

 translate.reloadLang('en').subscribe((res2: string) => {
   expect(translate.instant('TEST')).toEqual('This is a test 2');
 });
開發者ID:denniske,項目名稱:ngx-translate-multi-http-loader,代碼行數:3,代碼來源:multi-http-loader.spec.ts

示例2:

 const groupList = user.groups.map(grp => this.translate.instant(grp.name));
開發者ID:emanuelschuetze,項目名稱:OpenSlides,代碼行數:1,代碼來源:user-pdf.service.ts

示例3:

 }).catch((err) => {
   wallet.error = (err === 'WALLET_NOT_REGISTERED') ? this.translate.instant('Wallet not registered') : this.bwcErrorProvider.msg(err);
   this.logger.error(err);
 });
開發者ID:bitjson,項目名稱:copay,代碼行數:4,代碼來源:bitcoin-cash.ts

示例4:

 }).catch((err: any) => {
   this.onGoingProcessProvider.clear();
   this.setError(err, this.translate.instant('Could not reject payment'));
 });
開發者ID:bitjson,項目名稱:copay,代碼行數:4,代碼來源:txp-details.ts

示例5: setTranslatedBackButtonText

 /**
  * Set the trasnlated back button text in iOS.
  */
 protected setTranslatedBackButtonText(): void {
     if (this.host && this.platform.is('ios')) {
         this.host.setBackButtonText(this.translate.instant('core.back'));
     }
 }
開發者ID:SATS-Seminary,項目名稱:moodlemobile2,代碼行數:8,代碼來源:back-button.ts

示例6:

 return promise.then((translateParams) => {
     this.completionDescription = this.translate.instant(langKey, { $a: translateParams });
 });
開發者ID:SATS-Seminary,項目名稱:moodlemobile2,代碼行數:3,代碼來源:module-completion.ts

示例7:

 .subscribe(event => {
   const title = event['title'];
   if (title) {
     this.titleService.setTitle(this.translateService.instant(title));
   }
 });
開發者ID:epot,項目名稱:Gifter,代碼行數:6,代碼來源:app.component.ts

示例8:

 viewSpeaker.getVerboseName = (plural: boolean = false) => {
     return this.translate.instant(plural ? 'Speakers' : 'Speaker');
 };
開發者ID:CatoTH,項目名稱:OpenSlides,代碼行數:3,代碼來源:speaker-repository.service.ts

示例9:

 }).catch((err: any) => {
   this.popupProvider.ionicAlert(this.translate.instant('Error'), err);
   return;
 });
開發者ID:bitjson,項目名稱:copay,代碼行數:4,代碼來源:view.ts

示例10: reject

 .catch(() => {
   let msg = this.translate.instant('Error deleting addressbook');
   return reject(msg);
 });
開發者ID:hcxiong,項目名稱:copay,代碼行數:4,代碼來源:address-book.ts

示例11:

 const headerRow = ['Title', 'Text'].map(item => this.translate.instant(item)).join(',');
開發者ID:jwinzer,項目名稱:OpenSlides,代碼行數:1,代碼來源:statute-csv-export.service.ts

示例12: onDelete

 onDelete(track:TrackModel){
   this.jsrolService.deleteTrack(track);
   this.snackbarService.showSnackbar({
     message: this.translate.instant('ADMIN.TRACK.CONFIRM_DELETE')
   });
 }
開發者ID:vincent314,項目名稱:jsrol-ng2,代碼行數:6,代碼來源:admin-track-list.component.ts

示例13: createPreamble

 /**
  * Creates the motion preamble
  *
  * @param motion the target motion
  * @returns doc def for the motion text
  */
 private createPreamble(motion: ViewMotion): object {
     return {
         text: `${this.translate.instant(this.configService.instant('motions_preamble'))}`,
         margin: [0, 10, 0, 10]
     };
 }
開發者ID:emanuelschuetze,項目名稱:OpenSlides,代碼行數:12,代碼來源:motion-pdf.service.ts

示例14: function

 function (profile) {
   console.log('success: ' + profile.userId);
   configSrv.presentToast(translate.instant('lbl_ok_login'))
 },
開發者ID:smartcommunitylab,項目名稱:sco.roomreservation,代碼行數:4,代碼來源:accedi.ts

示例15: callListToDoc

    /**
     * Creates pdfMake definitions for the call list of given motions
     * Any motions that are 'top level' (no sort_parent_id) will have their tags
     * used as comma separated header titles in an extra row
     *
     * @param motions A list of motions
     * @returns definitions ready to be opened or exported via {@link PdfDocumentService}
     */
    public callListToDoc(motions: ViewMotion[]): object {
        motions.sort((a, b) => a.callListWeight - b.callListWeight);
        const title = {
            text: this.translate.instant('Call list'),
            style: 'title'
        };
        const callListTableBody: object[] = [
            [
                {
                    text: this.translate.instant('Called'),
                    style: 'tableHeader'
                },
                {
                    text: this.translate.instant('Called with'),
                    style: 'tableHeader'
                },
                {
                    text: this.translate.instant('Submitters'),
                    style: 'tableHeader'
                },
                {
                    text: this.translate.instant('Title'),
                    style: 'tableHeader'
                },
                {
                    text: this.translate.instant('Recommendation'),
                    style: 'tableHeader'
                },
                {
                    text: this.translate.instant('Motion block'),
                    style: 'tableHeader'
                }
            ]
        ];

        const callListRows: object[] = [];
        let currentTitle = '';

        motions.forEach(motion => {
            if (!motion.sort_parent_id) {
                const heading = motion.tags ? motion.tags.map(tag => tag.name).join(', ') : '';
                if (heading !== currentTitle) {
                    callListRows.push([
                        {
                            text: heading,
                            colSpan: 6,
                            style: 'heading3',
                            margin: [0, 10, 0, 10]
                        },
                        '',
                        '',
                        '',
                        '',
                        ''
                    ]);
                    currentTitle = heading;
                }
            }
            callListRows.push(this.createCallListRow(motion));
        });

        const table: object = {
            table: {
                widths: ['auto', 'auto', 'auto', '*', 'auto', 'auto'],
                headerRows: 1,
                body: callListTableBody.concat(callListRows)
            },
            layout: {
                hLineWidth: rowIndex => {
                    return rowIndex === 1;
                },
                vLineWidth: () => {
                    return 0;
                },
                fillColor: rowIndex => {
                    return rowIndex % 2 === 0 ? '#EEEEEE' : null;
                }
            }
        };
        return [title, table];
    }
開發者ID:emanuelschuetze,項目名稱:OpenSlides,代碼行數:89,代碼來源:motion-pdf.service.ts


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