# HG changeset patch # User Omair Majid # Date 1361986037 18000 # Node ID 412c3e8caf4bb2ad288b573941557230ea49cb4b # Parent 6f00af7150b2bcc597468bd239fd4e15a881ad9e Fix minor i18n mistakes in LauncherImpl Reviewed-by: neugens Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2013-February/005905.html diff -r 6f00af7150b2 -r 412c3e8caf4b launcher/src/main/java/com/redhat/thermostat/launcher/internal/LauncherImpl.java --- a/launcher/src/main/java/com/redhat/thermostat/launcher/internal/LauncherImpl.java Wed Feb 27 12:17:57 2013 -0500 +++ b/launcher/src/main/java/com/redhat/thermostat/launcher/internal/LauncherImpl.java Wed Feb 27 12:27:17 2013 -0500 @@ -219,7 +219,7 @@ } catch (BundleException | IOException e) { // If this happens we definitely need to do something about it, and the // trace will be immeasurably helpful in figuring out what is wrong. - out.println("Could not load necessary bundles for: " + cmdName); + out.println(t.localize(LocaleResources.COMMAND_COULD_NOT_LOAD_BUNDLES, cmdName)); e.printStackTrace(out); return; } catch (CommandInfoNotFoundException commandNotFound) { @@ -258,13 +258,13 @@ } private void outputBadShellContext(boolean inShell, PrintStream out, String cmd) { - String inOrOut = null; + String message = null; if (inShell) { - inOrOut = t.localize(LocaleResources.WITHIN); + message = t.localize(LocaleResources.COMMAND_AVAILABLE_OUTSIDE_SHELL_ONLY, cmd); } else { - inOrOut = t.localize(LocaleResources.OUTSIDE); + message = t.localize(LocaleResources.COMMAND_AVAILABLE_INSIDE_SHELL_ONLY, cmd); } - out.println(t.localize(LocaleResources.COMMAND_USED_IN_WRONG_CONTEXT, cmd, inOrOut)); + out.println(message); } private void setupLogLevel(Arguments args) { diff -r 6f00af7150b2 -r 412c3e8caf4b launcher/src/main/java/com/redhat/thermostat/launcher/internal/LocaleResources.java --- a/launcher/src/main/java/com/redhat/thermostat/launcher/internal/LocaleResources.java Wed Feb 27 12:17:57 2013 -0500 +++ b/launcher/src/main/java/com/redhat/thermostat/launcher/internal/LocaleResources.java Wed Feb 27 12:27:17 2013 -0500 @@ -42,7 +42,10 @@ CANNOT_GET_COMMAND_INFO, UNKNOWN_COMMAND, + COMMAND_COULD_NOT_LOAD_BUNDLES, COMMAND_DESCRIBED_BUT_NOT_AVAILALBE, + COMMAND_AVAILABLE_INSIDE_SHELL_ONLY, + COMMAND_AVAILABLE_OUTSIDE_SHELL_ONLY, COMMAND_HELP_COMMAND_LIST_HEADER, @@ -50,9 +53,6 @@ OPTION_USERNAME_DESC, OPTION_PASSWORD_DESC, OPTION_LOG_LEVEL_DESC, - WITHIN, - OUTSIDE, - COMMAND_USED_IN_WRONG_CONTEXT, ; static final String RESOURCE_BUNDLE = "com.redhat.thermostat.launcher.internal.strings"; diff -r 6f00af7150b2 -r 412c3e8caf4b launcher/src/main/resources/com/redhat/thermostat/launcher/internal/strings.properties --- a/launcher/src/main/resources/com/redhat/thermostat/launcher/internal/strings.properties Wed Feb 27 12:17:57 2013 -0500 +++ b/launcher/src/main/resources/com/redhat/thermostat/launcher/internal/strings.properties Wed Feb 27 12:27:17 2013 -0500 @@ -1,6 +1,9 @@ CANNOT_GET_COMMAND_INFO = no information about commands UNKNOWN_COMMAND = unknown command ''{0}''\n +COMMAND_COULD_NOT_LOAD_BUNDLES = Could not load necessary bundles for {0} COMMAND_DESCRIBED_BUT_NOT_AVAILALBE = ERROR: Information about the command {0} is provided, but the command itself is not available. Was the Command object registered as an OSGi service? Was the bundle providing the command activated? +COMMAND_AVAILABLE_INSIDE_SHELL_ONLY = The {0} command is not supported from outside the thermostat shell. +COMMAND_AVAILABLE_OUTSIDE_SHELL_ONLY = The {0} command is not supported from within the thermostat shell. COMMAND_HELP_COMMAND_LIST_HEADER = list of commands:\n\n @@ -10,7 +13,4 @@ OPTION_LOG_LEVEL_DESC = sets the log level for this invocation. Possible values\ for in decreasing severity are: SEVERE, WARNING, INFO, CONFIG, FINE,\ FINER, FINEST and OFF - -WITHIN = within -OUTSIDE = outside -COMMAND_USED_IN_WRONG_CONTEXT = The {0} command is not supported from {1} the thermostat shell. \ No newline at end of file +