From c8a3a0bd16ac9fcc87b40a856e350f0bf678ff6f Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 26 Feb 2021 16:08:04 +0530 Subject: [PATCH] annotate unusual translation keys so our script recognizes them --- customize.dist/loading.js | 2 +- scripts/unused-translations.js | 4 ++-- www/common/common-ui-elements.js | 11 +++++++++++ www/common/make-backup.js | 8 ++++---- www/common/notifications.js | 8 ++++---- www/common/toolbar.js | 4 ++-- 6 files changed, 24 insertions(+), 13 deletions(-) diff --git a/customize.dist/loading.js b/customize.dist/loading.js index 59cba470c..ff26ad6c6 100644 --- a/customize.dist/loading.js +++ b/customize.dist/loading.js @@ -25,7 +25,7 @@ define([ ].join(''); 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 makeList = function (data) { var c = types.indexOf(data.type); diff --git a/scripts/unused-translations.js b/scripts/unused-translations.js index 9c09ad54e..1ace20582 100644 --- a/scripts/unused-translations.js +++ b/scripts/unused-translations.js @@ -13,7 +13,7 @@ var ignoreLines = function (source, pattern) { }; var GENERATED_PATTERNS = [ - /(admin|settings)_.*(Hint|Title|Button)/, + /(team|admin|settings|support)_.*(Hint|Title|Button)/, /settings_colortheme/, /loading_(state|drive|pad)_/, /(admin|notifications|support|team|settings)_cat_/, @@ -75,7 +75,7 @@ var grep = function (pattern, cb) { if (/data\-localization/.test(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); } diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 50c4b34ee..c7c28bc4a 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -911,18 +911,22 @@ define([ }; var actions = { 'bold': { + // Msg.mdToolbar_bold expr: '**{0}**', icon: 'fa-bold' }, 'italic': { + // Msg.mdToolbar_italic expr: '_{0}_', icon: 'fa-italic' }, 'strikethrough': { + // Msg.mdToolbar_strikethrough expr: '~~{0}~~', icon: 'fa-strikethrough' }, 'heading': { + // Msg.mdToolbar_heading apply: function (str) { return '\n'+clean(str).split('\n').map(function (line) { return '# '+line; @@ -931,10 +935,12 @@ define([ icon: 'fa-header' }, 'link': { + // Msg.mdToolbar_link expr: '[{0}](http://)', icon: 'fa-link' }, 'quote': { + // Msg.mdToolbar_quote apply: function (str) { return '\n\n'+str.split('\n').map(function (line) { return '> '+line; @@ -943,6 +949,7 @@ define([ icon: 'fa-quote-right' }, 'nlist': { + // Msg.mdToolbar_nlist apply: function (str) { return '\n'+clean(str).split('\n').map(function (line) { return '1. '+line; @@ -951,6 +958,7 @@ define([ icon: 'fa-list-ol' }, 'list': { + // Msg.mdToolbar_list apply: function (str) { return '\n'+clean(str).split('\n').map(function (line) { return '* '+line; @@ -959,6 +967,7 @@ define([ icon: 'fa-list-ul' }, 'check': { + // Msg.mdToolbar_check apply: function (str) { return '\n' + clean(str).split('\n').map(function (line) { return '* [ ] ' + line; @@ -967,6 +976,7 @@ define([ icon: 'fa-check-square-o' }, 'code': { + // Msg.mdToolbar_code apply: function (str) { if (str.indexOf('\n') !== -1) { return '\n```\n' + clean(str) + '\n```\n'; @@ -976,6 +986,7 @@ define([ icon: 'fa-code' }, 'toc': { + // Msg.mdToolbar_toc expr: '[TOC]', icon: 'fa-newspaper-o' } diff --git a/www/common/make-backup.js b/www/common/make-backup.js index 9ba925fd7..3f66c1310 100644 --- a/www/common/make-backup.js +++ b/www/common/make-backup.js @@ -310,18 +310,18 @@ define([ cache: cache }; 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) { ctx.waitFor = waitFor; var zipRoot = ctx.zip.folder(data.name || Messages.fm_rootName); makeFolder(ctx, ctx.folder || ctx.data.root, zipRoot, filesData); - progress('download', {}); + progress('download', {}); // Msg.settings_export_download }).nThen(function () { console.log(ctx.zip); console.log(ctx.errors); - progress('compressing', -1); + progress('compressing', -1); // Msg.settings_export_compressing ctx.zip.generateAsync({type: 'blob'}).then(function (content) { - progress('done', -1); + progress('done', -1); // Msg.settings_export_done cb(content, ctx.errors); }); }); diff --git a/www/common/notifications.js b/www/common/notifications.js index caf5bfe00..b75ead287 100644 --- a/www/common/notifications.js +++ b/www/common/notifications.js @@ -86,9 +86,9 @@ define([ var content = data.content; var msg = content.msg; var type = Hash.parsePadUrl(msg.content.href).type; - var key = type === 'drive' ? 'notification_folderShared' : - (type === 'file' ? 'notification_fileShared' : - 'notification_padShared'); + var key = type === 'drive' ? 'notification_folderShared' : // Msg.notification_folderShared + (type === 'file' ? 'notification_fileShared' : // Msg.notification_fileShared + 'notification_padShared'); // Msg.notification_padShared var teamNotification = /^team-/.test(data.type) && Number(data.type.slice(5)); var teamName = ''; @@ -260,7 +260,7 @@ define([ // Display the notification var name = Util.fixHTML(msg.content.user.displayName) || Messages.anonymous; 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() { return Messages._getKey(key, [name, title]); }; diff --git a/www/common/toolbar.js b/www/common/toolbar.js index 7541cc1c6..ce17c3fcf 100644 --- a/www/common/toolbar.js +++ b/www/common/toolbar.js @@ -940,9 +940,9 @@ MessengerUI, Messages) { var todo = function (e, overLimit) { if (e) { return void console.error("Unable to get the pinned usage", e); } if (overLimit) { - var key = 'pinLimitReachedAlert'; + var key = 'pinLimitReachedAlert'; // Msg.pinLimitReachedAlert if (!ApiConfig.allowSubscriptions) { - key = 'pinLimitReachedAlertNoAccounts'; + key = 'pinLimitReachedAlertNoAccounts'; // Msg.pinLimitReachedAlertNoAccounts } $limit.show().click(function () { UI.alert(Messages._getKey(key, [encodeURIComponent(l.hostname)]), null, true);