本文整理汇总了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');
});
示例2:
const groupList = user.groups.map(grp => this.translate.instant(grp.name));
示例3:
}).catch((err) => {
wallet.error = (err === 'WALLET_NOT_REGISTERED') ? this.translate.instant('Wallet not registered') : this.bwcErrorProvider.msg(err);
this.logger.error(err);
});
示例4:
}).catch((err: any) => {
this.onGoingProcessProvider.clear();
this.setError(err, this.translate.instant('Could not reject payment'));
});
示例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'));
}
}
示例6:
return promise.then((translateParams) => {
this.completionDescription = this.translate.instant(langKey, { $a: translateParams });
});
示例7:
.subscribe(event => {
const title = event['title'];
if (title) {
this.titleService.setTitle(this.translateService.instant(title));
}
});
示例8:
viewSpeaker.getVerboseName = (plural: boolean = false) => {
return this.translate.instant(plural ? 'Speakers' : 'Speaker');
};
示例9:
}).catch((err: any) => {
this.popupProvider.ionicAlert(this.translate.instant('Error'), err);
return;
});
示例10: reject
.catch(() => {
let msg = this.translate.instant('Error deleting addressbook');
return reject(msg);
});
示例11:
const headerRow = ['Title', 'Text'].map(item => this.translate.instant(item)).join(',');
示例12: onDelete
onDelete(track:TrackModel){
this.jsrolService.deleteTrack(track);
this.snackbarService.showSnackbar({
message: this.translate.instant('ADMIN.TRACK.CONFIRM_DELETE')
});
}
示例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]
};
}
示例14: function
function (profile) {
console.log('success: ' + profile.userId);
configSrv.presentToast(translate.instant('lbl_ok_login'))
},
示例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];
}