diff --git a/www/common/translations/messages.json b/www/common/translations/messages.json index 67cb97bce..32e49365d 100644 --- a/www/common/translations/messages.json +++ b/www/common/translations/messages.json @@ -1039,15 +1039,12 @@ "documentID": "Document identifier", "unableToDisplay": "Unable to display the document. Please press Esc to reload the page. If the problem persists, please contact support.", "errorPopupBlocked": "CryptPad needs to be able to open new tabs to operate. Please allow popup windows in your browser's address bar. These windows will never be used to show you advertising.", - "admin_archiveTitle": "Archive documents", "admin_archiveHint": "Make a document unavailable without deleting it permanently. It will be placed in an 'archive' directory and deleted after a few days (configurable in the server configuration file).", "admin_archiveButton": "Archive", - "admin_unarchiveTitle": "Restore documents", "admin_unarchiveHint": "Restore a document that had previously been archived", "admin_unarchiveButton": "Restore", "admin_archiveInput": "Document URL", "admin_archiveInput2": "Document password", - "admin_archiveInval": "Invalid document", "restoredFromServer": "Document restored", "archivedFromServer": "Document archived", "allowNotifications": "Allow notifications", @@ -1099,9 +1096,6 @@ "settings_colortheme_default": "System default ({0})", "settings_colorthemeHint": "Change the overall colors of CryptPad on this device.", "settings_colorthemeTitle": "Color theme", - "admin_getquotaTitle": "Check account storage", - "admin_getquotaHint": "Check the total size of items counted against a user or team's quota given their public key.", - "admin_getquotaButton": "Check", "pad_settings_title": "Document Settings", "pad_settings_info": "Default settings for this document. These will be applied when new users visit this document.", "pad_settings_width_small": "Page mode", diff --git a/www/common/translations/update.js b/www/common/translations/update.js new file mode 100644 index 000000000..fe856922a --- /dev/null +++ b/www/common/translations/update.js @@ -0,0 +1,51 @@ +var fs = require("fs"); + +//var en = require("./messages.json"); + +var others = fs.readdirSync('.').filter(name => { + return /^messages\..+\.json$/.test(name); +}); + +var suggestions = { + 'ui_restore': [ + 'admin_unarchiveButton', + 'fc_restore', + 'snapshots_restore', + 'settings_restore', + ], + ui_archive: [ + 'admin_archiveButton', + ], + ui_undefined: [ + 'owner_unknownUser', + ], + admin_documentType: [ + 'fm_type', + ], + +}; + +others.forEach(n => { + console.log(n); + var path = `./${n}`; + var content = require(path); + + Object.keys(suggestions).forEach(k => { + if (content[k]) { return; } + console.log(`${k} is not defined`); + var suggestion; + suggestions[k].some(option => { + if (typeof(content[option]) !== 'string') { return; } + console.log(`\t${option} (${content[option]}) seems like a viable candidate`); + suggestion = option; + return true; + }); + + if (!suggestion) { return; } + content[k] = content[suggestion]; + fs.writeFileSync(path, JSON.stringify(content, null, 4)); + }); + + console.log(); +}); +