本文整理匯總了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];
}