Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] String externalization work for managedbuilder.ui


Hi,

Please find enclosed a simple patch that marks those strings that are non-translatable as such and externalizes those strings that can be translated.


Cheers!
James


Index: ChangeLog
===================================================================
retrieving revision 1.15
diff -u -r1.15 ChangeLog
--- ChangeLog	27 Feb 2004 18:49:52 -0000	1.15
+++ ChangeLog	2 Mar 2004 14:35:58 -0000
@@ -1,5 +1,23 @@
+2004-03-01 James Ciesielski
+	
+	Marked those strings that are non-translatable as such and externalized 
+	those strings that can be translated.
+
+	* src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderHelpContextIds.java
+	* src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java
+	* src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
+	* src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java
+	* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java
+	* src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolsSettingsStore.java
+	* src/org/eclipse/cdt/managedbuilder/ui/properties/ManagedConfigDialog.java
+	* src/org/eclipse/cdt/managedbuilder/ui/properties/NewConfigurationDialog.java
+	* src/org/eclipse/cdt/managedbuilder/ui/properties/SummaryFieldEditor.java
+	* src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListLabelProvider.java
+	* src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedCProjectWizard.java
+	* src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java
+
 2004-02-27 John Camelon
-	New built-in compiler incldue search paths and defined symbols for the 
+	New built-in compiler include search paths and defined symbols for the 
 	Gnu C++ compiler on Cygwin.
 	* plugin.xml
 	
Index: src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderHelpContextIds.java
===================================================================
retrieving revision 1.1
diff -u -r1.1 ManagedBuilderHelpContextIds.java
--- src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderHelpContextIds.java	24 Sep 2003 14:20:49 -0000	1.1
+++ src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderHelpContextIds.java	2 Mar 2004 14:35:59 -0000
@@ -14,9 +14,9 @@
  * **********************************************************************/
 
 public interface ManagedBuilderHelpContextIds {
-	public static final String PREFIX= CUIPlugin.PLUGIN_ID + ".";
+	public static final String PREFIX= CUIPlugin.PLUGIN_ID + "."; //$NON-NLS-1$
 
 	// Wizard pages
-	public static final String MAN_PROJ_PLATFORM_HELP = PREFIX + "man_proj_platform_help";
+	public static final String MAN_PROJ_PLATFORM_HELP = PREFIX + "man_proj_platform_help"; //$NON-NLS-1$
 
 }
Index: src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java
===================================================================
retrieving revision 1.1
diff -u -r1.1 ManagedBuilderUIPlugin.java
--- src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java	15 Sep 2003 20:44:43 -0000	1.1
+++ src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java	2 Mar 2004 14:35:59 -0000
@@ -49,9 +49,9 @@
 		try {
 			return resourceBundle.getString(key);
 		} catch (MissingResourceException e) {
-			return "!" + key + "!";
+			return "!" + key + "!"; //$NON-NLS-1$ //$NON-NLS-2$
 		} catch (NullPointerException e) {
-			return "#" + key + "#";
+			return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
 		}
 	}
 
Index: src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties
===================================================================
retrieving revision 1.6
diff -u -r1.6 PluginResources.properties
--- src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties	17 Feb 2004 14:20:11 -0000	1.6
+++ src/org/eclipse/cdt/managedbuilder/internal/ui/PluginResources.properties	2 Mar 2004 14:35:59 -0000
@@ -48,6 +48,8 @@
 BuildPropertyPage.tip.addconf=Add configurations for the platform
 BuildPropertyPage.tip.remconf=Remove configurations for the platform
 BuildPropertyPage.manage.title=Manage
+BuildPropertyPage.error.Unknown_tree_element=Unknown type of element in tree of type {0}
+BrowseEntryDialog.error.Folder_name_invalid=Folder name invalid
 
 # ----------- New Configuration -----------
 NewConfiguration.label.name=Configuration name:
@@ -78,3 +80,4 @@
 BuildPropertyCommon.label.message=Value:
 BuildPropertyCommon.label.browse=Browse...
 BuildPropertyCommon.label.configs=Defined configurations:
+
Index: src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java
===================================================================
retrieving revision 1.3
diff -u -r1.3 BrowseEntryDialog.java
--- src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java	17 Feb 2004 14:20:11 -0000	1.3
+++ src/org/eclipse/cdt/managedbuilder/ui/properties/BrowseEntryDialog.java	2 Mar 2004 14:35:59 -0000
@@ -51,21 +51,22 @@
 	private static final String HIDE = "hideAdvanced"; //$NON-NLS-1$
 	private static final String SHOW = "showAdvanced"; //$NON-NLS-1$
 	private static final String EMPTY = "NewFolderDialog.folderNameEmpty"; //$NON-NLS-1$
