Add translation keys and remove/fix XXX

pull/1/head
yflory 5 years ago
parent b3041bd59a
commit d90115fbc9

File diff suppressed because it is too large Load Diff

@ -771,7 +771,7 @@ define([
id: id
};
});
var teamsList = UIElements.getFriendsList('Share with a team', { // XXX
var teamsList = UIElements.getFriendsList(Messages.share_linkTeam, {
common: common,
noFilter: true,
friends: teams
@ -1182,7 +1182,7 @@ define([
var hasFriends = Object.keys(config.friends || {}).length !== 0;
if (!hasFriends) {
return void UI.alert('No friend to invite'); // XXX
return void UI.alert(Messages.team_noFriend);
}
var privateData = common.getMetadataMgr().getPrivateData();
var team = privateData.teams[config.teamId];
@ -1203,7 +1203,7 @@ define([
$btn.prop('disabled', 'disabled');
}
};
var list = UIElements.getFriendsList('Pick the friends you want to invite to the team', { // XXX
var list = UIElements.getFriendsList(Messages.team_pickFriends, {
common: common,
friends: config.friends,
}, refreshButton);
@ -1217,7 +1217,7 @@ define([
keys: [27]
}, {
className: 'primary',
name: 'INVITE', // XXX
name: Messages.team_inviteModalButton,
onClick: function () {
var $sel = $div.find('.cp-share-friend.cp-selected');
var sel = $sel.toArray();
@ -2895,7 +2895,7 @@ define([
'data-value': teamId,
'href': '#'
},
content: 'TEAM: <b>' + t.name + '</b>' // XXX
content: Messages._getKey('team_pcsSelectEntry', [Util.fixHTML(t.name)])
};
});
teamOptions.unshift({
@ -2926,9 +2926,9 @@ define([
$teamBlock.setValue(id);
});
team = h('div.cp-creation-team', [
'Store in', // XXX
Messages.team_pcsSelectLabel,
$teamBlock[0],
createHelper('#', "The pad will be stored in your team's drive. If this is an owned pad, it will be owned by the team.") // XXX
createHelper('#', Messages.team_pcsSelectHelp)
]);
if (privateData.storeInTeam) {
$teamBlock.setValue(privateData.storeInTeam);
@ -3717,8 +3717,7 @@ define([
var verified = UIElements.getVerifiedFriend(common, msg.author, name);
//var text = Messages._getKey('', [name, title]); // XXX
var text = name + " has invited you to join the team <b>" + teamName +"</b>";
var text = Messages._getKey('team_invitedToTeam', [name, teamName]);
var div = h('div', [
UI.setHTML(h('p'), text),

@ -716,7 +716,7 @@ define([
if (room.isFriendChat) {
$parentEl = $userlist.find('.cp-app-contacts-friends');
} else if (room.isTeamChat) {
$parentEl = $userlist.find('.cp-app-contacts-padchat'); // XXX
$parentEl = $userlist.find('.cp-app-contacts-padchat');
} else if (room.isPadChat) {
$parentEl = $userlist.find('.cp-app-contacts-padchat');
} else {
@ -829,7 +829,7 @@ define([
return void console.error('Invalid team chat');
}
var room = rooms[0];
room.name = 'TEAMS'; // XXX
room.name = Messages.type.team;
rooms.forEach(initializeRoom);
});
};

@ -261,8 +261,7 @@ define([
var name = Util.fixHTML(msg.content.user.displayName) || Messages.anonymous;
var teamName = Util.fixHTML(Util.find(msg, ['content', 'team', 'metadata', 'name']) || '');
content.getFormatText = function () {
var text = name + " has invited you to join the team <b>" + teamName +"</b>";
// XXX
var text = Messages._getKey('team_invitedToTeam', [name, teamName]);
return text;
};
if (!content.archived) {
@ -280,8 +279,7 @@ define([
var name = Util.fixHTML(msg.content.user.displayName) || Messages.anonymous;
var teamName = Util.fixHTML(Util.find(msg, ['content', 'teamName']) || '');
content.getFormatText = function () {
var text = name + " has kicked you from join the team <b>" + teamName +"</b>";
// XXX
var text = Messages._getKey('team_kickedFromTeam', [name, teamName]);
return text;
};
if (!content.archived) {
@ -296,10 +294,9 @@ define([
// Display the notification
var name = Util.fixHTML(msg.content.user.displayName) || Messages.anonymous;
var teamName = Util.fixHTML(Util.find(msg, ['content', 'team', 'metadata', 'name']) || '');
//var key = 'owner_request_' + (msg.content.answer ? 'accepted' : 'declined');
var key = 'team_' + (msg.content.answer ? 'accept' : 'decline') + 'Invitation';
content.getFormatText = function () {
//return Messages._getKey(key, [name, title]); // XXX
return name +' has ' + (msg.content.answer ? 'accepted' : 'declined') + ' your offer to join the team <b>' + teamName + '</b>';
return Messages._getKey(key, [name, teamName]);
};
if (!content.archived) {
content.dismissHandler = defaultDismiss(common, data);

@ -446,7 +446,7 @@ var factory = function (Util, Hash, CPNetflux, Sortify, nThen, Crypto) {
// deleted while you are open
// emit an event
var onChannelError = function (info) {
if (!ready) { return void cb(info); } // XXX make sure we don't reconnect
if (!ready) { return void cb(info); }
console.error("CHANNEL_ERROR", info);
};

@ -173,7 +173,7 @@ define([
showCategories(categories[key]);
});
$category.append(Messages['team_cat_'+key] || key); // XXX
$category.append(Messages['team_cat_'+key] || key);
});
if (active === 'drive') {
APP.$rightside.addClass('cp-rightside-drive');
@ -259,8 +259,8 @@ define([
makeBlock('info', function (common, cb) {
cb([
h('h3', 'Team application'), // XXX
h('p', 'From here you can ...') // XXX
h('h3', Messages.team_infoLabel),
h('p', Messages.team_infoContent)
]);
});
@ -274,13 +274,12 @@ define([
var lis = [];
Object.keys(obj).forEach(function (id) {
var team = obj[id];
var a = h('a', 'Open');
var a = h('a', Messages.team_listLoad);
var avatar = h('span.cp-avatar.cp-team-list-avatar');
lis.push(h('li', h('ul', [
h('li', avatar), // XXX
h('li', 'Name: ' + team.metadata.name), // XXX
h('li', 'ID: ' + id), // XXX
h('li', a) // XXX
lis.push(h('li', h('ul', [ // XXX UI
h('li', avatar),
h('li', team.metadata.name),
h('li', a)
])));
common.displayAvatar($(avatar), team.metadata.avatar, team.metadata.name);
$(a).click(function () {
@ -305,11 +304,11 @@ define([
makeBlock('create', function (common, cb) {
var content = [];
content.push(h('h3', 'Create a team')); // XXX
content.push(h('label', 'Team name')); // XXX
content.push(h('h3', Messages.team_createLabel));
content.push(h('label', Messages.team_createName));
var input = h('input', {type:'text'});
content.push(input);
var button = h('button.btn.btn-success', 'Create'); // XXX
var button = h('button.btn.btn-success', Messages.creation_create);
content.push(h('br'));
content.push(h('br'));
content.push(button);
@ -403,7 +402,7 @@ define([
// If they're a member and I have a higher role than them, I can promote them to admin
if (!isMe && myRole > theirRole && theirRole === 0) {
var promote = h('span.fa.fa-angle-double-up', {
title: 'Promote' // XXX
title: Messages.team_rosterPromote
});
$(promote).click(function () {
data.role = 'ADMIN';
@ -416,7 +415,7 @@ define([
// (if they're not already a MEMBER)
if (!isMe && myRole >= theirRole && theirRole > 0) {
var demote = h('span.fa.fa-angle-double-down', {
title: 'Demote' // XXX
title: Messages.team_rosterDemote
});
$(demote).click(function () {
data.role = ROLES[theirRole - 1] || 'MEMBER';
@ -428,7 +427,7 @@ define([
// If I'm not a member and I have an equal or higher role than them, I can remove them
if (!isMe && myRole > 0 && myRole >= theirRole) {
var remove = h('span.fa.fa-times', {
title: 'Remove' // XXX
title: Messages.team_rosterKick
});
$(remove).click(function () {
$(remove).hide();
@ -487,15 +486,14 @@ define([
}).map(function (k) {
return makeMember(common, roster[k], me);
});
// XXX LEAVE the team button
// XXX INVITE to the team button
var header = h('div.cp-app-team-roster-header');
var $header = $(header);
// If you're an admin or an owner, you can invite your friends to the team
// TODO and acquaintances later?
if (me && (me.role === 'ADMIN' || me.role === 'OWNER')) {
var invite = h('button.btn.btn-primary', 'INVITE A FRIEND');
var invite = h('button.btn.btn-primary', Messages.team_inviteButton);
var inviteFriends = common.getFriends();
Object.keys(inviteFriends).forEach(function (curve) {
// Keep only friends that are not already in the team and that you can contact
@ -517,9 +515,9 @@ define([
}
if (me && (me.role === 'ADMIN' || me.role === 'MEMBER')) {
var leave = h('button.btn.btn-danger', 'LEAVE THE TEAM');
var leave = h('button.btn.btn-danger', Messages.team_leaveButton);
$(leave).click(function () {
UI.confirm("Your're going to leave this team and lose access to its entire drive. Are you sure?", function (yes) {
UI.confirm(Messages.team_leaveConfirm, function (yes) {
if (!yes) { return; }
APP.module.execCommand('LEAVE_TEAM', {
teamId: APP.team
@ -535,11 +533,11 @@ define([
return [
header,
h('h3', 'OWNER'), // XXX
h('h3', Messages.team_owner),
h('div', owner),
h('h3', 'ADMINS'), // XXX
h('h3', Messages.team_admins),
h('div', admins),
h('h3', 'MEMBERS'), // XXX
h('h3', Messages.team_members),
h('div', members)
];
};
@ -557,7 +555,7 @@ define([
teamId: APP.team
}, function (obj) {
if (obj && obj.error) {
return void UI.alert(Messages.error); // XXX
return void UI.alert(Messages.error);
}
common.setTeamChat(obj.channel);
MessengerUI.create($(container), common, true);
@ -700,7 +698,7 @@ define([
driveAPP.loggedIn = common.isLoggedIn();
if (!driveAPP.loggedIn) { throw new Error('NOT_LOGGED_IN'); }
common.setTabTitle('TEAMS (ALPHA)'); // XXX
common.setTabTitle(Messages.type.team);
// Drive data
if (privateData.newSharedFolder) {
@ -712,7 +710,7 @@ define([
var $bar = $('#cp-toolbar');
var configTb = {
displayed: ['useradmin', 'pageTitle', 'newpad', 'limit', 'notifications'],
pageTitle: 'TEAMS (ALPHA)', // XXX
pageTitle: Messages.type.team,
metadataMgr: metadataMgr,
readOnly: privateData.readOnly,
sfCommon: common,

Loading…
Cancel
Save