From 8870f0da96053dd9753def96b18ab3cedcdc7124 Mon Sep 17 00:00:00 2001 From: "APAC\\LPT5KOR" Date: Wed, 13 Mar 2024 12:06:06 +0530 Subject: [PATCH] Externalize the 'difference/s' text #1236 Externalization of text used in "Textmergeviewer.java" related to number of differences shown in toolbar of compare editor. Fixes https://github.com/eclipse-platform/eclipse.platform/issues/1236 --- .../eclipse/compare/contentmergeviewer/TextMergeViewer.java | 4 ++-- .../compare/org/eclipse/compare/internal/CompareMessages.java | 3 +++ .../org/eclipse/compare/internal/CompareMessages.properties | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java index 123af793be6..9fbf0a2e356 100644 --- a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java +++ b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java @@ -5421,8 +5421,8 @@ private void updateToolbarLabel() { int differenceCount = fMerger.changesCount(); if (tbm != null) { - String label = differenceCount > 1 ? differenceCount + " Differences" //$NON-NLS-1$ - : differenceCount == 1 ? differenceCount + " Difference" : "No Difference"; //$NON-NLS-1$ //$NON-NLS-2$ + String label = differenceCount > 1 ? differenceCount + CompareMessages.TextMergeViewer_differences + : differenceCount == 1 ? differenceCount + CompareMessages.TextMergeViewer_difference : CompareMessages.TextMergeViewer_no_difference; //$NON-NLS-1$ //$NON-NLS-2$ LabelContributionItem labelContributionItem = new LabelContributionItem(DIFF_COUNT_ID, label); diff --git a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.java b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.java index 09fedb6a744..935b2a091e4 100644 --- a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.java +++ b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.java @@ -96,6 +96,9 @@ private CompareMessages() { public static String TextMergeViewer_atEnd_message; public static String TextMergeViewer_atBeginning_title; public static String TextMergeViewer_atBeginning_message; + public static String TextMergeViewer_difference; + public static String TextMergeViewer_differences; + public static String TextMergeViewer_no_difference; public static String CompareNavigator_atEnd_title; public static String CompareNavigator_atEnd_message; public static String CompareNavigator_atBeginning_title; diff --git a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.properties b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.properties index 8cdcff78bb4..2502774f839 100644 --- a/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.properties +++ b/team/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.properties @@ -81,6 +81,10 @@ TextMergeViewer_accessible_right={0} Right: {1} TextMergeViewer_atBeginning_message= Beginning of document reached. Continue from end? TextMergeViewer_accessible_ancestor=Ancestor: {0} +TextMergeViewer_difference=\ Difference +TextMergeViewer_differences=\ Differences +TextMergeViewer_no_difference=No Difference + CompareNavigator_atEnd_title= End Reached CompareDialog_commit_button=C&ommit CompareDialog_error_title=Error Saving Changes