WIP adjustments for new translation keys

pull/1/head
ansuz 3 years ago
parent fadbb1661c
commit 31a55a4389

@ -53,14 +53,18 @@ define([
'general': [ // Msg.admin_cat_general 'general': [ // Msg.admin_cat_general
'cp-admin-flush-cache', 'cp-admin-flush-cache',
'cp-admin-update-limit', 'cp-admin-update-limit',
'cp-admin-archive',
'cp-admin-unarchive',
'cp-admin-registration', 'cp-admin-registration',
'cp-admin-email', 'cp-admin-email',
'cp-admin-name',
'cp-admin-description',
'cp-admin-jurisdiction',
], ],
'quota': [ // Msg.admin_cat_quota 'quota': [ // Msg.admin_cat_quota
'cp-admin-defaultlimit', 'cp-admin-defaultlimit',
'cp-admin-setlimit', 'cp-admin-setlimit',
'cp-admin-archive',
'cp-admin-unarchive',
'cp-admin-getquota', 'cp-admin-getquota',
'cp-admin-getlimits', 'cp-admin-getlimits',
], ],
@ -93,10 +97,6 @@ define([
//'cp-admin-provide-aggregate-statistics', //'cp-admin-provide-aggregate-statistics',
'cp-admin-list-my-instance', 'cp-admin-list-my-instance',
'cp-admin-name',
'cp-admin-description',
'cp-admin-jurisdiction',
'cp-admin-consent-to-contact', 'cp-admin-consent-to-contact',
'cp-admin-remove-donate-button', 'cp-admin-remove-donate-button',
'cp-admin-instance-purpose', 'cp-admin-instance-purpose',
@ -151,8 +151,6 @@ define([
return $div; return $div;
}; };
Messages.admin_archiveReason = "// XXX REASON"; // XXX
var archiveForm = function (archive, $div, $button) { var archiveForm = function (archive, $div, $button) {
var label = h('label', { for: 'cp-admin-archive' }, Messages.admin_archiveInput); var label = h('label', { for: 'cp-admin-archive' }, Messages.admin_archiveInput);
var input = h('input#cp-admin-archive', { var input = h('input#cp-admin-archive', {
@ -168,11 +166,10 @@ define([
}); });
var input3 = h('input', { var input3 = h('input', {
id: 'cp-admin-archive-reason', id: 'cp-admin-archive-reason',
placeholder: Messages.admin_archiveReason,
}); });
var label3 = h('label', { var label3 = h('label', {
for: 'cp-admin-archive-reason', for: 'cp-admin-archive-reason',
}, Messages.admin_archiveReason); }, Messages.admin_archiveNote);
var $pw = $(input2); var $pw = $(input2);
$pw.addClass('cp-admin-pw'); $pw.addClass('cp-admin-pw');
@ -377,8 +374,8 @@ define([
create['email'] = function () { create['email'] = function () {
var key = 'email'; var key = 'email';
var $div = makeBlock(key, true); // Msg.admin_emailHint, Msg.admin_emailTitle, Msg.admin_emailButton var $div = makeBlock(key, true); // Msg.admin_emailHint, Msg.admin_emailTitle, Msg.admin_emailButton // XXX drop 'emailButton'
var $button = $div.find('button'); var $button = $div.find('button').text(Messages.settings_save);
var input = h('input', { var input = h('input', {
type: 'email', type: 'email',
@ -414,15 +411,10 @@ define([
return $div; return $div;
}; };
Messages.admin_jurisdictionHint = 'Jurisdiction hint'; // XXX
Messages.admin_jurisdictionTitle = 'Jurisdiction title'; // XXX
Messages.admin_jurisdictionButton = 'Jurisdiction button'; // XXX
Messages.admin_jurisdictionPlaceholder = 'Jurisdiction placeholder'; // XXX
create['jurisdiction'] = function () { create['jurisdiction'] = function () {
var key = 'jurisdiction'; var key = 'jurisdiction';
var $div = makeBlock(key, true); // Msg.admin_jurisdictionHint, Msg.admin_jurisdictionTitle, Msg.admin_jurisdictionButton var $div = makeBlock(key, true); // Msg.admin_jurisdictionHint, Msg.admin_jurisdictionTitle, Msg.admin_jurisdictionButton
var $button = $div.find('button').addClass('cp-listing-action'); var $button = $div.find('button').addClass('cp-listing-action').text(Messages.settings_save);
var input = h('input.cp-listing-info', { var input = h('input.cp-listing-info', {
type: 'text', type: 'text',
@ -434,12 +426,12 @@ define([
var spinner = UI.makeSpinner($(innerDiv)); var spinner = UI.makeSpinner($(innerDiv));
$button.click(function () { $button.click(function () {
if (!$input.val()) { return; } if (!$input.val()) { return; } // XXX
spinner.spin(); spinner.spin();
$button.attr('disabled', 'disabled'); $button.attr('disabled', 'disabled');
sFrameChan.query('Q_ADMIN_RPC', { sFrameChan.query('Q_ADMIN_RPC', {
cmd: 'ADMIN_DECREE', cmd: 'ADMIN_DECREE',
data: ['SET_INSTANCE_JURISDICTION', [$input.val()]] // XXX not implemented data: ['SET_INSTANCE_JURISDICTION', [$input.val()]] // XXX
}, function (e, response) { }, function (e, response) {
$button.removeAttr('disabled'); $button.removeAttr('disabled');
if (e || response.error) { if (e || response.error) {
@ -450,7 +442,7 @@ define([
return; return;
} }
spinner.done(); spinner.done();
UI.log(Messages.saved); UI.log(Messages._getKey('ui_saved', [Messages.admin_jurisdictionTitle]));
}); });
}); });
@ -459,21 +451,16 @@ define([
return $div; return $div;
}; };
Messages.admin_nameHint = 'instance name hint'; // XXX
Messages.admin_nameTitle = 'instance name title'; // XXX
Messages.admin_nameButton = 'instance name button'; // XXX
Messages.admin_namePlaceholder = 'instance name placeholder'; // XXX
create['name'] = function () { create['name'] = function () {
var key = 'name'; var key = 'name';
var $div = makeBlock(key, true); var $div = makeBlock(key, true);
// Msg.admin_nameHint, Msg.admin_nameTitle, Msg.admin_nameButton // Msg.admin_nameHint, Msg.admin_nameTitle, Msg.admin_nameButton
var $button = $div.find('button').addClass('cp-listing-action'); var $button = $div.find('button').addClass('cp-listing-action').text(Messages.settings_save);
var input = h('input.cp-listing-info', { var input = h('input.cp-listing-info', {
type: 'text', type: 'text',
value: APP.instanceStatus.instanceName || '', value: APP.instanceStatus.instanceName || ApiConfig.httpUnsafeOrigin || '',
placeholder: Messages.admin_namePlaceholder, placeholder: ApiConfig.httpUnsafeOrigin, //Messages.admin_namePlaceholder, // XXX
style: 'margin-bottom: 5px;', style: 'margin-bottom: 5px;',
}); });
var $input = $(input); var $input = $(input);
@ -481,7 +468,7 @@ define([
var spinner = UI.makeSpinner($(innerDiv)); var spinner = UI.makeSpinner($(innerDiv));
$button.click(function () { $button.click(function () {
if (!$input.val()) { return; } if (!$input.val()) { return; } // XXX
spinner.spin(); spinner.spin();
$button.attr('disabled', 'disabled'); $button.attr('disabled', 'disabled');
sFrameChan.query('Q_ADMIN_RPC', { sFrameChan.query('Q_ADMIN_RPC', {
@ -497,7 +484,7 @@ define([
return; return;
} }
spinner.done(); spinner.done();
UI.log(Messages.saved); UI.log(Messages._getKey('ui_saved', [Messages.admin_nameTitle]));
}); });
}); });
@ -506,21 +493,15 @@ define([
return $div; return $div;
}; };
Messages.admin_descriptionHint = 'Description hint'; // XXX
Messages.admin_descriptionTitle = 'Description title'; // XXX
Messages.admin_descriptionButton = 'Description button'; // XXX
Messages.admin_descriptionPlaceholder = 'Description placeholder'; // XXX
create['description'] = function () { create['description'] = function () {
var key = 'description'; var key = 'description';
var $div = makeBlock(key, true); var $div = makeBlock(key, true);
var textarea = h('textarea.cp-admin-description-text.cp-listing-info', { // XXX use something from UI elements? var textarea = h('textarea.cp-admin-description-text.cp-listing-info', { // XXX use something from UI elements?
placeholder: Messages.admin_descriptionPlaceholder, placeholder: Messages.home_host || '', // XXX
}, APP.instanceStatus.instanceDescription || ''); }, APP.instanceStatus.instanceDescription || '');
var $button = $div.find('button'); var $button = $div.find('button').text(Messages.settings_save);
$button.addClass('cp-listing-action'); $button.addClass('cp-listing-action');
@ -535,7 +516,7 @@ define([
var spinner = UI.makeSpinner($(innerDiv)); var spinner = UI.makeSpinner($(innerDiv));
$button.click(function () { $button.click(function () {
if (!$input.val()) { return; } if (!$input.val()) { return; } // XXX
spinner.spin(); spinner.spin();
$button.attr('disabled', 'disabled'); $button.attr('disabled', 'disabled');
sFrameChan.query('Q_ADMIN_RPC', { sFrameChan.query('Q_ADMIN_RPC', {
@ -551,7 +532,7 @@ define([
return; return;
} }
spinner.done(); spinner.done();
UI.log(Messages.saved); UI.log(Messages._getKey('ui_saved', [Messages.admin_descriptionTitle]));
}); });
}); });

@ -1639,11 +1639,6 @@ define([
return $container; return $container;
}; };
Messages.info_termsFlavour = "<a>XXX terms flavour</a>"; // XXX
Messages.info_imprintFlavour = "<a>XXX imprint flavour</a>"; // XXX
Messages.info_roadmapFlavour = "<a>XXX roadmap flavour</a>"; // XXX
Messages.info_sourceFlavour = "<a>XXX source flavour</a>"; // XXX
UIElements.displayInfoMenu = function (Common, metadataMgr) { UIElements.displayInfoMenu = function (Common, metadataMgr) {
//var padType = metadataMgr.getMetadata().type; //var padType = metadataMgr.getMetadata().type;
var priv = metadataMgr.getPrivateData(); var priv = metadataMgr.getPrivateData();
@ -1674,18 +1669,8 @@ define([
var legalLine = template(Messages.info_imprintFlavour, Pages.imprintLink); var legalLine = template(Messages.info_imprintFlavour, Pages.imprintLink);
var privacyLine = template(Messages.info_privacyFlavour, Pages.privacyLink); var privacyLine = template(Messages.info_privacyFlavour, Pages.privacyLink);
var faqLine = template(Messages.help_genericMore, Pages.docsLink); var faqLine = template(Messages.help_genericMore, Pages.docsLink);
// XXX terms
var termsLine = template(Messages.info_termsFlavour, Pages.termsLink); var termsLine = template(Messages.info_termsFlavour, Pages.termsLink);
// XXX imprint
var imprintLine = template(Messages.info_imprintFlavour, Pages.imprintLink);
// XXX roadmap
var roadmapLine = template(Messages.info_roadmapFlavour, Pages.roadmapLink);
var sourceLine = template(Messages.info_sourceFlavour, Pages.sourceLink); var sourceLine = template(Messages.info_sourceFlavour, Pages.sourceLink);
var content = h('div.cp-info-menu-container', [ var content = h('div.cp-info-menu-container', [
@ -1697,13 +1682,11 @@ define([
h('span', Pages.versionString) h('span', Pages.versionString)
]), ]),
h('hr'), h('hr'),
legalLine,
privacyLine,
termsLine, // XXX
imprintLine, // XXX
faqLine, faqLine,
roadmapLine, // XXX termsLine,
sourceLine, // XXX privacyLine,
legalLine,
sourceLine,
]); ]);
$(content).find('a').attr('target', '_blank'); $(content).find('a').attr('target', '_blank');

@ -182,7 +182,7 @@ define([
return $select; return $select;
}; };
Messages.support_warning_prompt = "We may require additional information depending on the nature of your issue. Choose the most relevant category for suggestions."; Messages.support_warning_prompt = "We may require additional information depending on the nature of your issue. Choose the most relevant category for suggestions."; // XXX
Messages.support_warning_account = "CryptPad administrators are unable to identify accounts, teams, folders, and files by their names. Please provide their identifiers if your issue relates to one of these features."; // XXX Messages.support_warning_account = "CryptPad administrators are unable to identify accounts, teams, folders, and files by their names. Please provide their identifiers if your issue relates to one of these features."; // XXX
Messages.support_warning_data = 'What data was lost? Is it entirely gone or only corrupted? Is it backed up? Can you provide a link to the content or at least its document id?'; // XXX Messages.support_warning_data = 'What data was lost? Is it entirely gone or only corrupted? Is it backed up? Can you provide a link to the content or at least its document id?'; // XXX

Loading…
Cancel
Save