|
From: <caw...@us...> - 2007-01-22 20:56:48
|
Revision: 1847
http://svn.sourceforge.net/rubyeclipse/?rev=1847&view=rev
Author: cawilliams
Date: 2007-01-22 12:56:38 -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/internal/ui/text/ruby/hover/AbstractRubyEditorTextHover.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RubyHoverMessages.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RubyHoverMessages.properties
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/AbstractRubyEditorTextHover.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/AbstractRubyEditorTextHover.java 2007-01-22 20:54:14 UTC (rev 1846)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/AbstractRubyEditorTextHover.java 2007-01-22 20:56:38 UTC (rev 1847)
@@ -112,7 +112,7 @@
return null;
String keySequence= sequences[0].format();
- return RubyHoverMessages.getFormattedString("RubyTextHover.makeStickyHint", keySequence); //$NON-NLS-1$
+ return RubyHoverMessages.getFormattedString(RubyHoverMessages.RubyTextHover_makeStickyHint, keySequence);
}
/**
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RubyHoverMessages.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RubyHoverMessages.java 2007-01-22 20:54:14 UTC (rev 1846)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RubyHoverMessages.java 2007-01-22 20:56:38 UTC (rev 1847)
@@ -11,75 +11,29 @@
package org.rubypeople.rdt.internal.ui.text.ruby.hover;
import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-class RubyHoverMessages {
+import org.eclipse.osgi.util.NLS;
- private static final String RESOURCE_BUNDLE= RubyHoverMessages.class.getName();
+class RubyHoverMessages extends NLS {
- private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
+ private static final String BUNDLE_NAME= RubyHoverMessages.class.getName();
private RubyHoverMessages() {
}
- public static String getString(String key) {
- try {
- return fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
+ public static String RubyTextHover_makeStickyHint;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, RubyHoverMessages.class);
}
+
/**
* Gets a string from the resource bundle and formats it with the argument
*
* @param key the string used to get the bundle value, must not be null
- * @since 3.0
+ * @since 0.8.0
*/
public static String getFormattedString(String key, Object arg) {
- String format= null;
- try {
- format= fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- if (arg == null)
- arg= ""; //$NON-NLS-1$
- return MessageFormat.format(format, new Object[] { arg });
+ return MessageFormat.format(key, new Object[] { arg });
}
- /**
- * Gets a string from the resource bundle and formats it with the arguments
- *
- * @param key the string used to get the bundle value, must not be null
- * @since 3.0
- */
- public static String getFormattedString(String key, Object arg1, Object arg2) {
- String format= null;
- try {
- format= fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- if (arg1 == null)
- arg1= ""; //$NON-NLS-1$
- if (arg2 == null)
- arg2= ""; //$NON-NLS-1$
- return MessageFormat.format(format, new Object[] { arg1, arg2 });
- }
-
- /**
- * Gets a string from the resource bundle and formats it with the argument
- *
- * @param key the string used to get the bundle value, must not be null
- * @since 3.0
- */
- public static String getFormattedString(String key, boolean arg) {
- String format= null;
- try {
- format= fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- return MessageFormat.format(format, new Object[] { new Boolean(arg) });
- }
+
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RubyHoverMessages.properties
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RubyHoverMessages.properties 2007-01-22 20:54:14 UTC (rev 1846)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/hover/RubyHoverMessages.properties 2007-01-22 20:56:38 UTC (rev 1847)
@@ -9,10 +9,5 @@
# IBM Corporation - initial API and implementation
###############################################################################
-RubyTextHover.createTextHover= Could not create ruby text hover
+RubyTextHover_makeStickyHint= Press ''{0}'' for focus.
-RubyTextHover.makeStickyHint= Press ''{0}'' for focus.
-
-NoBreakpointAnnotation.addBreakpoint= Add a breakpoint
-
-NLSStringHover.NLSStringHover.missingKeyWarning= <b>Warning:</b> The key is missing!
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|