Merge branch 'more-unused-keys' into staging

pull/1/head
ansuz 4 years ago
commit 16534fa65d

@ -25,7 +25,7 @@ define([
].join(''); ].join('');
var built = false; var built = false;
var types = ['less', 'drive', 'migrate', 'sf', 'team', 'pad', 'end']; var types = ['less', 'drive', 'migrate', 'sf', 'team', 'pad', 'end']; // Msg.loading_state_0, loading_state_1, loading_state_2, loading_state_3, loading_state_4, loading_state_5
var current, progress; var current, progress;
var makeList = function (data) { var makeList = function (data) {
var c = types.indexOf(data.type); var c = types.indexOf(data.type);

@ -13,7 +13,7 @@ var ignoreLines = function (source, pattern) {
}; };
var GENERATED_PATTERNS = [ var GENERATED_PATTERNS = [
/(admin|settings)_.*(Hint|Title|Button)/, /(team|admin|settings|support)_.*(Hint|Title|Button)/,
/settings_colortheme/, /settings_colortheme/,
/loading_(state|drive|pad)_/, /loading_(state|drive|pad)_/,
/(admin|notifications|support|team|settings)_cat_/, /(admin|notifications|support|team|settings)_cat_/,
@ -28,7 +28,10 @@ var isPossiblyGenerated = function (key) {
var grep = function (pattern, cb) { var grep = function (pattern, cb) {
var exclude = [ var exclude = [
'www/common/translations/*', 'www/common/translations/*',
'www/common/onlyoffice/*', 'www/common/onlyoffice/v1/*',
'www/common/onlyoffice/v2b*',
'www/common/onlyoffice/x2t/*',
//'www/common/onlyoffice/build/*',
'www/lib/*', 'www/lib/*',
'www/common/pdfjs/*', 'www/common/pdfjs/*',
'*.css', '*.css',
@ -75,7 +78,7 @@ var grep = function (pattern, cb) {
if (/data\-localization/.test(stdout)) { if (/data\-localization/.test(stdout)) {
return cb(void 0, true, "DATA_LOCALIZATION", stdout); return cb(void 0, true, "DATA_LOCALIZATION", stdout);
} }
if (/(Messages|Msg|messages)\./.test(stdout)) { if (/(Messages|Msg|messages)\./.test(stdout) || /(footLink|footerCol)/.test(stdout)) {
return cb(void 0, false); return cb(void 0, false);
} }

@ -273,7 +273,7 @@ define([
return $div; return $div;
}; };
var getPrettySize = function (bytes) { var getPrettySize = function (bytes) { // XXX duplicate of UIElements.prettySize ?
var unit = Util.magnitudeOfBytes(bytes); var unit = Util.magnitudeOfBytes(bytes);
var value = unit === 'GB' ? Util.bytesToGigabytes(bytes) : Util.bytesToMegabytes(bytes); var value = unit === 'GB' ? Util.bytesToGigabytes(bytes) : Util.bytesToMegabytes(bytes);
return unit === 'GB' ? Messages._getKey('formattedGB', [value]) return unit === 'GB' ? Messages._getKey('formattedGB', [value])

@ -35,9 +35,9 @@ define([
UIElements.prettySize = function (bytes) { UIElements.prettySize = function (bytes) {
var kB = Util.bytesToKilobytes(bytes); var kB = Util.bytesToKilobytes(bytes);
if (kB < 1024) { return kB + Messages.KB; } if (kB < 1024) { return kB + Messages.KB; } // XXX replace with Msg.formattedKB ?
var mB = Util.bytesToMegabytes(bytes); var mB = Util.bytesToMegabytes(bytes);
return mB + Messages.MB; return mB + Messages.MB; // XXX replace with Msg.formattedMB
}; };
UIElements.updateTags = function (common, hrefs) { UIElements.updateTags = function (common, hrefs) {
@ -911,18 +911,22 @@ define([
}; };
var actions = { var actions = {
'bold': { 'bold': {
// Msg.mdToolbar_bold
expr: '**{0}**', expr: '**{0}**',
icon: 'fa-bold' icon: 'fa-bold'
}, },
'italic': { 'italic': {
// Msg.mdToolbar_italic
expr: '_{0}_', expr: '_{0}_',
icon: 'fa-italic' icon: 'fa-italic'
}, },
'strikethrough': { 'strikethrough': {
// Msg.mdToolbar_strikethrough
expr: '~~{0}~~', expr: '~~{0}~~',
icon: 'fa-strikethrough' icon: 'fa-strikethrough'
}, },
'heading': { 'heading': {
// Msg.mdToolbar_heading
apply: function (str) { apply: function (str) {
return '\n'+clean(str).split('\n').map(function (line) { return '\n'+clean(str).split('\n').map(function (line) {
return '# '+line; return '# '+line;
@ -931,10 +935,12 @@ define([
icon: 'fa-header' icon: 'fa-header'
}, },
'link': { 'link': {
// Msg.mdToolbar_link
expr: '[{0}](http://)', expr: '[{0}](http://)',
icon: 'fa-link' icon: 'fa-link'
}, },
'quote': { 'quote': {
// Msg.mdToolbar_quote
apply: function (str) { apply: function (str) {
return '\n\n'+str.split('\n').map(function (line) { return '\n\n'+str.split('\n').map(function (line) {
return '> '+line; return '> '+line;
@ -943,6 +949,7 @@ define([
icon: 'fa-quote-right' icon: 'fa-quote-right'
}, },
'nlist': { 'nlist': {
// Msg.mdToolbar_nlist
apply: function (str) { apply: function (str) {
return '\n'+clean(str).split('\n').map(function (line) { return '\n'+clean(str).split('\n').map(function (line) {
return '1. '+line; return '1. '+line;
@ -951,6 +958,7 @@ define([
icon: 'fa-list-ol' icon: 'fa-list-ol'
}, },
'list': { 'list': {
// Msg.mdToolbar_list
apply: function (str) { apply: function (str) {
return '\n'+clean(str).split('\n').map(function (line) { return '\n'+clean(str).split('\n').map(function (line) {
return '* '+line; return '* '+line;
@ -959,6 +967,7 @@ define([
icon: 'fa-list-ul' icon: 'fa-list-ul'
}, },
'check': { 'check': {
// Msg.mdToolbar_check
apply: function (str) { apply: function (str) {
return '\n' + clean(str).split('\n').map(function (line) { return '\n' + clean(str).split('\n').map(function (line) {
return '* [ ] ' + line; return '* [ ] ' + line;
@ -967,6 +976,7 @@ define([
icon: 'fa-check-square-o' icon: 'fa-check-square-o'
}, },
'code': { 'code': {
// Msg.mdToolbar_code
apply: function (str) { apply: function (str) {
if (str.indexOf('\n') !== -1) { if (str.indexOf('\n') !== -1) {
return '\n```\n' + clean(str) + '\n```\n'; return '\n```\n' + clean(str) + '\n```\n';
@ -976,6 +986,7 @@ define([
icon: 'fa-code' icon: 'fa-code'
}, },
'toc': { 'toc': {
// Msg.mdToolbar_toc
expr: '[TOC]', expr: '[TOC]',
icon: 'fa-newspaper-o' icon: 'fa-newspaper-o'
} }

@ -272,7 +272,7 @@
else if (bytes >= oneMegabyte) { return 'MB'; } else if (bytes >= oneMegabyte) { return 'MB'; }
}; };
Util.getPrettySize = function (bytes, Messages) { Util.getPrettySize = function (bytes, Messages) { // XXX not used anywhere?
var unit = Util.magnitudeOfBytes(bytes); var unit = Util.magnitudeOfBytes(bytes);
if (unit === 'GB') { if (unit === 'GB') {
return Messages._getKey('formattedGB', [Util.bytesToGigabytes(bytes)]); return Messages._getKey('formattedGB', [Util.bytesToGigabytes(bytes)]);

@ -310,18 +310,18 @@ define([
cache: cache cache: cache
}; };
var filesData = data.sharedFolderId && ctx.sf[data.sharedFolderId] ? ctx.sf[data.sharedFolderId].filesData : ctx.data.filesData; var filesData = data.sharedFolderId && ctx.sf[data.sharedFolderId] ? ctx.sf[data.sharedFolderId].filesData : ctx.data.filesData;
progress('reading', -1); progress('reading', -1); // Msg.settings_export_reading
nThen(function (waitFor) { nThen(function (waitFor) {
ctx.waitFor = waitFor; ctx.waitFor = waitFor;
var zipRoot = ctx.zip.folder(data.name || Messages.fm_rootName); var zipRoot = ctx.zip.folder(data.name || Messages.fm_rootName);
makeFolder(ctx, ctx.folder || ctx.data.root, zipRoot, filesData); makeFolder(ctx, ctx.folder || ctx.data.root, zipRoot, filesData);
progress('download', {}); progress('download', {}); // Msg.settings_export_download
}).nThen(function () { }).nThen(function () {
console.log(ctx.zip); console.log(ctx.zip);
console.log(ctx.errors); console.log(ctx.errors);
progress('compressing', -1); progress('compressing', -1); // Msg.settings_export_compressing
ctx.zip.generateAsync({type: 'blob'}).then(function (content) { ctx.zip.generateAsync({type: 'blob'}).then(function (content) {
progress('done', -1); progress('done', -1); // Msg.settings_export_done
cb(content, ctx.errors); cb(content, ctx.errors);
}); });
}); });

@ -86,9 +86,9 @@ define([
var content = data.content; var content = data.content;
var msg = content.msg; var msg = content.msg;
var type = Hash.parsePadUrl(msg.content.href).type; var type = Hash.parsePadUrl(msg.content.href).type;
var key = type === 'drive' ? 'notification_folderShared' : var key = type === 'drive' ? 'notification_folderShared' : // Msg.notification_folderSharedTeam
(type === 'file' ? 'notification_fileShared' : (type === 'file' ? 'notification_fileShared' : // Msg.notification_fileSharedTeam
'notification_padShared'); 'notification_padShared'); // Msg.notification_padSharedTeam
var teamNotification = /^team-/.test(data.type) && Number(data.type.slice(5)); var teamNotification = /^team-/.test(data.type) && Number(data.type.slice(5));
var teamName = ''; var teamName = '';
@ -220,7 +220,7 @@ define([
var name = Util.fixHTML(msg.content.user.displayName) || Messages.anonymous; var name = Util.fixHTML(msg.content.user.displayName) || Messages.anonymous;
var title = Util.fixHTML(msg.content.title); var title = Util.fixHTML(msg.content.title);
content.getFormatText = function() { content.getFormatText = function() {
return Messages._getKey('owner_request', [name, title]); return Messages._getKey('owner_request', [name, title]); // Msg.owner_request_accepted, .owner_request_declined
}; };
// Check authenticity // Check authenticity
@ -260,7 +260,7 @@ define([
// Display the notification // Display the notification
var name = Util.fixHTML(msg.content.user.displayName) || Messages.anonymous; var name = Util.fixHTML(msg.content.user.displayName) || Messages.anonymous;
var title = Util.fixHTML(msg.content.title); var title = Util.fixHTML(msg.content.title);
var key = 'owner_removed' + (msg.content.pending ? 'Pending' : ''); var key = 'owner_removed' + (msg.content.pending ? 'Pending' : ''); // Msg.owner_removed, owner_removedPending
content.getFormatText = function() { content.getFormatText = function() {
return Messages._getKey(key, [name, title]); return Messages._getKey(key, [name, title]);
}; };
@ -311,7 +311,7 @@ define([
var name = Util.fixHTML(msg.content.user.displayName) || Messages.anonymous; var name = Util.fixHTML(msg.content.user.displayName) || Messages.anonymous;
var teamName = Util.fixHTML(Util.find(msg, ['content', 'team', 'metadata', 'name'])  || '') || var teamName = Util.fixHTML(Util.find(msg, ['content', 'team', 'metadata', 'name'])  || '') ||
Util.fixHTML(Util.find(msg, ['content', 'teamName'])); Util.fixHTML(Util.find(msg, ['content', 'teamName']));
var key = 'team_' + (msg.content.answer ? 'accept' : 'decline') + 'Invitation'; var key = 'team_' + (msg.content.answer ? 'accept' : 'decline') + 'Invitation'; // Msg.team_acceptInvitation, team_declineInvitation
content.getFormatText = function() { content.getFormatText = function() {
return Messages._getKey(key, [name, teamName]); return Messages._getKey(key, [name, teamName]);
}; };

@ -940,9 +940,9 @@ MessengerUI, Messages) {
var todo = function (e, overLimit) { var todo = function (e, overLimit) {
if (e) { return void console.error("Unable to get the pinned usage", e); } if (e) { return void console.error("Unable to get the pinned usage", e); }
if (overLimit) { if (overLimit) {
var key = 'pinLimitReachedAlert'; var key = 'pinLimitReachedAlert'; // Msg.pinLimitReachedAlert
if (!ApiConfig.allowSubscriptions) { if (!ApiConfig.allowSubscriptions) {
key = 'pinLimitReachedAlertNoAccounts'; key = 'pinLimitReachedAlertNoAccounts'; // Msg.pinLimitReachedAlertNoAccounts
} }
$limit.show().click(function () { $limit.show().click(function () {
UI.alert(Messages._getKey(key, [encodeURIComponent(l.hostname)]), null, true); UI.alert(Messages._getKey(key, [encodeURIComponent(l.hostname)]), null, true);

Loading…
Cancel
Save