本文整理汇总了TypeScript中@util/Translation.t函数的典型用法代码示例。如果您正苦于以下问题:TypeScript t函数的具体用法?TypeScript t怎么用?TypeScript t使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了t函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: insertDevices
async function insertDevices(devices: Device[], identityManager: IdentityManager, listElement) {
if (devices.length === 0) {
listElement.empty().append($('<p>').text(Translation.t('No_devices_available')));
return;
}
for (let device of devices) {
//@TODO show spinner
let properties = await getDeviceProperties(device, identityManager);
let element = $(omemoDeviceItemTemplate(properties));
let lastUsedElement = element.find('.jsxc-omemo-device-last-used');
if (properties.lastUsed) {
DateTime.stringify(properties.lastUsed.getTime(), lastUsedElement);
} else {
lastUsedElement.text(Translation.t('never'));
}
attachActionHandler(element, device);
listElement.append(element);
}
}
示例2:
let basicData = resources.map((resource) => {
let presence = Presence[contact.getPresence(resource)];
return {
resource,
client: Translation.t('loading'),
presence: Translation.t(presence),
}
});
示例3: onOnceIncoming
public onOnceIncoming() {
Notification.notify({
title: Translation.t('Incoming_stream'),
message: Translation.t('from_sender') + this.peerContact.getName(),
source: this.peerContact
});
// send signal to partner
this.session.ring();
}
示例4: showForm
function showForm(form: Form, contact: MultiUserContact, connection: IConnection) {
let formElement = form.toHTML();
let submitButton = $(`<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<button class="jsxc-button jsxc-button--default jsxc-js-close" type="button">${Translation.t('Cancel')}</button>
<button class="jsxc-button jsxc-button--primary" type="submit">${Translation.t('Save')}</button>
</div>
</div>`);
formElement.append(submitButton);
dialog.getDom().empty().append(formElement);
return new Promise((resolve, reject) => {
formElement.submit((ev) => { //@TODO block form
ev.preventDefault();
let form = Form.fromHTML(formElement.get(0));
contact.setRoomConfiguration(form.toJSON());
let submitPromise = connection.getMUCService()
.submitRoomConfiguration(contact.getJid(), form)
.then((stanza) => {
Log.debug('Room configuration submitted');
dialog.close();
return stanza;
});
resolve(submitPromise);
});
formElement.find('.jsxc-js-close').click((ev) => {
ev.preventDefault();
let cancelRoomPromise = connection.getMUCService()
.cancelRoomConfiguration(contact.getJid())
.then(() => {
Log.debug('Room configuration canceled');
dialog.close();
return CANCELED;
});
resolve(cancelRoomPromise);
});
})
}
示例5: addCleanUpAction
function addCleanUpAction(omemo: Omemo, dom: JQuery) {
let buttonElement = $('<button>');
buttonElement.addClass('jsxc-button jsxc-button--default')
buttonElement.text(Translation.t('Clean_up_own_devices'));
buttonElement.click((ev) => {
ev.preventDefault();
omemo.cleanUpDeviceList().then(localDeviceId => {
dom.find('.jsxc-omemo-owndevices').children().not(`[data-device-id="${localDeviceId}"]`).remove();
});
});
buttonElement.appendTo(dom);
let explanationElement = $('<p>');
explanationElement.addClass('jsxc-hint jsxc-max-width');
explanationElement.text(Translation.t('omemo-clean-up-explanation'));
explanationElement.appendTo(dom);
}
示例6: vcardErrorCallback
function vcardErrorCallback() {
let dialogElement = dialog.getDom();
dialogElement.find('.jsxc-waiting').remove();
let content = '<p>';
content += Translation.t('Sorry_your_buddy_doesnt_provide_any_information');
content += '</p>';
dialogElement.append(content);
}
示例7: convertToTemplateData
function convertToTemplateData(vCardData): any[] {
let properties = [];
for (let name in vCardData) {
let value = vCardData[name];
let childProperties;
if (typeof value === 'object' && value !== null) {
childProperties = convertToTemplateData(value);
value = undefined;
}
properties.push({
name: Translation.t(name),
value,
properties: childProperties
});
}
return properties;
}
示例8: translate
export function translate(str: string, param) {
return Translation.t(str, param);
}