From bb9be952d5be1d9f33ab0952cafd3f69054e9872 Mon Sep 17 00:00:00 2001 From: Andrew Gvozdev Date: Sat, 17 Mar 2012 06:39:04 -0400 Subject: [PATCH] bug 261976: Externalize strings --- .../src/org/eclipse/cdt/core/CommandLauncher.java | 8 +++++--- .../cdt/internal/core/CCorePluginResources.properties | 2 -- .../utils/org/eclipse/cdt/internal/core/Messages.java | 2 ++ .../org/eclipse/cdt/internal/core/messages.properties | 2 ++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncher.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncher.java index dd7c0d68023..a8f38c8bef2 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncher.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncher.java @@ -16,6 +16,7 @@ import java.io.OutputStream; import java.util.Properties; import org.eclipse.cdt.internal.core.Cygwin; +import org.eclipse.cdt.internal.core.Messages; import org.eclipse.cdt.internal.core.ProcessClosure; import org.eclipse.cdt.utils.PathUtil; import org.eclipse.cdt.utils.spawner.EnvironmentReader; @@ -25,6 +26,7 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.Platform; +import org.eclipse.osgi.util.NLS; /** * @noextend This class is not intended to be subclassed by clients. @@ -201,8 +203,8 @@ public class CommandLauncher implements ICommandLauncher { envPathValue = System.getenv(PATH_ENV); } errorMessage = errorMessage + NEWLINE - + "Error: Program \"" + command + "\" not found in PATH" + NEWLINE - + "PATH=[" + envPathValue + "]" + NEWLINE; + + NLS.bind(Messages.CommandLauncher_ProgramNotFoundInPath, command) + NEWLINE + + "PATH=[" + envPathValue + "]" + NEWLINE; //$NON-NLS-1$ //$NON-NLS-2$ } setErrorMessage(errorMessage); fProcess = null; @@ -258,7 +260,7 @@ public class CommandLauncher implements ICommandLauncher { if (monitor.isCanceled()) { closure.terminate(); state = COMMAND_CANCELED; - setErrorMessage(CCorePlugin.getResourceString("CommandLauncher.error.commandCanceled")); //$NON-NLS-1$ + setErrorMessage(Messages.CommandLauncher_CommandCancelled); } try { diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePluginResources.properties b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePluginResources.properties index 44d8af158f9..cfcf1d84e09 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePluginResources.properties +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CCorePluginResources.properties @@ -26,8 +26,6 @@ CoreModel.PathEntry.DuplicateEntry= Duplicate path entries found ({0}), path: [{ CoreModel.PathEntry.NestedEntry= Nested path entries CoreModel.PathEntry.InvalidPathEntry= Invalid path -CommandLauncher.error.commandCanceled=Command canceled - CCProjectNature.exception.noNature=Project must have a cnature CCorePlugin.exception.noBinaryFormat=No Binary Format diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/Messages.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/Messages.java index a0894b911e6..56fead20b7e 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/Messages.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/Messages.java @@ -16,6 +16,8 @@ public class Messages extends NLS { private static final String BUNDLE_NAME = "org.eclipse.cdt.internal.core.messages"; //$NON-NLS-1$ public static String Util_unexpectedError; public static String Addr_valueOutOfRange; + public static String CommandLauncher_CommandCancelled; + public static String CommandLauncher_ProgramNotFoundInPath; public static String convention_illegalIdentifier; public static String convention_invalid; public static String convention_reservedKeyword; diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/messages.properties b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/messages.properties index 4e97e95a535..9c51cb755e7 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/messages.properties +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/internal/core/messages.properties @@ -47,6 +47,8 @@ convention_enum_invalidName= Enum name is invalid Util_unexpectedError=Unexpected error Addr_valueOutOfRange=Address is outside valid range. +CommandLauncher_CommandCancelled=Command canceled +CommandLauncher_ProgramNotFoundInPath=Error: Program "{0}" not found in PATH XmlUtil_InternalErrorLoading=Internal error while trying to load XML document XmlUtil_InternalErrorSerializing=Internal error while trying to serialize XML Document.