|
From: <caw...@us...> - 2007-01-22 20:53:56
|
Revision: 1845
http://svn.sourceforge.net/rubyeclipse/?rev=1845&view=rev
Author: cawilliams
Date: 2007-01-22 12:53:51 -0800 (Mon, 22 Jan 2007)
Log Message:
-----------
try to move us towards using only subclasses of NLS for translations - so we get accurate information on what strings are missing and what are unused.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/ActionMessages.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/SurroundWithBeginRescueAction.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/ActionMessages.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/ActionMessages.java 2007-01-22 20:17:22 UTC (rev 1844)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/ActionMessages.java 2007-01-22 20:53:51 UTC (rev 1845)
@@ -1,22 +1,17 @@
package org.rubypeople.rdt.ui.actions;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
+import org.eclipse.osgi.util.NLS;
public class ActionMessages {
- private static final String BUNDLE_NAME = "org.rubypeople.rdt.ui.actions.ActionMessages"; //$NON-NLS-1$
+ private static final String BUNDLE_NAME = "org.rubypeople.rdt.ui.actions.ActionMessages"; //$NON-NLS-1$
+
+ private ActionMessages() {}
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
-
- private ActionMessages() {
- }
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
- }
+ public static String SurroundWithBeginRescueAction_label;
+ public static String SurroundWithBeginRescueAction_error;
+ public static String SurroundWithBeginRescueAction_dialog_title;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, ActionMessages.class);
+ }
}
\ No newline at end of file
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/SurroundWithBeginRescueAction.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/SurroundWithBeginRescueAction.java 2007-01-22 20:17:22 UTC (rev 1844)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/SurroundWithBeginRescueAction.java 2007-01-22 20:53:51 UTC (rev 1845)
@@ -41,7 +41,7 @@
public SurroundWithBeginRescueAction(RubyEditor editor) {
super(editor.getEditorSite());
- setText(ActionMessages.getString("SurroundWithBeginRescueAction.label")); //$NON-NLS-1$
+ setText(ActionMessages.SurroundWithBeginRescueAction_label);
fEditor = editor;
setEnabled((fEditor != null && SelectionConverter.getInputAsRubyScript(fEditor) != null));
PlatformUI.getWorkbench().getHelpSystem().setHelp(this,
@@ -53,12 +53,12 @@
createChange(selection, new NullProgressMonitor());
} catch (CoreException e) {
ExceptionHandler.handle(e, getDialogTitle(),
- ActionMessages.getString("SurroundWithBeginRescueAction.error")); //$NON-NLS-1$
+ ActionMessages.SurroundWithBeginRescueAction_error);
}
}
private static String getDialogTitle() {
- return ActionMessages.getString("SurroundWithBeginRescueAction.dialog.title"); //$NON-NLS-1$
+ return ActionMessages.SurroundWithBeginRescueAction_dialog_title;
}
private IFile getFile() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|