From 895dde83f07e7dcf00d0df2c240369cae63f76cb Mon Sep 17 00:00:00 2001 From: Jens Baumgart Date: Thu, 8 Apr 2010 16:00:10 +0200 Subject: [PATCH] Externalize strings / add NON-NLS comments for technical strings All translatable strings in the EGit UI plugin were externalized. Technical strings were marked with the NON-NLS comment. Change-Id: I79d1ed11b96a244d5810b645107930555ab6034f Signed-off-by: Jens Baumgart --- .../src/org/eclipse/egit/ui/Activator.java | 12 +- .../src/org/eclipse/egit/ui/UIIcons.java | 4 +- .../src/org/eclipse/egit/ui/UIText.java | 228 ++++++++++++++++++++- .../GitCompareFileRevisionEditorInput.java | 6 +- .../egit/ui/internal/actions/BranchAction.java | 14 +- .../egit/ui/internal/actions/CommitAction.java | 29 +-- .../internal/actions/CompareWithIndexAction.java | 5 +- .../actions/QuickdiffBaselineOperation.java | 6 +- .../egit/ui/internal/actions/RepositoryAction.java | 9 +- .../egit/ui/internal/actions/ResetAction.java | 11 +- .../egit/ui/internal/clone/GitCloneWizard.java | 4 +- .../ui/internal/components/RefContentProposal.java | 43 ++-- .../components/RepositorySelectionPage.java | 4 +- .../egit/ui/internal/decorators/GitDocument.java | 22 +- .../egit/ui/internal/dialogs/CommitDialog.java | 2 +- .../ui/internal/history/CommitMessageViewer.java | 61 +++--- .../internal/history/FileDiffContentProvider.java | 6 +- .../ui/internal/history/GenerateHistoryJob.java | 2 +- .../egit/ui/internal/history/GitHistoryPage.java | 16 +- .../repository/RepositorySearchDialog.java | 11 +- .../src/org/eclipse/egit/ui/uitext.properties | 87 +++++++- 21 files changed, 466 insertions(+), 116 deletions(-) diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java index 9d7e7ce3..eeded221 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java @@ -214,7 +214,7 @@ public class Activator extends AbstractUIPlugin { static class RIRefresh extends Job implements RepositoryListener { RIRefresh() { - super("Git index refresh Job"); + super(UIText.Activator_refreshJobName); } private Set projectsToScan = new LinkedHashSet(); @@ -222,7 +222,7 @@ public class Activator extends AbstractUIPlugin { @Override protected IStatus run(IProgressMonitor monitor) { IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); - monitor.beginTask("Refreshing git managed projects", projects.length); + monitor.beginTask(UIText.Activator_refreshingProjects, projects.length); while (projectsToScan.size() > 0) { IProject p; @@ -238,7 +238,7 @@ public class Activator extends AbstractUIPlugin { getJobManager().beginRule(rule, monitor); p.refreshLocal(IResource.DEPTH_INFINITE, new SubProgressMonitor(monitor, 1)); } catch (CoreException e) { - logError("Failed to refresh projects from index changes", e); + logError(UIText.Activator_refreshFailed, e); return new Status(IStatus.ERROR, getPluginId(), e.getMessage()); } finally { getJobManager().endRule(rule); @@ -277,7 +277,7 @@ public class Activator extends AbstractUIPlugin { static class RCS extends Job { RCS() { - super("Repository Change Scanner"); + super(UIText.Activator_repoScanJobName); } // FIXME, need to be more intelligent about this to avoid too much work @@ -297,7 +297,7 @@ public class Activator extends AbstractUIPlugin { // repositories. We discard that as being ugly and stupid for // the moment. IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); - monitor.beginTask("Scanning Git repositories for changes", projects.length); + monitor.beginTask(UIText.Activator_scanningRepositories, projects.length); Set scanned = new HashSet(); for (IProject p : projects) { RepositoryMapping mapping = RepositoryMapping.getMapping(p); @@ -341,7 +341,7 @@ public class Activator extends AbstractUIPlugin { IStatus.ERROR, getPluginId(), 0, - "An error occurred while scanning for changes. Scanning aborted", + UIText.Activator_scanError, e); } return Status.OK_STATUS; diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIIcons.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIIcons.java index 2afc905c..0a83187d 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIIcons.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIIcons.java @@ -152,7 +152,7 @@ public class UIIcons { try { return ImageDescriptor.createFromURL(new URL(base, icon)); } catch (MalformedURLException mux) { - Activator.logError("Can't load plugin image.", mux); + Activator.logError(UIText.UIIcons_errorLoadingPluginImage, mux); } } return ImageDescriptor.getMissingImageDescriptor(); @@ -163,7 +163,7 @@ public class UIIcons { return new URL(Activator.getDefault().getBundle().getEntry("/"), //$NON-NLS-1$ "icons/"); //$NON-NLS-1$ } catch (MalformedURLException mux) { - Activator.logError("Can't determine icon base.", mux); + Activator.logError(UIText.UIIcons_errorDeterminingIconBase, mux); return null; } } diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java index 6b54e47c..5ecb2dda 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/UIText.java @@ -22,6 +22,24 @@ public class UIText extends NLS { public static String WizardProjectsImportPage_filterText; /** */ + public static String Activator_refreshFailed; + + /** */ + public static String Activator_refreshingProjects; + + /** */ + public static String Activator_refreshJobName; + + /** */ + public static String Activator_repoScanJobName; + + /** */ + public static String Activator_scanError; + + /** */ + public static String Activator_scanningRepositories; + + /** */ public static String AddToIndexAction_addingFilesFailed; /** */ @@ -94,6 +112,9 @@ public class UIText extends NLS { public static String SharingWizard_failed; /** */ + public static String GenerateHistoryJob_errorComputingHistory; + + /** */ public static String GenericOperationFailed; /** */ @@ -124,6 +145,12 @@ public class UIText extends NLS { public static String ExistingOrNewPage_SymbolicValueEmptyMapping; /** */ + public static String GitCloneWizard_abortingCloneMsg; + + /** */ + public static String GitCloneWizard_abortingCloneTitle; + + /** */ public static String GitCloneWizard_CloneFailedHeading; /** */ @@ -145,15 +172,39 @@ public class UIText extends NLS { public static String GitDecoratorPreferencePage_bindingRepositoryNameFlag; /** */ + public static String GitDocument_errorLoadCommit; + + /** */ + public static String GitDocument_errorLoadTree; + + /** */ + public static String GitDocument_errorRefreshQuickdiff; + + /** */ + public static String GitDocument_errorResolveQuickdiff; + + /** */ public static String GitHistoryPage_CompareVersions; /** */ public static String GitHistoryPage_CompareWithWorking; /** */ + public static String GitHistoryPage_errorLookingUpPath; + + /** */ + public static String GitHistoryPage_errorParsingHead; + + /** */ + public static String GitHistoryPage_errorReadingHeadCommit; + + /** */ public static String GitHistoryPage_FileNotInCommit; /** */ + public static String GitHistoryPage_find; + + /** */ public static String GitProjectPropertyPage_LabelBranch; /** */ @@ -211,31 +262,46 @@ public class UIText extends NLS { public static String RepositoryRemotePropertySource_RemotePushUrl_label; /** */ - public static String RepositorySearchDialog_BrowseButton; + public static String RepositorySearchDialog_DeepSearch_button; /** */ - public static String RepositorySearchDialog_DeepSearch_button; + public static String RepositorySearchDialog_RepositoriesFound_message; /** */ - public static String RepositorySearchDialog_DirectoryLabel; + public static String RepositorySearchDialog_ScanningForRepositories_message; /** */ - public static String RepositorySearchDialog_ErrorHeader; + public static String RepositorySearchDialog_SearchRepositoriesHeader; /** */ - public static String RepositorySearchDialog_RepositoriesFound_message; + public static String RepositorySearchDialog_ToggleSelection_button; /** */ - public static String RepositorySearchDialog_ScanningForRepositories_message; + public static String RepositoryAction_errorFindingRepo; /** */ - public static String RepositorySearchDialog_SearchButton; + public static String RepositoryAction_errorFindingRepoTitle; /** */ - public static String RepositorySearchDialog_SearchRepositoriesHeader; + public static String RepositoryAction_multiRepoSelection; /** */ - public static String RepositorySearchDialog_ToggleSelection_button; + public static String RepositoryAction_multiRepoSelectionTitle; + + /** */ + public static String RepositorySearchDialog_browse; + + /** */ + public static String RepositorySearchDialog_directory; + + /** */ + public static String RepositorySearchDialog_errorOccurred; + + /** */ + public static String RepositorySearchDialog_search; + + /** */ + public static String RepositorySearchDialog_searchRepositories; /** */ public static String RepositorySelectionPage_BrowseLocalFile; @@ -298,6 +364,9 @@ public class UIText extends NLS { public static String RepositorySelectionPage_configuredRemoteChoice; /** */ + public static String RepositorySelectionPage_errorValidating; + + /** */ public static String RepositorySelectionPage_ShowPreviousURIs_HoverText; /** */ @@ -370,6 +439,33 @@ public class UIText extends NLS { public static String CloneDestinationPage_importProjectsAfterClone; /** */ + public static String RefContentProposal_blob; + + /** */ + public static String RefContentProposal_branch; + + /** */ + public static String RefContentProposal_by; + + /** */ + public static String RefContentProposal_commit; + + /** */ + public static String RefContentProposal_errorReadingObject; + + /** */ + public static String RefContentProposal_tag; + + /** */ + public static String RefContentProposal_trackingBranch; + + /** */ + public static String RefContentProposal_tree; + + /** */ + public static String RefContentProposal_unknownObject; + + /** */ public static String RefSpecPanel_refChooseSome; /** */ @@ -595,6 +691,18 @@ public class UIText extends NLS { public static String QuickDiff_failedLoading; /** */ + public static String QuickdiffBaselineOperation_baseline; + + /** */ + public static String ResetAction_errorResettingHead; + + /** */ + public static String ResetAction_repositoryState; + + /** */ + public static String ResetAction_resetFailed; + + /** */ public static String ResourceHistory_toggleCommentWrap; /** */ @@ -709,6 +817,45 @@ public class UIText extends NLS { public static String PushWizard_windowTitleWithDestination; /** */ + public static String CommitAction_amendCommit; + + /** */ + public static String CommitAction_amendNotPossible; + + /** */ + public static String CommitAction_cannotCommit; + + /** */ + public static String CommitAction_errorCommittingChanges; + + /** */ + public static String CommitAction_errorComputingDiffs; + + /** */ + public static String CommitAction_errorDuringCommit; + + /** */ + public static String CommitAction_errorOnCommit; + + /** */ + public static String CommitAction_errorPreparingTrees; + + /** */ + public static String CommitAction_errorRetrievingCommit; + + /** */ + public static String CommitAction_errorWritingTrees; + + /** */ + public static String CommitAction_failedToUpdate; + + /** */ + public static String CommitAction_noFilesToCommit; + + /** */ + public static String CommitAction_repositoryState; + + /** */ public static String CommitDialog_AddFileOnDiskToIndex; /** */ @@ -760,6 +907,9 @@ public class UIText extends NLS { public static String CommitDialog_File; /** */ + public static String CommitDialog_problemFindingFileStatus; + + /** */ public static String CommitDialog_SelectAll; /** */ @@ -817,6 +967,42 @@ public class UIText extends NLS { public static String CommitDialog_ValueHelp_Message; /** */ + public static String CommitMessageViewer_author; + + /** */ + public static String CommitMessageViewer_child; + + /** */ + public static String CommitMessageViewer_commit; + + /** */ + public static String CommitMessageViewer_committer; + + /** */ + public static String CommitMessageViewer_deletedFileMode; + + /** */ + public static String CommitMessageViewer_errorGettingFileDifference; + + /** */ + public static String CommitMessageViewer_index; + + /** */ + public static String CommitMessageViewer_newFileMode; + + /** */ + public static String CommitMessageViewer_newMode; + + /** */ + public static String CommitMessageViewer_oldMode; + + /** */ + public static String CommitMessageViewer_parent; + + /** */ + public static String CompareWithIndexAction_errorOnAddToIndex; + + /** */ public static String ConfirmationPage_cantConnectToAnyTitle; /** */ @@ -1003,6 +1189,9 @@ public class UIText extends NLS { public static String FetchWizard_windowTitleWithSource; /** */ + public static String FileDiffContentProvider_errorGettingDifference; + + /** */ public static String WindowCachePreferencePage_title; /** */ @@ -1018,6 +1207,18 @@ public class UIText extends NLS { public static String WindowCachePreferencePage_packedGitMMAP; /** */ + public static String BranchAction_cannotCheckout; + + /** */ + public static String BranchAction_errorSwitchingBranches; + + /** */ + public static String BranchAction_repositoryState; + + /** */ + public static String BranchAction_unableToSwitchBranches; + + /** */ public static String BranchSelectionDialog_TitleCheckout; /** */ @@ -1350,6 +1551,15 @@ public class UIText extends NLS { /** */ public static String DiscardChangesAction_refreshErrorMessage; + /** */ + public static String GitCompareFileRevisionEditorInput_contentIdentifier; + + /** */ + public static String UIIcons_errorDeterminingIconBase; + + /** */ + public static String UIIcons_errorLoadingPluginImage; + static { initializeMessages("org.eclipse.egit.ui.uitext", UIText.class); //$NON-NLS-1$ } diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/GitCompareFileRevisionEditorInput.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/GitCompareFileRevisionEditorInput.java index 9ef715af..8f101cea 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/GitCompareFileRevisionEditorInput.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/GitCompareFileRevisionEditorInput.java @@ -28,6 +28,7 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.egit.core.Activator; +import org.eclipse.egit.ui.UIText; import org.eclipse.osgi.util.NLS; import org.eclipse.team.internal.core.history.LocalFileRevision; import org.eclipse.team.internal.ui.TeamUIMessages; @@ -334,7 +335,10 @@ public class GitCompareFileRevisionEditorInput extends SaveableCompareEditorInpu return TeamUIMessages.CompareFileRevisionEditorInput_1; } } catch (CoreException e) { - Activator.logError("Problem getting content identifier", e); + Activator + .logError( + UIText.GitCompareFileRevisionEditorInput_contentIdentifier, + e); } } else { return fileRevisionElement.getContentIdentifier(); diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/BranchAction.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/BranchAction.java index cc949c27..d954efe2 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/BranchAction.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/BranchAction.java @@ -16,12 +16,14 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.egit.core.internal.trace.GitTraceLocation; import org.eclipse.egit.core.op.BranchOperation; +import org.eclipse.egit.ui.UIText; import org.eclipse.egit.ui.internal.decorators.GitLightweightDecorator; import org.eclipse.egit.ui.internal.dialogs.BranchSelectionDialog; import org.eclipse.jface.action.IAction; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.osgi.util.NLS; import org.eclipse.swt.widgets.Display; import org.eclipse.jgit.lib.Repository; @@ -38,9 +40,10 @@ public class BranchAction extends RepositoryAction { return; if (!repository.getRepositoryState().canCheckout()) { - MessageDialog.openError(getShell(), "Cannot checkout now", - "Repository state:" - + repository.getRepositoryState().getDescription()); + MessageDialog.openError(getShell(), + UIText.BranchAction_cannotCheckout, NLS.bind( + UIText.BranchAction_repositoryState, repository + .getRepositoryState().getDescription())); return; } @@ -64,7 +67,10 @@ public class BranchAction extends RepositoryAction { GitTraceLocation.getTrace().trace(GitTraceLocation.CORE.getLocation(), e.getMessage(), e); Display.getDefault().asyncExec(new Runnable() { public void run() { - handle(e, "Error while switching branches", "Unable to switch branches"); + handle( + e, + UIText.BranchAction_errorSwitchingBranches, + UIText.BranchAction_unableToSwitchBranches); } }); } diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CommitAction.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CommitAction.java index 59d45e02..89034962 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CommitAction.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CommitAction.java @@ -27,6 +27,7 @@ import org.eclipse.core.resources.IResource; import org.eclipse.egit.core.internal.trace.GitTraceLocation; import org.eclipse.egit.core.project.GitProjectData; import org.eclipse.egit.core.project.RepositoryMapping; +import org.eclipse.egit.ui.UIText; import org.eclipse.egit.ui.internal.dialogs.CommitDialog; import org.eclipse.jface.action.IAction; import org.eclipse.jface.dialogs.IDialogConstants; @@ -46,6 +47,7 @@ import org.eclipse.jgit.lib.RepositoryConfig; import org.eclipse.jgit.lib.Tree; import org.eclipse.jgit.lib.TreeEntry; import org.eclipse.jgit.lib.GitIndex.Entry; +import org.eclipse.osgi.util.NLS; /** * Scan for modified resources in the same project as the selected resources. @@ -67,7 +69,7 @@ public class CommitAction extends RepositoryAction { try { buildIndexHeadDiffList(); } catch (IOException e) { - Utils.handleError(getTargetPart().getSite().getShell(), e, "Error during commit", "Error occurred computing diffs"); + Utils.handleError(getTargetPart().getSite().getShell(), e, UIText.CommitAction_errorDuringCommit, UIText.CommitAction_errorComputingDiffs); return; } @@ -78,8 +80,8 @@ public class CommitAction extends RepositoryAction { repository = repo; if (!repo.getRepositoryState().canCommit()) { MessageDialog.openError(getTargetPart().getSite().getShell(), - "Cannot commit now", "Repository state:" - + repo.getRepositoryState().getDescription()); + UIText.CommitAction_cannotCommit, + NLS.bind(UIText.CommitAction_repositoryState, repo.getRepositoryState().getDescription())); return; } } @@ -89,13 +91,13 @@ public class CommitAction extends RepositoryAction { if (amendAllowed && previousCommit != null) { boolean result = MessageDialog .openQuestion(getTargetPart().getSite().getShell(), - "No files to commit", - "No changed items were selected. Do you wish to amend the last commit?"); + UIText.CommitAction_noFilesToCommit, + UIText.CommitAction_amendCommit); if (!result) return; amending = true; } else { - MessageDialog.openWarning(getTargetPart().getSite().getShell(), "No files to commit", "Commit/amend not possible. Possible causes:\n\n- No changed items were selected\n- Multiple repositories selected\n- No repositories selected\n- No previous commits"); + MessageDialog.openWarning(getTargetPart().getSite().getShell(), UIText.CommitAction_noFilesToCommit, UIText.CommitAction_amendNotPossible); return; } } @@ -134,7 +136,7 @@ public class CommitAction extends RepositoryAction { try { performCommit(commitDialog, commitMessage); } catch (TeamException e) { - Utils.handleError(getTargetPart().getSite().getShell(), e, "Error during commit", "Error occurred while committing"); + Utils.handleError(getTargetPart().getSite().getShell(), e, UIText.CommitAction_errorDuringCommit, UIText.CommitAction_errorOnCommit); } } @@ -155,7 +157,7 @@ public class CommitAction extends RepositoryAction { if (parentId != null) previousCommit = repo.mapCommit(parentId); } catch (IOException e) { - Utils.handleError(getTargetPart().getSite().getShell(), e, "Error during commit", "Error occurred retrieving last commit"); + Utils.handleError(getTargetPart().getSite().getShell(), e, UIText.CommitAction_errorDuringCommit, UIText.CommitAction_errorRetrievingCommit); } } @@ -168,13 +170,13 @@ public class CommitAction extends RepositoryAction { try { prepareTrees(selectedItems, treeMap); } catch (IOException e) { - throw new TeamException("Preparing trees", e); + throw new TeamException(UIText.CommitAction_errorPreparingTrees, e); } try { doCommits(commitDialog, commitMessage, treeMap); } catch (IOException e) { - throw new TeamException("Committing changes", e); + throw new TeamException(UIText.CommitAction_errorCommittingChanges, e); } for (IProject proj : getProjectsForSelectedResources()) { RepositoryMapping.getMapping(proj).fireRepositoryChanged(); @@ -220,8 +222,9 @@ public class CommitAction extends RepositoryAction { ru.setNewObjectId(commit.getCommitId()); ru.setRefLogMessage(buildReflogMessage(commitMessage), false); if (ru.forceUpdate() == RefUpdate.Result.LOCK_FAILURE) { - throw new TeamException("Failed to update " + ru.getName() - + " to commit " + commit.getCommitId() + "."); + throw new TeamException( + NLS.bind(UIText.CommitAction_failedToUpdate, ru.getName(), + commit.getCommitId())); } } } @@ -339,7 +342,7 @@ public class CommitAction extends RepositoryAction { ObjectWriter writer = new ObjectWriter(tree.getRepository()); tree.setId(writer.writeTree(tree)); } catch (IOException e) { - throw new TeamException("Writing trees", e); + throw new TeamException(UIText.CommitAction_errorWritingTrees, e); } } } diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexAction.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexAction.java index 8956463d..0913228f 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexAction.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexAction.java @@ -20,6 +20,7 @@ import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; import org.eclipse.egit.core.internal.storage.GitFileRevision; import org.eclipse.egit.core.project.RepositoryMapping; +import org.eclipse.egit.ui.UIText; import org.eclipse.egit.ui.internal.EditableRevision; import org.eclipse.egit.ui.internal.GitCompareFileRevisionEditorInput; import org.eclipse.jface.action.IAction; @@ -61,8 +62,8 @@ public class CompareWithIndexAction extends RepositoryAction { index.write(); } catch (IOException e) { Utils.handleError(getTargetPart().getSite().getShell(), e, - "Error during adding to index", - "Error during adding to index"); + UIText.CompareWithIndexAction_errorOnAddToIndex, + UIText.CompareWithIndexAction_errorOnAddToIndex); return; } } diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/QuickdiffBaselineOperation.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/QuickdiffBaselineOperation.java index 0364bbfa..29601f25 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/QuickdiffBaselineOperation.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/QuickdiffBaselineOperation.java @@ -13,6 +13,7 @@ import java.io.IOException; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.egit.ui.Activator; +import org.eclipse.egit.ui.UIText; import org.eclipse.egit.ui.internal.decorators.GitQuickDiffProvider; import org.eclipse.jgit.lib.Repository; @@ -38,7 +39,10 @@ public class QuickdiffBaselineOperation extends AbstractRevObjectOperation { try { GitQuickDiffProvider.setBaselineReference(repository, baseline); } catch (IOException e) { - Activator.logError("Cannot set quickdiff baseline", e); + Activator + .logError( + UIText.QuickdiffBaselineOperation_baseline, + e); } } diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryAction.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryAction.java index c3f418f3..687ee62f 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryAction.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryAction.java @@ -17,6 +17,7 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.egit.core.project.RepositoryMapping; +import org.eclipse.egit.ui.UIText; import org.eclipse.jface.action.IAction; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.team.internal.ui.actions.TeamAction; @@ -103,13 +104,17 @@ public abstract class RepositoryAction extends TeamAction { return null; if (mapping.getRepository() != repositoryMapping.getRepository()) { if (warn) - MessageDialog.openError(getShell(), "Multiple Repositories Selection", "Cannot perform reset on multiple repositories simultaneously.\n\nPlease select items from only one repository."); + MessageDialog.openError(getShell(), + UIText.RepositoryAction_multiRepoSelectionTitle, + UIText.RepositoryAction_multiRepoSelection); return null; } } if (mapping == null) { if (warn) - MessageDialog.openError(getShell(), "Cannot Find Repository", "Could not find a repository associated with this project"); + MessageDialog.openError(getShell(), + UIText.RepositoryAction_errorFindingRepoTitle, + UIText.RepositoryAction_errorFindingRepo); return null; } diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ResetAction.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ResetAction.java index 2b264aff..c5c67e64 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ResetAction.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/ResetAction.java @@ -17,6 +17,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.egit.core.internal.trace.GitTraceLocation; import org.eclipse.egit.core.op.ResetOperation; import org.eclipse.egit.core.op.ResetOperation.ResetType; +import org.eclipse.egit.ui.UIText; import org.eclipse.egit.ui.internal.decorators.GitLightweightDecorator; import org.eclipse.egit.ui.internal.dialogs.BranchSelectionDialog; import org.eclipse.jface.action.IAction; @@ -24,6 +25,7 @@ import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jgit.lib.Repository; +import org.eclipse.osgi.util.NLS; /** * An action to reset the current branch to a specific revision. @@ -39,9 +41,8 @@ public class ResetAction extends RepositoryAction { return; if (!repository.getRepositoryState().canResetHead()) { - MessageDialog.openError(getShell(), "Cannot reset HEAD now", - "Repository state:" - + repository.getRepositoryState().getDescription()); + MessageDialog.openError(getShell(), UIText.ResetAction_errorResettingHead, + NLS.bind(UIText.ResetAction_repositoryState, repository.getRepositoryState().getDescription())); return; } @@ -66,9 +67,9 @@ public class ResetAction extends RepositoryAction { } }); } catch (InvocationTargetException e) { - MessageDialog.openError(getShell(),"Reset failed", e.getMessage()); + MessageDialog.openError(getShell(),UIText.ResetAction_resetFailed, e.getMessage()); } catch (InterruptedException e) { - MessageDialog.openError(getShell(),"Reset failed", e.getMessage()); + MessageDialog.openError(getShell(),UIText.ResetAction_resetFailed, e.getMessage()); } } diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCloneWizard.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCloneWizard.java index 3fd8746c..7d1ae2bd 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCloneWizard.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/GitCloneWizard.java @@ -77,8 +77,8 @@ public class GitCloneWizard extends Wizard implements IImportWizard { public boolean performCancel() { if (cloneDestination.alreadyClonedInto != null) { if (MessageDialog - .openQuestion(getShell(), "Aborting clone.", - "A complete clone was already made. Do you want to delete it?")) { + .openQuestion(getShell(), UIText.GitCloneWizard_abortingCloneTitle, + UIText.GitCloneWizard_abortingCloneMsg)) { deleteRecursively(new File(cloneDestination.alreadyClonedInto)); } } diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefContentProposal.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefContentProposal.java index 7c615ae3..6fa71f19 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefContentProposal.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefContentProposal.java @@ -12,6 +12,7 @@ import java.io.IOException; import java.sql.Blob; import org.eclipse.egit.ui.Activator; +import org.eclipse.egit.ui.UIText; import org.eclipse.jface.fieldassist.IContentProposal; import org.eclipse.jgit.lib.Commit; import org.eclipse.jgit.lib.Constants; @@ -21,6 +22,7 @@ import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.lib.Tag; import org.eclipse.jgit.lib.Tree; +import org.eclipse.osgi.util.NLS; /** * Content proposal class for refs names, specifically Ref objects - name with @@ -35,16 +37,31 @@ public class RefContentProposal implements IContentProposal { private static final String PREFIXES[] = new String[] { Constants.R_HEADS, Constants.R_REMOTES, Constants.R_TAGS }; + private final static String branchPF = " [" //$NON-NLS-1$ + + UIText.RefContentProposal_branch + + "]"; //$NON-NLS-1$ + + private final static String trackingBranchPF = " [" //$NON-NLS-1$ + + UIText.RefContentProposal_trackingBranch + + "]"; //$NON-NLS-1$ + + private final static String tagPF = " [" //$NON-NLS-1$ + + UIText.RefContentProposal_tag + + "]"; //$NON-NLS-1$ + private static final String PREFIXES_DESCRIPTIONS[] = new String[] { - " [branch]", " [tracking branch]", " [tag]" }; + branchPF, trackingBranchPF, tagPF }; private static void appendObjectSummary(final StringBuilder sb, final String type, final PersonIdent author, final String message) { - sb.append(type + " by "); + sb.append(type); + sb.append(" "); //$NON-NLS-1$ + sb.append(UIText.RefContentProposal_by); + sb.append(" "); //$NON-NLS-1$ sb.append(author.getName()); - sb.append("\n"); + sb.append("\n"); //$NON-NLS-1$ sb.append(author.getWhen()); - sb.append("\n\n"); + sb.append("\n\n"); //$NON-NLS-1$ final int newLine = message.indexOf('\n'); final int last = (newLine != -1 ? newLine : message.length()); sb.append(message.substring(0, last)); @@ -104,8 +121,8 @@ public class RefContentProposal implements IContentProposal { try { obj = db.mapObject(objectId, refName); } catch (IOException e) { - Activator.logError("Unable to read object " + objectId - + " for content proposal assistance", e); + Activator.logError(NLS.bind( + UIText.RefContentProposal_errorReadingObject, objectId), e); return null; } @@ -113,19 +130,21 @@ public class RefContentProposal implements IContentProposal { sb.append(refName); sb.append('\n'); sb.append(objectId.abbreviate(db).name()); - sb.append(" - "); + sb.append(" - "); //$NON-NLS-1$ if (obj instanceof Commit) { final Commit c = ((Commit) obj); - appendObjectSummary(sb, "commit", c.getAuthor(), c.getMessage()); + appendObjectSummary(sb, UIText.RefContentProposal_commit, c + .getAuthor(), c.getMessage()); } else if (obj instanceof Tag) { final Tag t = ((Tag) obj); - appendObjectSummary(sb, "tag", t.getAuthor(), t.getMessage()); + appendObjectSummary(sb, UIText.RefContentProposal_tag, t + .getAuthor(), t.getMessage()); } else if (obj instanceof Tree) { - sb.append("tree"); + sb.append(UIText.RefContentProposal_tree); } else if (obj instanceof Blob) { - sb.append("blob"); + sb.append(UIText.RefContentProposal_blob); } else - sb.append("locally unknown object"); + sb.append(UIText.RefContentProposal_unknownObject); return sb.toString(); } diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java index 71f52a98..62ada1a0 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java @@ -693,7 +693,9 @@ public class RepositorySelectionPage extends BaseWizardPage { selectionIncomplete(e.getReason()); return; } catch (Exception e) { - Activator.logError("Error validating " + getClass().getName(), + Activator.logError(NLS.bind( + UIText.RepositorySelectionPage_errorValidating, + getClass().getName()), e); selectionIncomplete(UIText.RepositorySelectionPage_internalError); return; diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitDocument.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitDocument.java index b5e238ea..14f572fd 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitDocument.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitDocument.java @@ -19,6 +19,7 @@ import org.eclipse.egit.core.GitProvider; import org.eclipse.egit.core.internal.trace.GitTraceLocation; import org.eclipse.egit.core.project.RepositoryMapping; import org.eclipse.egit.ui.Activator; +import org.eclipse.egit.ui.UIText; import org.eclipse.jface.text.Document; import org.eclipse.team.core.RepositoryProvider; import org.eclipse.jgit.lib.AnyObjectId; @@ -32,6 +33,7 @@ import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.lib.RepositoryListener; import org.eclipse.jgit.lib.Tree; import org.eclipse.jgit.lib.TreeEntry; +import org.eclipse.osgi.util.NLS; class GitDocument extends Document implements RepositoryListener { private final IResource resource; @@ -111,17 +113,17 @@ class GitDocument extends Document implements RepositoryListener { return; } } else { - Activator.logError("Could not resolve quickdiff baseline " - + baseline + " corresponding to " + resource + " in " - + repository, new Throwable()); + String msg = NLS.bind(UIText.GitDocument_errorResolveQuickdiff, + new Object[] { baseline, resource, repository }); + Activator.logError(msg, new Throwable()); setResolved(null, null, null, ""); //$NON-NLS-1$ return; } Commit baselineCommit = repository.mapCommit(commitId); if (baselineCommit == null) { - Activator.logError("Could not load commit " + commitId + " for " - + baseline + " corresponding to " + resource + " in " - + repository, new Throwable()); + String msg = NLS.bind(UIText.GitDocument_errorLoadCommit, + new Object[] { commitId, baseline, resource, repository }); + Activator.logError(msg, new Throwable()); setResolved(null, null, null, ""); //$NON-NLS-1$ return; } @@ -136,9 +138,9 @@ class GitDocument extends Document implements RepositoryListener { } Tree baselineTree = baselineCommit.getTree(); if (baselineTree == null) { - Activator.logError("Could not load tree " + treeId + " for " - + baseline + " corresponding to " + resource + " in " - + repository, new Throwable()); + String msg = NLS.bind(UIText.GitDocument_errorLoadTree, + new Object[] { treeId, baseline, resource, repository }); + Activator.logError(msg, new Throwable()); setResolved(null, null, null, ""); //$NON-NLS-1$ return; } @@ -204,7 +206,7 @@ class GitDocument extends Document implements RepositoryListener { try { populate(); } catch (IOException e1) { - Activator.logError("Failed to refresh quickdiff", e1); + Activator.logError(UIText.GitDocument_errorRefreshQuickdiff, e1); } } diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java index f34de380..76b7a1d3 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java @@ -465,7 +465,7 @@ public class CommitDialog extends Dialog { } } catch (Exception e) { - Activator.logError("Problem in finding file status", e); + Activator.logError(UIText.CommitDialog_problemFindingFileStatus, e); prefix = e.getMessage(); } diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitMessageViewer.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitMessageViewer.java index 6c4f6510..40bed0ac 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitMessageViewer.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitMessageViewer.java @@ -20,6 +20,7 @@ import java.util.regex.Pattern; import org.eclipse.core.runtime.ListenerList; import org.eclipse.egit.ui.Activator; import org.eclipse.egit.ui.UIPreferences; +import org.eclipse.egit.ui.UIText; import org.eclipse.jface.text.DefaultTextDoubleClickStrategy; import org.eclipse.jface.text.Document; import org.eclipse.jface.text.IDocument; @@ -38,6 +39,7 @@ import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.revplot.PlotCommit; import org.eclipse.jgit.revwalk.RevCommit; import org.eclipse.jgit.treewalk.TreeWalk; +import org.eclipse.osgi.util.NLS; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.StyleRange; import org.eclipse.swt.custom.StyledText; @@ -73,6 +75,12 @@ class CommitMessageViewer extends TextViewer implements ISelectionChangedListene private DiffFormatter diffFmt = new DiffFormatter(); + private static final String SPACE = " "; //$NON-NLS-1$ + + private static final String LF = "\n"; //$NON-NLS-1$ + + private static final String EMPTY = ""; //$NON-NLS-1$ + CommitMessageViewer(final Composite parent) { super(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.READ_ONLY); fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //$NON-NLS-1$ @@ -158,52 +166,57 @@ class CommitMessageViewer extends TextViewer implements ISelectionChangedListene final StringBuilder d = new StringBuilder(); final ArrayList styles = new ArrayList(); - d.append("commit "); + d.append(UIText.CommitMessageViewer_commit); + d.append(SPACE); d.append(commit.getId().name()); - d.append("\n"); //$NON-NLS-1$ + d.append(LF); if (author != null) { - d.append("Author: "); + d.append(UIText.CommitMessageViewer_author); + d.append(": "); //$NON-NLS-1$ d.append(author.getName()); d.append(" <"); //$NON-NLS-1$ d.append(author.getEmailAddress()); d.append("> "); //$NON-NLS-1$ d.append(fmt.format(author.getWhen())); - d.append("\n"); //$NON-NLS-1$ + d.append(LF); } if (committer != null) { - d.append("Committer: "); + d.append(UIText.CommitMessageViewer_committer); + d.append(": "); //$NON-NLS-1$ d.append(committer.getName()); d.append(" <"); //$NON-NLS-1$ d.append(committer.getEmailAddress()); d.append("> "); //$NON-NLS-1$ d.append(fmt.format(committer.getWhen())); - d.append("\n"); //$NON-NLS-1$ + d.append(LF); } for (int i = 0; i < commit.getParentCount(); i++) { final RevCommit p = commit.getParent(i); - d.append("Parent: "); + d.append(UIText.CommitMessageViewer_parent); + d.append(": "); //$NON-NLS-1$ addLink(d, styles, p); d.append(" ("); //$NON-NLS-1$ d.append(p.getShortMessage()); d.append(")"); //$NON-NLS-1$ - d.append("\n"); //$NON-NLS-1$ + d.append(LF); } for (int i = 0; i < commit.getChildCount(); i++) { final RevCommit p = commit.getChild(i); - d.append("Child: "); + d.append(UIText.CommitMessageViewer_child); + d.append(": "); //$NON-NLS-1$ addLink(d, styles, p); d.append(" ("); //$NON-NLS-1$ d.append(p.getShortMessage()); d.append(")"); //$NON-NLS-1$ - d.append("\n"); //$NON-NLS-1$ + d.append(LF); } makeGrayText(d, styles); - d.append("\n"); //$NON-NLS-1$ + d.append(LF); String msg = commit.getFullMessage(); Pattern p = Pattern.compile("\n([A-Z](?:[A-Za-z]+-)+by: [^\n]+)"); //$NON-NLS-1$ if (fill) { @@ -217,7 +230,7 @@ class CommitMessageViewer extends TextViewer implements ISelectionChangedListene int h0 = d.length(); d.append(msg); - d.append("\n"); //$NON-NLS-1$ + d.append(LF); addDiff(d); @@ -277,8 +290,8 @@ class CommitMessageViewer extends TextViewer implements ISelectionChangedListene outputDiff(d, diff); } } catch (IOException e) { - Activator.error("Can't get file difference of " - + commit.getId() + ".", e); + Activator.error(NLS.bind(UIText.CommitMessageViewer_errorGettingFileDifference, + commit.getId()), e); } } @@ -289,18 +302,20 @@ class CommitMessageViewer extends TextViewer implements ISelectionChangedListene FileMode mode1 = fileDiff.modes[0]; FileMode mode2 = fileDiff.modes[1]; - d.append(formatPathLine(path)).append("\n"); //$NON-NLS-1$ + d.append(formatPathLine(path)).append(LF); if (id1.equals(ObjectId.zeroId())) { - d.append("new file mode " + mode2).append("\n"); //$NON-NLS-2$ + d.append(UIText.CommitMessageViewer_newFileMode + + SPACE + + mode2).append(LF); } else if (id2.equals(ObjectId.zeroId())) { - d.append("deleted file mode " + mode1).append("\n"); //$NON-NLS-2$ + d.append(UIText.CommitMessageViewer_deletedFileMode + SPACE + mode1).append(LF); } else if (!mode1.equals(mode2)) { - d.append("old mode " + mode1); - d.append("new mode " + mode2).append("\n"); //$NON-NLS-2$ + d.append(UIText.CommitMessageViewer_oldMode + SPACE + mode1); + d.append(UIText.CommitMessageViewer_newMode + SPACE + mode2).append(LF); } - d.append("index ").append(id1.abbreviate(db, 7).name()). + d.append(UIText.CommitMessageViewer_index).append(SPACE).append(id1.abbreviate(db, 7).name()). append("..").append(id2.abbreviate(db, 7).name()). //$NON-NLS-1$ - append (mode1.equals(mode2) ? " " + mode1 : ""). append("\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + append (mode1.equals(mode2) ? SPACE + mode1 : EMPTY). append(LF); RawText a = getRawText(id1); RawText b = getRawText(id2); @@ -313,7 +328,7 @@ class CommitMessageViewer extends TextViewer implements ISelectionChangedListene } } , a, b, diff.getEdits()); - d.append("\n"); //$NON-NLS-1$ + d.append(LF); } private String formatPathLine(String path) { @@ -324,7 +339,7 @@ class CommitMessageViewer extends TextViewer implements ISelectionChangedListene int i = 0; for (; i < n/2; i++) d.append("-"); //$NON-NLS-1$ - d.append(" ").append(path).append(" "); //$NON-NLS-1$ //$NON-NLS-2$ + d.append(SPACE).append(path).append(SPACE); for (; i < n - 1; i++) d.append("-"); //$NON-NLS-1$ return d.toString(); diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiffContentProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiffContentProvider.java index 104f28d8..0e037226 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiffContentProvider.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/FileDiffContentProvider.java @@ -11,10 +11,12 @@ package org.eclipse.egit.ui.internal.history; import java.io.IOException; import org.eclipse.egit.ui.Activator; +import org.eclipse.egit.ui.UIText; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jgit.revwalk.RevCommit; import org.eclipse.jgit.treewalk.TreeWalk; +import org.eclipse.osgi.util.NLS; class FileDiffContentProvider implements IStructuredContentProvider { private TreeWalk walk; @@ -35,8 +37,8 @@ class FileDiffContentProvider implements IStructuredContentProvider { try { diff = FileDiff.compute(walk, commit); } catch (IOException err) { - Activator.error("Can't get file difference of " - + commit.getId() + ".", err); + Activator.error(NLS.bind(UIText.FileDiffContentProvider_errorGettingDifference, + commit.getId()), err); } } return diff; diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java index be503a5f..984e4440 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GenerateHistoryJob.java @@ -53,7 +53,7 @@ class GenerateHistoryJob extends Job { } } catch (IOException e) { status = new Status(IStatus.ERROR, Activator.getPluginId(), - "Cannot compute Git history.", e); + UIText.GenerateHistoryJob_errorComputingHistory, e); } if (monitor.isCanceled()) diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java index 1d5a49c1..f34aa657 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java @@ -401,8 +401,8 @@ public class GitHistoryPage extends HistoryPage implements RepositoryListener { right = new EditableRevision(nextFile); } } catch (IOException e) { - Activator.error("IO error looking up path" + gitPath + " in " - + commit.getId() + ".", e); + Activator.error(NLS.bind(UIText.GitHistoryPage_errorLookingUpPath, + gitPath, commit.getId()), e); } return right; } @@ -629,7 +629,7 @@ public class GitHistoryPage extends HistoryPage implements RepositoryListener { } private IAction createFindToolbarAction() { - final IAction r = new Action("Fi", UIIcons.ELCL16_FIND) { + final IAction r = new Action(UIText.GitHistoryPage_find, UIIcons.ELCL16_FIND) { public void run() { prefs.setValue(SHOW_FIND_TOOLBAR, isChecked()); layout(); @@ -849,8 +849,8 @@ public class GitHistoryPage extends HistoryPage implements RepositoryListener { try { headId = db.resolve(Constants.HEAD); } catch (IOException e) { - Activator.logError("Cannot parse HEAD in: " - + db.getDirectory().getAbsolutePath(), e); + Activator.logError(NLS.bind(UIText.GitHistoryPage_errorParsingHead, + db.getDirectory().getAbsolutePath()), e); return false; } @@ -865,7 +865,7 @@ public class GitHistoryPage extends HistoryPage implements RepositoryListener { currentWalk = new SWTWalk(db); currentWalk.sort(RevSort.COMMIT_TIME_DESC, true); currentWalk.sort(RevSort.BOUNDARY, true); - highlightFlag = currentWalk.newFlag("highlight"); + highlightFlag = currentWalk.newFlag("highlight"); //$NON-NLS-1$ } else { currentWalk.reset(); } @@ -875,8 +875,8 @@ public class GitHistoryPage extends HistoryPage implements RepositoryListener { try { currentWalk.markStart(currentWalk.parseCommit(headId)); } catch (IOException e) { - Activator.logError("Cannot read HEAD commit " + headId + " in: " - + db.getDirectory().getAbsolutePath(), e); + Activator.logError(NLS.bind(UIText.GitHistoryPage_errorReadingHeadCommit, + headId, db.getDirectory().getAbsolutePath()), e); return false; } diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositorySearchDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositorySearchDialog.java index dc3c4d88..7334659b 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositorySearchDialog.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositorySearchDialog.java @@ -141,8 +141,7 @@ public class RepositorySearchDialog extends Dialog { @Override protected void configureShell(Shell newShell) { super.configureShell(newShell); - newShell - .setText(UIText.RepositorySearchDialog_SearchRepositoriesHeader); + newShell.setText(UIText.RepositorySearchDialog_searchRepositories); } @Override @@ -166,7 +165,7 @@ public class RepositorySearchDialog extends Dialog { main.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); Label dirLabel = new Label(main, SWT.NONE); - dirLabel.setText(UIText.RepositorySearchDialog_DirectoryLabel); + dirLabel.setText(UIText.RepositorySearchDialog_directory); final Text dir = new Text(main, SWT.BORDER); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(2, 1).hint(300, SWT.DEFAULT).applyTo(dir); @@ -179,7 +178,7 @@ public class RepositorySearchDialog extends Dialog { Button browse = new Button(main, SWT.PUSH); browse.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1)); - browse.setText(UIText.RepositorySearchDialog_BrowseButton); + browse.setText(UIText.RepositorySearchDialog_browse); browse.addSelectionListener(new SelectionAdapter() { @Override @@ -229,7 +228,7 @@ public class RepositorySearchDialog extends Dialog { Button search = new Button(main, SWT.PUSH); search.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1)); - search.setText(UIText.RepositorySearchDialog_SearchButton); + search.setText(UIText.RepositorySearchDialog_search); tv = CheckboxTableViewer.newCheckList(main, SWT.BORDER); tab = tv.getTable(); @@ -317,7 +316,7 @@ public class RepositorySearchDialog extends Dialog { } catch (InvocationTargetException e1) { MessageDialog.openError(getShell(), - UIText.RepositorySearchDialog_ErrorHeader, e1 + UIText.RepositorySearchDialog_errorOccurred, e1 .getCause().getMessage()); } catch (InterruptedException e1) { // ignore diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties index 95888498..a465b063 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/uitext.properties @@ -7,6 +7,12 @@ # ############################################################################### +Activator_refreshingProjects=Refreshing git managed projects +Activator_refreshJobName=Git index refresh Job +Activator_repoScanJobName=Repository Change Scanner +Activator_scanError=An error occurred while scanning for changes. Scanning aborted +Activator_scanningRepositories=Scanning Git repositories for changes +Activator_refreshFailed=Failed to refresh projects from index changes AddToIndexAction_indexesWithUnmergedEntries=The indexes of the following files contain unmerged entries: AddToIndexAction_addingFilesFailed=Adding Files to the Git Index failed WizardProjectsImportPage_projectLabel={0} ({1}) @@ -34,6 +40,7 @@ SelectRemoteNamePage_SelectRemoteNameMessage=Select a remote name SharingWizard_windowTitle=Configure Git Repository SharingWizard_failed=Failed to initialize Git team provider. +GenerateHistoryJob_errorComputingHistory=Cannot compute Git history. GenericOperationFailed={0} Failed ExistingOrNewPage_CreateButton=&Create Repository @@ -46,6 +53,8 @@ ExistingOrNewPage_HeaderProject=Project ExistingOrNewPage_HeaderRepository=Repository ExistingOrNewPage_SymbolicValueEmptyMapping= +GitCloneWizard_abortingCloneMsg=A complete clone was already made. Do you want to delete it? +GitCloneWizard_abortingCloneTitle=Aborting clone GitCloneWizard_CloneFailedHeading=Cloning Git Repository failed GitCloneWizard_CloneCanceledMessage=Clone operation was canceled by the user GitCloneWizard_title=Import Git Repository @@ -53,9 +62,17 @@ GitCloneWizard_jobName=Cloning from {0} GitCloneWizard_failed=Git repository clone failed. GitCloneWizard_errorCannotCreate=Cannot create directory {0}. GitDecoratorPreferencePage_bindingRepositoryNameFlag=name of the repository +GitDocument_errorLoadCommit=Could not load commit {0} for {1} corresponding to {2} in {3} +GitDocument_errorLoadTree=Could not load tree {0} for {1} corresponding to {2} in {3} +GitDocument_errorRefreshQuickdiff=Failed to refresh quickdiff +GitDocument_errorResolveQuickdiff=Could not resolve quickdiff baseline {0} corresponding to {1} in {2} GitHistoryPage_CompareVersions=Compare with each other GitHistoryPage_CompareWithWorking=Compare with working tree +GitHistoryPage_errorLookingUpPath=IO error looking up path {0} in {1}. +GitHistoryPage_errorParsingHead=Cannot parse HEAD in: {0} +GitHistoryPage_errorReadingHeadCommit=Cannot read HEAD commit {0} in: {1} GitHistoryPage_FileNotInCommit={0} not in {1} +GitHistoryPage_find=Find GitProjectPropertyPage_LabelBranch=Branch: GitProjectPropertyPage_LabelGitDir=Git directory: GitProjectPropertyPage_LabelId=Id: @@ -64,6 +81,11 @@ GitProjectPropertyPage_LabelWorkdir=Working directory: GitProjectPropertyPage_ValueEmptyRepository=None (empty repository) GitProjectPropertyPage_ValueUnbornBranch=None (unborn branch) +RepositoryAction_errorFindingRepo=Could not find a repository associated with this project +RepositoryAction_errorFindingRepoTitle=Cannot Find Repository +RepositoryAction_multiRepoSelection=Cannot perform reset on multiple repositories simultaneously.\n\nPlease select items from only one repository. +RepositoryAction_multiRepoSelectionTitle=Multiple Repositories Selection + RepositoryPropertySource_ConfigureKeysAction=Configure Keys... RepositoryPropertySource_EffectiveConfigurationAction=Effective Configuration RepositoryPropertySource_EffectiveConfigurationCategory=Effective configuration @@ -71,26 +93,30 @@ RepositoryPropertySource_ErrorHeader=Error RepositoryPropertySource_GlobalConfigurationCategory=Global configuration RepositoryPropertySource_RepositoryConfigurationCategory=Repository configuration RepositoryPropertySource_RestoreStandardAction=Restore standard keys + RepositoryRemotePropertySource_ErrorHeader=Error RepositoryRemotePropertySource_FetchLabel=Remote Fetch Specification RepositoryRemotePropertySource_PushLabel=Remote Push Specification RepositoryRemotePropertySource_RemoteFetchURL_label=Remote Fetch URL RepositoryRemotePropertySource_RemotePushUrl_label=Remote Push URL -RepositorySearchDialog_BrowseButton=Browse... + RepositorySearchDialog_DeepSearch_button=Look for Nested Repositories -RepositorySearchDialog_DirectoryLabel=Directory -RepositorySearchDialog_ErrorHeader=Error RepositorySearchDialog_RepositoriesFound_message={0} Git repositories found... RepositorySearchDialog_ScanningForRepositories_message=Scanning for GIT repositories... -RepositorySearchDialog_SearchButton=Search RepositorySearchDialog_SearchRepositoriesHeader=Search Git Repositories RepositorySearchDialog_ToggleSelection_button=Toggle Selection +RepositorySearchDialog_browse=Browse... +RepositorySearchDialog_directory=Directory +RepositorySearchDialog_errorOccurred=Error occurred +RepositorySearchDialog_search=Search +RepositorySearchDialog_searchRepositories=Search Git Repositories RepositorySelectionPage_BrowseLocalFile=Local file... RepositorySelectionPage_sourceSelectionTitle=Source Git Repository RepositorySelectionPage_sourceSelectionDescription=Enter the location of the source repository. RepositorySelectionPage_destinationSelectionTitle=Destination Git Repository RepositorySelectionPage_destinationSelectionDescription=Enter the location of the destination repository. RepositorySelectionPage_configuredRemoteChoice=Configured remote repository +RepositorySelectionPage_errorValidating=Error validating {0} RepositorySelectionPage_uriChoice=Custom URI RepositorySelectionPage_groupLocation=Location RepositorySelectionPage_groupAuthentication=Authentication @@ -132,6 +158,15 @@ CloneDestinationPage_errorNotEmptyDir={0} is not an empty directory. CloneDestinationPage_importProjectsAfterClone=&Import projects after clone CloneDestinationPage_workspaceImport=Workspace import +RefContentProposal_blob=blob +RefContentProposal_branch=branch +RefContentProposal_by=by +RefContentProposal_commit=commit +RefContentProposal_errorReadingObject=Unable to read object {0} for content proposal assistance +RefContentProposal_tag=tag +RefContentProposal_trackingBranch=tracking branch +RefContentProposal_tree=tree +RefContentProposal_unknownObject=locally unknown object RefSpecPanel_clickToChange=[Click to change] RefSpecPanel_columnDst=Destination Ref RefSpecPanel_columnForce=Force Update @@ -209,7 +244,11 @@ RefSpecPage_annotatedTagsFetchTags=Always fetch tags, even if we do not have the RefSpecPage_annotatedTagsNoTags=Never fetch tags, even if we have the thing it points at QuickDiff_failedLoading=Quick diff failed to obtain file data. +QuickdiffBaselineOperation_baseline=Cannot set quickdiff baseline +ResetAction_errorResettingHead=Cannot reset HEAD now +ResetAction_repositoryState=Repository state: {0} +ResetAction_resetFailed=Reset failed ResourceHistory_toggleCommentWrap=Wrap Comments ResourceHistory_toggleCommentFill=Fill paragraphs ResourceHistory_toggleRevDetail=Show Revision Details @@ -258,6 +297,19 @@ PushWizard_unexpectedError=Unexpected error occurred. PushWizard_windowTitleDefault=Push To Another Repositories PushWizard_windowTitleWithDestination=Push To: {0} +CommitAction_amendCommit=No changed items were selected. Do you wish to amend the last commit? +CommitAction_amendNotPossible=Commit/amend not possible. Possible causes:\n\n- No changed items were selected\n- Multiple repositories selected\n- No repositories selected\n- No previous commits +CommitAction_cannotCommit=Cannot commit now +CommitAction_errorCommittingChanges=Committing changes +CommitAction_errorComputingDiffs=Error occurred computing diffs +CommitAction_errorDuringCommit=Error during commit +CommitAction_errorOnCommit=Error occurred while committing +CommitAction_errorPreparingTrees=Preparing trees +CommitAction_errorRetrievingCommit=Error occurred retrieving last commit +CommitAction_errorWritingTrees=Writing trees +CommitAction_failedToUpdate=Failed to update {0} to commit {1}. +CommitAction_noFilesToCommit=No files to commit +CommitAction_repositoryState=Repository state: {0} CommitDialog_AddFileOnDiskToIndex=Add file on &disk to index CommitDialog_AddSOB=Add Signed-off-&by CommitDialog_AmendPreviousCommit=Am&end previous commit @@ -275,6 +327,7 @@ CommitDialog_ErrorNoItemsSelected=No items selected CommitDialog_ErrorNoItemsSelectedToBeCommitted=No items are currently selected to be committed. CommitDialog_ErrorNoMessage=No message CommitDialog_File=File +CommitDialog_problemFindingFileStatus=Problem in finding file status CommitDialog_SelectAll=&Select All CommitDialog_Status=Status CommitDialog_StatusAdded=Added @@ -285,6 +338,7 @@ CommitDialog_StatusModifiedNotStaged=Mod., not staged CommitDialog_StatusRemoved=Removed CommitDialog_StatusRemovedNotStaged=Rem., not staged CommitDialog_StatusUnknown=Unknown +<<<<<<< HEAD CommitDialog_ValueHelp_Message=Press {0} to see previously used values (use "*" as wildcard) ConfigureKeysDialog_AddStandardButton=Add standard keys @@ -296,6 +350,19 @@ ConfigureKeysDialog_NewKeyLabel=New key ConfigureRemoteWizard_WizardTitle_Change=Change remote configuration {0} ConfigureRemoteWizard_WizardTitle_New=Create a new remote configuration +CommitMessageViewer_author=Author +CommitMessageViewer_child=Child +CommitMessageViewer_commit=commit +CommitMessageViewer_committer=Committer +CommitMessageViewer_deletedFileMode=deleted file mode +CommitMessageViewer_errorGettingFileDifference=Can't get file difference of {0}. +CommitMessageViewer_index=index +CommitMessageViewer_newFileMode=new file mode +CommitMessageViewer_newMode=new mode +CommitMessageViewer_oldMode=old mode +CommitMessageViewer_parent=Parent +CompareWithIndexAction_errorOnAddToIndex=Error during adding to index + ConfirmationPage_cantConnectToAnyTitle=Can't Connect ConfirmationPage_cantConnectToAny=Can't connect to any URI: {0} ConfirmationPage_description=Confirm following expected push result. @@ -364,6 +431,7 @@ FetchWizard_transportNotSupportedMessage=Selected URI is not supported by any tr FetchWizard_transportNotSupportedTitle=Transport Not Supported FetchWizard_windowTitleDefault=Fetch From Another Repository FetchWizard_windowTitleWithSource=Fetch From: {0} +FileDiffContentProvider_errorGettingDifference=Can't get file difference of {0}. WindowCachePreferencePage_title=Git Window Cache WindowCachePreferencePage_packedGitWindowSize=Window size: @@ -371,6 +439,10 @@ WindowCachePreferencePage_packedGitLimit=Window cache limit: WindowCachePreferencePage_deltaBaseCacheLimit=Delta base cache limit: WindowCachePreferencePage_packedGitMMAP=Use virtual memory mapping +BranchAction_cannotCheckout=Cannot checkout now +BranchAction_errorSwitchingBranches=Error while switching branches +BranchAction_repositoryState=Repository state: {0} +BranchAction_unableToSwitchBranches=Unable to switch branches BranchSelectionDialog_TitleCheckout=Checkout: {0} BranchSelectionDialog_TitleReset=Reset: {0} BranchSelectionDialog_BranchSelectionDialog_CreateFailedTitle=New branch creation failed @@ -486,4 +558,9 @@ DiscardChangesAction_unexpectedErrorTitle=Unexpected Error DiscardChangesAction_unexpectedErrorMessage=An unexpected error occured while attempting to checkout resources. DiscardChangesAction_unexpectedIndexErrorMessage=An unexpected error occured while attempting to interact with the Git Index. DiscardChangesAction_refreshErrorTitle=Error During Refresh -DiscardChangesAction_refreshErrorMessage=Some of the selected resources could not be refreshed. \ No newline at end of file +DiscardChangesAction_refreshErrorMessage=Some of the selected resources could not be refreshed. + +GitCompareFileRevisionEditorInput_contentIdentifier=Problem getting content identifier + +UIIcons_errorDeterminingIconBase=Can't determine icon base. +UIIcons_errorLoadingPluginImage=Can't load plugin image. \ No newline at end of file -- 2.11.4.GIT