From b74e240b4d179aabe977e4ad58b9f5ad48b9a6c6 Mon Sep 17 00:00:00 2001 From: colinfruit <17092461+colinfruit@users.noreply.github.com> Date: Mon, 9 Dec 2019 21:14:25 -0500 Subject: [PATCH 1/2] language: replace upload with import terminology --- README.md | 4 +- add-on/_locales/en/messages.json | 52 +++++++++---------- add-on/src/lib/ipfs-companion.js | 10 ++-- add-on/src/popup/browser-action/page.js | 4 +- add-on/src/popup/browser-action/store.js | 6 +-- add-on/src/popup/browser-action/tools.js | 10 ++-- .../{quick-upload.css => quick-import.css} | 0 .../{quick-upload.html => quick-import.html} | 4 +- .../{quick-upload.js => quick-import.js} | 46 ++++++++-------- docs/privacy-policy.md | 2 +- test/functional/lib/ipfs-import.test.js | 2 +- webpack.config.js | 2 +- 12 files changed, 71 insertions(+), 71 deletions(-) rename add-on/src/popup/{quick-upload.css => quick-import.css} (100%) rename add-on/src/popup/{quick-upload.html => quick-import.html} (66%) rename add-on/src/popup/{quick-upload.js => quick-import.js} (84%) diff --git a/README.md b/README.md index 0cc0e4e0a..278e13669 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ The Browser Action pop-up provides handy toggles for often used operations. ### IPFS Status and Context Actions - IPFS API and Gateway status -- Add local (quick upload) or remote files (context menu) to IPFS with option to preserve filename +- Add local (quick import) or remote files (context menu) to IPFS with option to preserve filename - Easy access to [WebUI](https://github.com/ipfs/webui/) and add-on Preferences - Toggle redirection to local gateway (automatic by default, manual mode can be enabled in Preferences) - Additional actions for pages loaded from IPFS @@ -226,7 +226,7 @@ We are also available at the [#ipfs](https://webchat.freenode.net/?channels=ipfs Questions specific to this browser companion can be asked directly at [`#ipfs-in-web-browsers`](https://webchat.freenode.net/?channels=ipfs-in-web-browsers) -#### Upload via Right-Click Does Not Work in Firefox +#### Import via Right-Click Does Not Work in Firefox See [this workaround](https://github.com/ipfs/ipfs-companion/issues/227). diff --git a/add-on/_locales/en/messages.json b/add-on/_locales/en/messages.json index e762d3bb2..d86ece105 100644 --- a/add-on/_locales/en/messages.json +++ b/add-on/_locales/en/messages.json @@ -35,9 +35,9 @@ "message": "The number of other IPFS nodes you can connect to", "description": "A label tooltip in Node status section of Browser Action pop-up (panel_statusSwarmPeersTitle)" }, - "panel_quickUpload": { + "panel_quickImport": { "message": "Share files via IPFS", - "description": "A menu item in Browser Action pop-up (panel_quickUpload)" + "description": "A menu item in Browser Action pop-up (panel_quickImport)" }, "panel_openWebui": { "message": "Open Web UI", @@ -183,13 +183,13 @@ "message": "Automatic Mode: Public Gateway will be used as a fallback", "description": "A message in system notification (notify_apiOfflineAutomaticModeMsg)" }, - "notify_uploadErrorTitle": { - "message": "Unable to upload via IPFS API", - "description": "A title of system notification (notify_uploadErrorTitle)" + "notify_importErrorTitle": { + "message": "Unable to import via IPFS API", + "description": "A title of system notification (notify_importErrorTitle)" }, - "notify_uploadTrackingProtectionErrorMsg": { + "notify_importTrackingProtectionErrorMsg": { "message": "Try disabling Tracking Protection (press ctrl+shift+j for more details)", - "description": "(notify_uploadTrackingProtectionErrorMsg)" + "description": "(notify_importTrackingProtectionErrorMsg)" }, "notify_inlineMsg": { "message": "$1", @@ -483,41 +483,41 @@ "message": "Browser extension that simplifies access to IPFS resources", "description": "Extension description in the Manifest file (manifest_extensionDescription)" }, - "quickUpload_subhead_peers": { + "quickImport_subhead_peers": { "message": "Connected to $1 peers", - "description": "Partial info stats beneath the header on the share files page (quickUpload_subhead_peers)" + "description": "Partial info stats beneath the header on the share files page (quickImport_subhead_peers)" }, - "quickUpload_pick_file_button": { + "quickImport_pick_file_button": { "message": "Pick a file", - "description": "Text on the 'pick a file' button (quickUpload_pick_file_button)" + "description": "Text on the 'pick a file' button (quickImport_pick_file_button)" }, - "quickUpload_or": { + "quickImport_or": { "message": "or", - "description": "seperates the pick a file button from the drop message (quickUpload_or)" + "description": "seperates the pick a file button from the drop message (quickImport_or)" }, - "quickUpload_drop_it_here": { + "quickImport_drop_it_here": { "message": "drop it here to share", - "description": "Partial info stats beneath the header on the share files page (quickUpload_drop_it_here)" + "description": "Partial info stats beneath the header on the share files page (quickImport_drop_it_here)" }, - "quickUpload_state_uploading": { - "message": "Upload in progress..", - "description": "Status label on the share files page (quickUpload_state_uploading)" + "quickImport_state_importing": { + "message": "Import in progress..", + "description": "Status label on the share files page (quickImport_state_importing)" }, - "quickUpload_state_buffering": { + "quickImport_state_buffering": { "message": "(buffering, please wait)", - "description": "Status label on the share files page (quickUpload_state_buffering)" + "description": "Status label on the share files page (quickImport_state_buffering)" }, - "quickUpload_options_show": { + "quickImport_options_show": { "message": "import options", - "description": "Button on the share files page (quickUpload_options_show)" + "description": "Button on the share files page (quickImport_options_show)" }, - "quickUpload_options_importDir": { + "quickImport_options_importDir": { "message": "Path to store imported files", - "description": "Textbox label on the share files page (quickUpload_options_importDir)" + "description": "Textbox label on the share files page (quickImport_options_importDir)" }, - "quickUpload_options_openViaWebUI": { + "quickImport_options_openViaWebUI": { "message": "Open in Web UI", - "description": "Checkbox label on the share files page (quickUpload_options_openViaWebUI)" + "description": "Checkbox label on the share files page (quickImport_options_openViaWebUI)" }, "page_proxyAcl_title": { "message": "Manage Permissions", diff --git a/add-on/src/lib/ipfs-companion.js b/add-on/src/lib/ipfs-companion.js index 9f21bbb68..4c49cccce 100644 --- a/add-on/src/lib/ipfs-companion.js +++ b/add-on/src/lib/ipfs-companion.js @@ -266,7 +266,7 @@ module.exports = async function init () { } } - // Context Menu Uploader + // Context Menu Importer // ------------------------------------------------------------------- async function onAddFromContext (context, contextType, options) { @@ -307,15 +307,15 @@ module.exports = async function init () { result = await ipfsImportHandler.importFiles(data, options, importDir) } } catch (error) { - console.error('Error in upload to IPFS context menu', error) + console.error('Error in import to IPFS context menu', error) if (error.message === 'NetworkError when attempting to fetch resource.') { - notify('notify_uploadErrorTitle', 'notify_uploadTrackingProtectionErrorMsg') - console.warn('IPFS upload often fails because remote file can not be downloaded due to Tracking Protection. See details at: https://github.com/ipfs/ipfs-companion/issues/227') + notify('notify_importErrorTitle', 'notify_importTrackingProtectionErrorMsg') + console.warn('IPFS import often fails because remote file can not be downloaded due to Tracking Protection. See details at: https://github.com/ipfs/ipfs-companion/issues/227') browser.tabs.create({ url: 'https://github.com/ipfs/ipfs-companion/issues/227' }) } else { - notify('notify_uploadErrorTitle', 'notify_inlineErrorMsg', `${error.message}`) + notify('notify_importErrorTitle', 'notify_inlineErrorMsg', `${error.message}`) } return } diff --git a/add-on/src/popup/browser-action/page.js b/add-on/src/popup/browser-action/page.js index 6c3b28b9b..e17a10339 100644 --- a/add-on/src/popup/browser-action/page.js +++ b/add-on/src/popup/browser-action/page.js @@ -16,7 +16,7 @@ module.exports = function browserActionPage (state, emit) { const onPin = () => emit('pin') const onUnPin = () => emit('unPin') - const onQuickUpload = () => emit('quickUpload') + const onQuickImport = () => emit('quickImport') const onOpenWebUi = () => emit('openWebUi') const onOpenPrefs = () => emit('openPrefs') const onToggleGlobalRedirect = () => emit('toggleGlobalRedirect') @@ -25,7 +25,7 @@ module.exports = function browserActionPage (state, emit) { const headerProps = Object.assign({ onToggleActive, onOpenPrefs }, state) const activeTabActionsProps = Object.assign({ onViewOnGateway, onToggleSiteRedirect, onCopy, onPin, onUnPin }, state) - const opsProps = Object.assign({ onQuickUpload, onOpenWebUi, onToggleGlobalRedirect }, state) + const opsProps = Object.assign({ onQuickImport, onOpenWebUi, onToggleGlobalRedirect }, state) return html`