+	private static final String ERROR_FOLDER_NAME_INVALID = PREFIX + ".error.Folder_name_invalid"; //$NON-NLS-1$
 	
 	/* (non-Javadoc)
 	 * The title of the dialog.
 	 */
-	private String title = "";
+	private String title = ""; //$NON-NLS-1$
 
 	/* (non-Javadoc)
 	 * The message to display, or <code>null</code> if none.
 	 */
-	private String message = "";
+	private String message = ""; //$NON-NLS-1$
 
 	/* (non-Javadoc)
 	 * The input value; the empty string by default.
 	 */
-	private String folderName = "";
+	private String folderName = ""; //$NON-NLS-1$
 	
 	/* (non-Javadoc)
 	 * 
@@ -320,14 +321,14 @@
 	protected void validateLocation() {
 		folderName = text.getText();
 		// Empty or null string is invalid
-		if (folderName == null || folderName.equals("")) {
+		if (folderName == null || folderName.equals("")) { //$NON-NLS-1$
 			updateStatus(IStatus.ERROR, IDEWorkbenchMessages.getString(EMPTY));
 			return;
 		} else {
 			// Make sure that the specified location exists
 			IPath path = new Path(folderName);
 			if (!path.isValidPath(folderName)) {
-				updateStatus(IStatus.ERROR, "Folder name invalid");
+				updateStatus(IStatus.ERROR, ManagedBuilderUIPlugin.getResourceString(ERROR_FOLDER_NAME_INVALID)); //$NON-NLS-1$
 				return;
 			}
 		}
Index: src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java
===================================================================
retrieving revision 1.5
diff -u -r1.5 BuildPropertyPage.java
--- src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java	24 Feb 2004 15:18:13 -0000	1.5
+++ src/org/eclipse/cdt/managedbuilder/ui/properties/BuildPropertyPage.java	2 Mar 2004 14:36:00 -0000
@@ -499,7 +499,7 @@
 					if (id < 0) {
 						id *= -1;
 					}
-					String newId = parent.getId() + "." + id;
+					String newId = parent.getId() + "." + id; //$NON-NLS-1$
 					IConfiguration newConfig = selectedTarget.createConfiguration(parent, newId);
 					newConfig.setName(name);
 					// Update the config lists
@@ -571,7 +571,7 @@
 			return result.toString().trim();
 		}
 
-		String[] tokens = arguments.trim().split("\\s");
+		String[] tokens = arguments.trim().split("\\s"); //$NON-NLS-1$
 		/*
 		 * Cases to consider
 		 * --<flag>					Sensible, modern single flag. Add to result and continue.
@@ -581,15 +581,15 @@
 		 * -<flag_with_arg>ARG		Corrupt case where next token should be arg but isn't
 		 * -<flags> [target]..		Flags with no args, another token, add flags and stop.
 		 */
-		Pattern flagPattern = Pattern.compile("C|f|I|j|l|O|W");
+		Pattern flagPattern = Pattern.compile("C|f|I|j|l|O|W"); //$NON-NLS-1$
 		// Look for a '-' followed by 1 or more flags with no args and exactly 1 that expects args
