Add translation keys

pull/1/head
yflory 6 years ago
parent ed868f9c5d
commit 67e39253cf

@ -2628,19 +2628,19 @@ define([
setHTML(h('p'), text)
]);
var buttons = [{
name: Messages.cancel, // XXX "later"?
name: Messages.friendRequest_later,
onClick: function () {},
keys: [27]
}, {
className: 'primary',
name: "Accept (Enter)", // XXX
name: Messages.friendRequest_accept,
onClick: function () {
todo(true);
},
keys: [13]
}, {
className: 'primary',
name: "Ignore the request", // XXX
name: Messages.friendRequest_decline,
onClick: function () {
todo(false);
},

@ -1,8 +1,9 @@
define([
'jquery',
'/common/hyperscript.js',
'/common/common-ui-elements.js'
], function ($, h, UIElements) {
'/common/common-ui-elements.js',
'/customize/messages.js',
], function ($, h, UIElements, Messages) {
var handlers = {};
@ -16,10 +17,10 @@ define([
common.addFriendRequest(data);
// Display the notification
$(el).find('.cp-notification-dismiss').attr('title', 'IGNORE').css('display', 'flex'); // XXX
$(el).find('.cp-notification-dismiss').attr('title', Messages.friendRequest_dismiss).css('display', 'flex');
$(el).find('.cp-notification-content').addClass("cp-clickable");
$(el).find('.cp-notification-content p')
.html('New friend request: <b>'+msg.content.displayName+'</b>') // XXX
.html(Messages._getKey('friendRequest_notification', [msg.content.displayName])
.click(function () {
UIElements.displayFriendRequestModal(common, data);
});

@ -309,9 +309,7 @@ MessengerUI, Messages) {
} else if (friendRequests[data.curvePublic]) {
$('<button>', {
'class': 'fa fa-bell cp-toolbar-userlist-button',
'title': 'Pending friend request' /*Messages._getKey('userlist_addAsFriendTitle', [ // XXX
name
])*/
'title': Messages._getKey('friendRequest_received', [name]),
}).appendTo($nameSpan).click(function (e) {
e.stopPropagation();
UIElements.displayFriendRequestModal(Common, friendRequests[data.curvePublic]);
@ -327,7 +325,6 @@ MessengerUI, Messages) {
e.stopPropagation();
Common.sendFriendRequest(data, function (err, obj) {
if (err || (obj && obj.error)) { return void console.error(err || obj.error); }
// XXX
});
});
}
@ -950,7 +947,7 @@ MessengerUI, Messages) {
var createNotifications = function (toolbar, config) {
var $notif = toolbar.$top.find('.'+NOTIFICATIONS_CLS).show();
var div = h('div.cp-notifications-container', [
h('div.cp-notifications-empty', "Nothing new here") // XXX
h('div.cp-notifications-empty', Messages.notifications_empty)
]);
var pads_options = [div];
var dropdownConfig = {
@ -962,7 +959,7 @@ MessengerUI, Messages) {
};
var $newPadBlock = UIElements.createDropdown(dropdownConfig);
var $button = $newPadBlock.find('button');
$button.attr('title', Messages.mailbox_title); // XXX
$button.attr('title', Messages.notifications_title);
$button.addClass('fa fa-bell-o');
var $n = $button.find('.cp-dropdown-button-title').hide();
var $empty = $(div).find('.cp-notifications-empty');

Loading…
Cancel
Save