From 2799dfef5bfbe99001113cb8f6ed23f2c8833355 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 15 May 2021 15:08:30 -0400 Subject: [PATCH] Clarify sync-to-empty-database warning Closes #1959 --- .../content/zotero/xpcom/sync/syncRunner.js | 25 +++++++++++++------ chrome/locale/en-US/zotero/zotero.properties | 3 ++- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/chrome/content/zotero/xpcom/sync/syncRunner.js b/chrome/content/zotero/xpcom/sync/syncRunner.js index 2327b5652f..5ee40e723a 100644 --- a/chrome/content/zotero/xpcom/sync/syncRunner.js +++ b/chrome/content/zotero/xpcom/sync/syncRunner.js @@ -379,25 +379,34 @@ Zotero.Sync.Runner_Module = function (options = {}) { let index = ps.confirmEx( null, Zotero.getString('general.warning'), - Zotero.getString('account.warning.emptyLibrary', [keyInfo.username, Zotero.clientName]) + "\n\n" - + Zotero.getString('account.warning.existingDataElsewhere', Zotero.clientName), + Zotero.getString( + 'account.warning.emptyLibrary', + [Zotero.clientName, OS.Path.basename(Zotero.DB.path)] + ) + "\n\n" + + Zotero.getString( + 'account.warning.emptyLibrary.dataWillBeDownloaded', + keyInfo.username + ) + + "\n\n" + + Zotero.getString( + 'account.warning.existingDataElsewhere', + Zotero.clientName + ) + + "\n\n" + + Zotero.getString('dataDir.location', Zotero.DataDirectory.dir), (ps.BUTTON_POS_0 * ps.BUTTON_TITLE_IS_STRING) + (ps.BUTTON_POS_1 * ps.BUTTON_TITLE_CANCEL) + (ps.BUTTON_POS_2 * ps.BUTTON_TITLE_IS_STRING), Zotero.getString('sync.sync'), null, - Zotero.getString('dataDir.changeDataDirectory'), + Zotero.getString('general.moreInformation'), null, {} ); if (index == 1) { return false; } else if (index == 2) { - var win = Services.wm.getMostRecentWindow("navigator:browser"); - win.openDialog("chrome://zotero/content/preferences/preferences.xul", null, null, { - pane: 'zotero-prefpane-advanced', - tabIndex: 1 - }); + Zotero.launchURL('https://www.zotero.org/support/zotero_data#locating_missing_zotero_data'); return false; } } diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties index df750824cc..20d4658eca 100644 --- a/chrome/locale/en-US/zotero/zotero.properties +++ b/chrome/locale/en-US/zotero/zotero.properties @@ -1007,7 +1007,8 @@ sync.error.invalidDataError.otherData = Other data will continue to sync. account.unlinkWarning = Unlinking your account will prevent %S from syncing your data. account.unlinkWarning.removeData = Remove my %S data from this computer account.unlinkWarning.button = Unlink Account -account.warning.emptyLibrary = You are about to sync the ‘%1$S’ account to an empty %2$S database. This could happen if you removed your previous database or if the location of your %2$S data directory changed. +account.warning.emptyLibrary = You are about to sync to an empty %1$S database. This could happen if you accidentally deleted the %2$S file in your %1$S data directory or the location of your data directory changed. +account.warning.emptyLibrary.dataWillBeDownloaded = If you continue, data in the ‘%1$S’ account will be downloaded to this computer. Your online library won’t be affected. account.warning.existingDataElsewhere = If your %S data exists elsewhere on this computer, you should move it to the current data directory or change the data directory location to point to your existing data. account.lastSyncWithDifferentAccount = This %1$S database was last synced with a different account (“%2$S”) from the one you are attempting to sync with (“%3$S”). If you continue, all %1$S libraries associated with the “%2$S” account will be removed from this computer. account.lastSyncWithDifferentAccount.beforeContinuing = Before continuing, make sure all data and files you wish to keep have been synced with the “%S” account or you have a backup of your %S data directory.