Add translation keys

pull/1/head
yflory 5 years ago
parent 17113f298c
commit 175423fee4

@ -131,6 +131,10 @@ define([
return $div; return $div;
}; };
// XXX contacts, teams
Messages.contacts = "Contacts";
Messages.teams = "Teams";
// Add owners column // Add owners column
var drawAdd = function () { var drawAdd = function () {
var $div = $(h('div.cp-share-column')); var $div = $(h('div.cp-share-column'));
@ -143,7 +147,7 @@ define([
} }
}); });
// XXX if no more friends, display message... // XXX if no more friends, display message...
var addCol = UIElements.getUserGrid("CONTACTS", { // XXX var addCol = UIElements.getUserGrid(Messages.contacts, {
common: common, common: common,
large: true, large: true,
data: _friends data: _friends
@ -161,7 +165,7 @@ define([
} }
}); });
if (!Object.keys(_teamsData).length) { return $div; } if (!Object.keys(_teamsData).length) { return $div; }
var teamsList = UIElements.getUserGrid("TEAMS", { // XXX var teamsList = UIElements.getUserGrid(Messages.teams, {
common: common, common: common,
large: true, large: true,
noFilter: true, noFilter: true,
@ -169,9 +173,6 @@ define([
}, function () {}); }, function () {});
$div.append(teamsList.div); $div.append(teamsList.div);
// When clicking on the add button, we get the selected users.
//var addButton = h('button.no-margin', Messages.owner_addButton); // XXX
//$div.append(h('p', addButton));
return $div; return $div;
}; };
@ -364,7 +365,6 @@ define([
// Remove owner column // Remove owner column
var drawRemove = function () { var drawRemove = function () {
// XXX filter with allow list
var _allowed = {}; var _allowed = {};
var all = Util.deduplicateString(owners.concat(allowed)); var all = Util.deduplicateString(owners.concat(allowed));
all.forEach(function (ed) { all.forEach(function (ed) {
@ -395,13 +395,18 @@ define([
} }
}); });
// XXX allow_removeConfirm, allow_checkbox, allow_text
Messages.allow_removeConfirm = "Are you sure?"; // XXX
Messages.allow_checkbox = "Enable allow list"; // XXX
Messages.allow_text = 'Pewpewpew'; // XXX
var remove = function (el) { var remove = function (el) {
// Check selection // Check selection
var $el = $(el); var $el = $(el);
var ed = $el.attr('data-ed'); var ed = $el.attr('data-ed');
if (!ed) { return; } if (!ed) { return; }
nThen(function (waitFor) { nThen(function (waitFor) {
var msg = "Are your sure?"; // XXX check existing keys var msg = Messages.allow_removeConfirm;
UI.confirm(msg, waitFor(function (yes) { UI.confirm(msg, waitFor(function (yes) {
if (!yes) { if (!yes) {
waitFor.abort(); waitFor.abort();
@ -429,7 +434,7 @@ define([
}); });
}; };
var cbox = UI.createCheckbox('cp-allowlist', "ENABLE?", restricted); // XXX var cbox = UI.createCheckbox('cp-allowlist', Messages.allow_checkbox, restricted);
var $cbox = $(cbox); var $cbox = $(cbox);
var spinner = UI.makeSpinner($cbox) var spinner = UI.makeSpinner($cbox)
var $checkbox = $cbox.find('input').on('change', function () { var $checkbox = $cbox.find('input').on('change', function () {
@ -459,7 +464,7 @@ define([
}); });
var msg = "ALLOW LIST"; // XXX var msg = Messages._getKey('allow_label', ['']);
var removeCol = UIElements.getUserGrid(msg, { var removeCol = UIElements.getUserGrid(msg, {
common: common, common: common,
large: true, large: true,
@ -470,7 +475,7 @@ define([
}, function () { }); }, function () { });
$(removeCol.div).addClass('cp-overlay-container').append(h('div.cp-overlay')); $(removeCol.div).addClass('cp-overlay-container').append(h('div.cp-overlay'));
return h('div', [ return h('div', [
h('p', 'Allow list text...'), // XXX h('p', Messages.allow_text),
cbox, cbox,
removeCol.div removeCol.div
]); ]);
@ -489,7 +494,7 @@ define([
delete _friends[curve]; delete _friends[curve];
} }
}); });
var addCol = UIElements.getUserGrid("CONTACTS", { // XXX var addCol = UIElements.getUserGrid(Messages.contacts, {
common: common, common: common,
large: true, large: true,
data: _friends data: _friends
@ -507,7 +512,7 @@ define([
} }
}); });
if (!Object.keys(_teamsData).length) { return $div; } if (!Object.keys(_teamsData).length) { return $div; }
var teamsList = UIElements.getUserGrid("TEAMS", { // XXX var teamsList = UIElements.getUserGrid(Messages.teams, {
common: common, common: common,
large: true, large: true,
noFilter: true, noFilter: true,
@ -994,12 +999,16 @@ define([
}); });
})); }));
}).nThen(function () { }).nThen(function () {
// XXX access_main, access_allow
Messages.access_main = 'ACCESS'; // XXX
Messages.access_allow = 'ALLOW'; // XXX
var tabs = UI.dialog.tabs([{ var tabs = UI.dialog.tabs([{
title: "ACCESS", // XXX title: Messages.access_main,
icon: "fa fa-unlock-alt", icon: "fa fa-unlock-alt",
content: tab1 content: tab1
}, { }, {
title: "ALLOW LIST", // XXX title: Messages.access_allow,
disabled: !owned, disabled: !owned,
icon: "fa fa-list", icon: "fa fa-list",
content: tab2 content: tab2

Loading…
Cancel
Save