-		Pattern mixedFlagWithArg = Pattern.compile("-[^CfIjloW]*[CfIjloW]{1}.+");
+		Pattern mixedFlagWithArg = Pattern.compile("-[^CfIjloW]*[CfIjloW]{1}.+"); //$NON-NLS-1$
 		for (int i = 0; i < tokens.length; ++i) {
 			String currentToken = tokens[i];
-			if (currentToken.startsWith("--")) {
+			if (currentToken.startsWith("--")) { //$NON-NLS-1$
 				result.append(currentToken);
-				result.append(" ");
-			} else if (currentToken.startsWith("-")) {
+				result.append(" "); //$NON-NLS-1$
+			} else if (currentToken.startsWith("-")) { //$NON-NLS-1$
 				// Is there another token
 				if (i + 1 >= tokens.length) {
 					//We are done
@@ -601,19 +601,19 @@
 					if (!flagMatcher.find()) {
 						// Evalutate whether the next token should be added normally
 						result.append(currentToken);
-						result.append(" ");
+						result.append(" "); //$NON-NLS-1$
 					} else {
 						// Look for the case where there is no space between flag and arg
 						if (mixedFlagWithArg.matcher(currentToken).matches()) {
 							// Add this single token and keep going
 							result.append(currentToken);
-							result.append(" ");							
+							result.append(" ");							 //$NON-NLS-1$
 						} else {
 							// Add this token and the next one right now
 							result.append(currentToken);
-							result.append(" ");
+							result.append(" "); //$NON-NLS-1$
 							result.append(nextToken);
-							result.append(" ");
+							result.append(" "); //$NON-NLS-1$
 							// Skip the next token the next time through, though
 							++i;
 						}
@@ -635,7 +635,7 @@
 		boolean hasSpace = false;
 		
 		// Try to separate out the command from the arguments 
-		String[] result = rawCommand.split("\\s");
+		String[] result = rawCommand.split("\\s"); //$NON-NLS-1$
 		
 		/*
 		 * Here are the cases to consider:
@@ -653,14 +653,14 @@
 			} else {
 				// See if the next segment is the start of the flags
 				String nextSegment = result[i + 1];
-				if (nextSegment.startsWith("-")) {
+				if (nextSegment.startsWith("-")) { //$NON-NLS-1$
 					// we have found the end of the command
 					command.append(cmdSegment);
 					break;
 				} else {
 					command.append(cmdSegment);
 					// Add the whitespace back
-					command.append(" ");
+					command.append(" "); //$NON-NLS-1$
 					hasSpace = true;
 				}
 			}
Index: src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolsSettingsStore.java
===================================================================
retrieving revision 1.2
diff -u -r1.2 BuildToolsSettingsStore.java
--- src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolsSettingsStore.java	26 Sep 2003 19:54:33 -0000	1.2
+++ src/org/eclipse/cdt/managedbuilder/ui/properties/BuildToolsSettingsStore.java	2 Mar 2004 14:36:01 -0000
@@ -27,7 +27,7 @@
 import org.eclipse.jface.util.PropertyChangeEvent;
 
 public class BuildToolsSettingsStore implements IPreferenceStore {
-	public static final String DEFAULT_SEPERATOR = ";";
+	public static final String DEFAULT_SEPERATOR = ";"; //$NON-NLS-1$
 
 	// List of listeners on the property store
 	private ListenerList listenerList;
Index: src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java
===================================================================
retrieving revision 1.5
diff -u -r1.5 ManageConfigDialog.java
--- src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java	24 Feb 2004 15:18:13 -0000	1.5
+++ src/org/eclipse/cdt/managedbuilder/ui/properties/ManageConfigDialog.java	2 Mar 2004 14:36:01 -0000
@@ -71,7 +71,7 @@
 	// Map of new configurations chosen by the user
 	private SortedMap newConfigs;
 	// The title of the dialog.
-	private String title = "";
+	private String title = ""; //$NON-NLS-1$
 	// State of the check box on exit
 	private boolean useDefaultMake;
 	
@@ -178,7 +178,7 @@
 		
 		final Label dotLabel = new Label(outputGroup, SWT.CENTER);
 		dotLabel.setFont(outputGroup.getFont());
-		dotLabel.setText(new String("."));
+		dotLabel.setText(new String(".")); //$NON-NLS-1$
 		dotLabel.setLayoutData(new GridData());
 
 		buildArtifactExt = new Text(outputGroup, SWT.SINGLE | SWT.BORDER);
@@ -581,7 +581,7 @@
 		makeCommand = managedTarget.getMakeCommand();
 		String makeArgs = managedTarget.getMakeArguments();
 		if (makeArgs.length() > 0) {
-			makeCommand += " " + makeArgs;
+			makeCommand += " " + makeArgs; //$NON-NLS-1$
 		}
 	}
 
Index: src/org/eclipse/cdt/managedbuilder/ui/properties/NewConfigurationDialog.java
===================================================================
retrieving revision 1.2
diff -u -r1.2 NewConfigurationDialog.java
--- src/org/eclipse/cdt/managedbuilder/ui/properties/NewConfigurationDialog.java	24 Sep 2003 14:20:49 -0000	1.2
+++ src/org/eclipse/cdt/managedbuilder/ui/properties/NewConfigurationDialog.java	2 Mar 2004 14:36:01 -0000
@@ -53,7 +53,7 @@
 	private ITarget target;
 	private String newName;
 	private String [] allNames;
-	private String title = "";
+	private String title = ""; //$NON-NLS-1$
 
 	
 	/**
Index: src/org/eclipse/cdt/managedbuilder/ui/properties/SummaryFieldEditor.java
===================================================================
retrieving revision 1.1
diff -u -r1.1 SummaryFieldEditor.java
--- src/org/eclipse/cdt/managedbuilder/ui/properties/SummaryFieldEditor.java	15 Sep 2003 20:44:42 -0000	1.1
+++ src/org/eclipse/cdt/managedbuilder/ui/properties/SummaryFieldEditor.java	2 Mar 2004 14:36:01 -0000
@@ -21,7 +21,7 @@
 
 public class SummaryFieldEditor extends FieldEditor {
 	// Whitespace character
-	private static final String WHITESPACE = " ";
+	private static final String WHITESPACE = " "; //$NON-NLS-1$
 
 	// The top level composite
 	protected Composite parent;
Index: src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListLabelProvider.java
===================================================================
retrieving revision 1.1
diff -u -r1.1 ToolListLabelProvider.java
--- src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListLabelProvider.java	15 Sep 2003 20:44:42 -0000	1.1
+++ src/org/eclipse/cdt/managedbuilder/ui/properties/ToolListLabelProvider.java	2 Mar 2004 14:36:01 -0000
@@ -13,6 +13,7 @@
 
 import org.eclipse.cdt.managedbuilder.core.IOptionCategory;
 import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIImages;
+import org.eclipse.cdt.managedbuilder.internal.ui.ManagedBuilderUIPlugin;
 import org.eclipse.jface.viewers.LabelProvider;
 import org.eclipse.swt.graphics.Image;
  
@@ -20,6 +21,7 @@
 	private final Image IMG_TOOL = ManagedBuilderUIImages.get(ManagedBuilderUIImages.IMG_BUILD_TOOL);
 	private final Image IMG_CAT = ManagedBuilderUIImages.get(ManagedBuilderUIImages.IMG_BUILD_CAT);
 	private static final String TREE_LABEL = "BuildPropertyPage.label.ToolTree";	//$NON-NLS-1$
+	private static final String ERROR_UNKNOWN_ELEMENT = "BuildPropertyPage.error.Unknown_tree_element";	//$NON-NLS-1$
 
 	public Image getImage(Object element) {
 		// If the element is a configuration, return the folder image
@@ -51,6 +53,6 @@
 	}
 
 	protected RuntimeException unknownElement(Object element) {
-		return new RuntimeException("Unknown type of element in tree of type " + element.getClass().getName());
+		return new RuntimeException(ManagedBuilderUIPlugin.getFormattedString(ERROR_UNKNOWN_ELEMENT, element.getClass().getName()));
 	}
 }
Index: src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedCProjectWizard.java
===================================================================
retrieving revision 1.1
diff -u -r1.1 NewManagedCProjectWizard.java
--- src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedCProjectWizard.java	15 Sep 2003 20:44:43 -0000	1.1
+++ src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedCProjectWizard.java	2 Mar 2004 14:36:01 -0000
@@ -15,8 +15,8 @@
 
 public class NewManagedCProjectWizard extends NewManagedProjectWizard {
 	// String constants
-	private static final String WZ_TITLE = "MngCWizard.title";
-	private static final String WZ_DESC = "MngCWizard.description";
+	private static final String WZ_TITLE = "MngCWizard.title"; //$NON-NLS-1$
+	private static final String WZ_DESC = "MngCWizard.description"; //$NON-NLS-1$
 	private static final String SETTINGS_TITLE= "MngCWizardSettings.title"; //$NON-NLS-1$
 	private static final String SETTINGS_DESC= "MngCWizardSettings.description"; //$NON-NLS-1$
 
Index: src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java
===================================================================
retrieving revision 1.4
diff -u -r1.4 NewManagedProjectWizard.java
--- src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java	17 Feb 2004 14:20:11 -0000	1.4
+++ src/org/eclipse/cdt/managedbuilder/ui/wizards/NewManagedProjectWizard.java	2 Mar 2004 14:36:01 -0000
@@ -121,7 +121,7 @@
 					if (id < 0) {
 						id *= -1;
 					}
-					newTarget.createConfiguration(config, config.getId() + "." + id);
+					newTarget.createConfiguration(config, config.getId() + "." + id); //$NON-NLS-1$
 				}
 				// Now add the first config in the list as the default
 				IConfiguration[] newConfigs = newTarget.getConfigurations();
@@ -172,7 +172,7 @@
 	 * @see org.eclipse.cdt.ui.wizards.NewCProjectWizard#getProjectID()
 	 */
 	public String getProjectID() {
-		return "org.eclipse.cdt.make.core.make";
+		return "org.eclipse.cdt.make.core.make"; //$NON-NLS-1$
 //		return ManagedBuilderCorePlugin.getUniqueIdentifier() + ".make"; //$NON-NLS-1$
 	}
 

Back to the top