当前位置: 首页>>代码示例>>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;未经允许,请勿转载。