本文整理匯總了TypeScript中app/core/i18n.t函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript t函數的具體用法?TypeScript t怎麽用?TypeScript t使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了t函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: getMenu
getMenu() {
let menu = [];
menu.push({text: i18n.t('View'), click: 'ctrl.viewPanel(); dismiss();'});
menu.push({text: i18n.t('Edit'), click: 'ctrl.editPanel(); dismiss();', role: 'Editor'});
if (!this.fullscreen) { // duplication is not supported in fullscreen mode
menu.push({ text: i18n.t('Duplicate'), click: 'ctrl.duplicate()', role: 'Editor' });
}
// menu.push({text: 'Share', click: 'ctrl.sharePanel(); dismiss();'});
return menu;
}
示例2: removePanel
removePanel() {
this.publishAppEvent('confirm-modal', {
title: i18n.t('Remove Panel'),
text: i18n.t('Are you sure you want to remove this panel?'),
icon: 'fa-trash',
yesText: i18n.t('Remove'),
onConfirm: () => {
this.row.panels = _.without(this.row.panels, this.panel);
}
});
}
示例3:
dashboards.forEach(function (ds) {
ds.title = ds.type === 'dash-json' ? i18n.t(ds.title) : ds.title;
var m = {
id: ds.id,
text: ds.title,
url: '/dashboard/' + ds.uri,
icon: ds.icon
};
if (ds.type === 'dash-json') {
defaultMenus.push(m);
} else {
customMenus.push(m);
}
});
示例4: onInitMetricsPanelEditMode
private onInitMetricsPanelEditMode() {
this.addEditorTab(i18n.t('Metrics'), 'public/app/partials/metrics.html');
this.addEditorTab(i18n.t('Time range'), 'public/app/features/panel/partials/panelTime.html');
}
示例5: initEditMode
initEditMode() {
this.editorTabs = [];
this.addEditorTab(i18n.t('General'), 'public/app/partials/panelgeneral.html');
this.editModeInitiated = true;
this.events.emit('init-edit-mode', null);
}