|
From: <caw...@us...> - 2007-07-05 14:03:27
|
Revision: 2712
http://svn.sourceforge.net/rubyeclipse/?rev=2712&view=rev
Author: cawilliams
Date: 2007-07-05 07:03:13 -0700 (Thu, 05 Jul 2007)
Log Message:
-----------
fix up translation strings.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/InfoViewMessages.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/InfoViewMessages.properties
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/InfoViewMessages.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/InfoViewMessages.java 2007-07-05 13:29:13 UTC (rev 2711)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/InfoViewMessages.java 2007-07-05 14:03:13 UTC (rev 2712)
@@ -10,25 +10,22 @@
*******************************************************************************/
package org.rubypeople.rdt.internal.ui.infoviews;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
+import org.eclipse.osgi.util.NLS;
/**
- * @since 3.0
+ *
*/
-class InfoViewMessages {
+class InfoViewMessages extends NLS {
private static final String BUNDLE_NAME= InfoViewMessages.class.getName();
-
- private static final ResourceBundle RESOURCE_BUNDLE= ResourceBundle.getBundle(BUNDLE_NAME);
-
- private InfoViewMessages() {}
-
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
+
+ public static String RubyInformation_ri_not_found;
+ public static String RubyInformation_please_wait;
+ public static String RubyInformation_refresh;
+ public static String RubyInformation_refresh_tooltip;
+ public static String RubyInformation_update_job_title;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, InfoViewMessages.class);
}
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/InfoViewMessages.properties
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/InfoViewMessages.properties 2007-07-05 13:29:13 UTC (rev 2711)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/InfoViewMessages.properties 2007-07-05 14:03:13 UTC (rev 2712)
@@ -1,7 +1,8 @@
-RubyInformation.interpreter_not_selected= You must define an interpreter before viewing Ruby information.
-RubyInformation.ri_not_found= Ri is either not installed or not found. Please set the path to ri through Window > Preferences > Ruby > Ri / Rdoc. This view reflects changes of the path automatically. The ri path should point a file called ri in your ruby installation directory. If there is no such file, you probably can create one if you have rdoc installed (this is tested with version 1.0.1). The file needs to import (require) 'rdoc/ri/ri_driver' and then the line RiDriver.new.process_args.
-RubyInformation.tool_tip= Ask Ri for help
-RubyInformation.run= Run RI
-RubyInformation.please_wait= Please wait...
-RubyInformation.search_label=Filter:
-RubyInformation.result_label=Description:
+RubyInformation_ri_not_found= Ri is either not installed or not found. {0}
+RubyInformation_tool_tip= Ask Ri for help
+RubyInformation_please_wait=Please wait. Updating RI View...
+
+RubyInformation_refresh=Refresh
+RubyInformation_refresh_tooltip=Refresh list of names
+
+RubyInformation_update_job_title=Updating RI View
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java 2007-07-05 13:29:13 UTC (rev 2711)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java 2007-07-05 14:03:13 UTC (rev 2712)
@@ -53,7 +53,6 @@
private boolean riFound = false;
private PageBook pageBook;
private SashForm form;
- private Label riNotFoundLabel;
private Text searchStr;
private TableViewer searchListViewer;
private Browser searchResult;
@@ -75,14 +74,10 @@
public void createPartControl(Composite parent) {
contributeToActionBars();
- pageBook = new PageBook(parent, SWT.NONE);
-
- riNotFoundLabel = new Label( pageBook, SWT.LEFT | SWT.TOP | SWT.WRAP );
- riNotFoundLabel.setText( InfoViewMessages.getString( "RubyInformation.ri_not_found") );
-
+ pageBook = new PageBook(parent, SWT.NONE);
Label inProgressLabel = new Label( pageBook, SWT.LEFT | SWT.TOP | SWT.WRAP );
- inProgressLabel.setText("Please wait. Updating RI View...");
+ inProgressLabel.setText(InfoViewMessages.RubyInformation_please_wait);
form = new SashForm(pageBook, SWT.HORIZONTAL);
@@ -145,8 +140,8 @@
updatePage();
}
};
- refreshAction.setText("Refresh");
- refreshAction.setToolTipText("Refresh list of names");
+ refreshAction.setText(InfoViewMessages.RubyInformation_refresh);
+ refreshAction.setToolTipText(InfoViewMessages.RubyInformation_refresh_tooltip);
refreshAction.setImageDescriptor(RubyPluginImages.TOOLBAR_REFRESH);
IToolBarManager manager = getViewSite().getActionBars().getToolBarManager();
@@ -187,7 +182,7 @@
private RubyInvoker invoker;
public RubyInvokerJob(RubyInvoker invoker) {
- super("Updating RI View"); // $NON-NLS-1$
+ super(InfoViewMessages.RubyInformation_update_job_title);
this.invoker = invoker;
}
@@ -250,7 +245,7 @@
riFound = false;
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run() {
- pageBook.showPage(riNotFoundLabel);
+ pageBook.showPage(riNotFoundLabel());
}
});
return;
@@ -291,7 +286,7 @@
}
protected void beforeInvoke() {
- searchResult.setText(InfoViewMessages.getString("RubyInformation.please_wait"));
+ searchResult.setText(InfoViewMessages.RubyInformation_please_wait);
}
void addToBuffer(int position, final String line) {
@@ -361,7 +356,7 @@
while ((line = reader.readLine()) != null) {
fgPossibleMatches.add(line.trim());
}
- // if not matches were found display an error message
+ // if no matches were found display an error message
if( fgPossibleMatches.size() == 0 ){
view.riNotFound();
} else {
@@ -384,8 +379,14 @@
void riNotFound() {
riFound = false;
- pageBook.showPage( riNotFoundLabel );
+ pageBook.showPage( riNotFoundLabel() );
}
+
+ protected Label riNotFoundLabel() {
+ Label riNotFoundLabel = new Label( pageBook, SWT.LEFT | SWT.TOP | SWT.WRAP );
+ riNotFoundLabel.setText(InfoViewMessages.bind(InfoViewMessages.RubyInformation_ri_not_found, RubyRuntime.getRI()));
+ return riNotFoundLabel;
+ }
public void defaultVMInstallChanged(IVMInstall previous, IVMInstall current) {
updatePage();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|