mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
bug 53213 Externalize Strings for Tanya Wolff
This commit is contained in:
parent
a84395e43f
commit
ba12f674af
15 changed files with 154 additions and 26 deletions
|
@ -1,3 +1,16 @@
|
|||
2004-03-02 Tanya Wolff
|
||||
|
||||
Fixed missing key for Working Set name and content on
|
||||
new C/C++ Working set dialog. Also added error handling for when
|
||||
properties files are not found.
|
||||
|
||||
All *Messages.java files are affected by the error handling.
|
||||
|
||||
The fix for working set is in:
|
||||
|
||||
* src/org/eclipse/cdt/internal/ui/workingsets/CElementWorkingSetPage.java
|
||||
|
||||
|
||||
2004-03-02 Alain Magloire
|
||||
|
||||
From Dave Daoust:
|
||||
|
|
|
@ -12,8 +12,14 @@ import java.util.ResourceBundle;
|
|||
public class TemplateMessages {
|
||||
|
||||
private static final String RESOURCE_BUNDLE= TemplateMessages.class.getName();
|
||||
private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
|
||||
|
||||
private static ResourceBundle fgResourceBundle;
|
||||
static {
|
||||
try {
|
||||
fgResourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE);
|
||||
} catch (MissingResourceException x) {
|
||||
fgResourceBundle = null;
|
||||
}
|
||||
}
|
||||
private TemplateMessages() {
|
||||
}
|
||||
|
||||
|
@ -22,6 +28,8 @@ public class TemplateMessages {
|
|||
return fgResourceBundle.getString(key);
|
||||
} catch (MissingResourceException e) {
|
||||
return '!' + key + '!';
|
||||
} catch (NullPointerException e) {
|
||||
return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,8 +12,14 @@ import java.util.ResourceBundle;
|
|||
public class TemplateMessages {
|
||||
|
||||
private static final String RESOURCE_BUNDLE= TemplateMessages.class.getName();
|
||||
private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
|
||||
|
||||
private static ResourceBundle fgResourceBundle;
|
||||
static {
|
||||
try {
|
||||
fgResourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE);
|
||||
} catch (MissingResourceException x) {
|
||||
fgResourceBundle = null;
|
||||
}
|
||||
}
|
||||
private TemplateMessages() {
|
||||
}
|
||||
|
||||
|
@ -22,6 +28,8 @@ public class TemplateMessages {
|
|||
return fgResourceBundle.getString(key);
|
||||
} catch (MissingResourceException e) {
|
||||
return '!' + key + '!';
|
||||
} catch (NullPointerException e) {
|
||||
return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,16 +19,25 @@ public class TextManipulationMessages {
|
|||
|
||||
private static final String BUNDLE_NAME= "org.eclipse.cdt.internal.corext.textmanipulation.Messages"; //$NON-NLS-1$
|
||||
|
||||
private static final ResourceBundle RESOURCE_BUNDLE= ResourceBundle.getBundle(BUNDLE_NAME);
|
||||
private static ResourceBundle fgResourceBundle;
|
||||
static {
|
||||
try {
|
||||
fgResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
|
||||
} catch (MissingResourceException x) {
|
||||
fgResourceBundle = null;
|
||||
}
|
||||
}
|
||||
|
||||
private TextManipulationMessages() {
|
||||
}
|
||||
|
||||
public static String getString(String key) {
|
||||
try {
|
||||
return RESOURCE_BUNDLE.getString(key);
|
||||
return fgResourceBundle.getString(key);
|
||||
} catch (MissingResourceException e) {
|
||||
return '!' + key + '!';
|
||||
} catch (NullPointerException e) {
|
||||
return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,14 @@ public class CUIMessages {
|
|||
|
||||
private static final String RESOURCE_BUNDLE= "org.eclipse.cdt.internal.ui.CUIMessages";//$NON-NLS-1$
|
||||
|
||||
private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
|
||||
private static ResourceBundle fgResourceBundle;
|
||||
static {
|
||||
try {
|
||||
fgResourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE);
|
||||
} catch (MissingResourceException x) {
|
||||
fgResourceBundle = null;
|
||||
}
|
||||
}
|
||||
|
||||
private CUIMessages() {
|
||||
}
|
||||
|
@ -28,6 +35,8 @@ public class CUIMessages {
|
|||
return fgResourceBundle.getString(key);
|
||||
} catch (MissingResourceException e) {
|
||||
return '!' + key + '!';
|
||||
} catch (NullPointerException e) {
|
||||
return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,14 @@ public class ActionMessages {
|
|||
|
||||
private static final String BUNDLE_NAME= "org.eclipse.cdt.internal.ui.actions.ActionMessages"; //$NON-NLS-1$
|
||||
|
||||
private static final ResourceBundle RESOURCE_BUNDLE= ResourceBundle.getBundle(BUNDLE_NAME);
|
||||
private static ResourceBundle fgResourceBundle;
|
||||
static {
|
||||
try {
|
||||
fgResourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
|
||||
} catch (MissingResourceException x) {
|
||||
fgResourceBundle = null;
|
||||
}
|
||||
}
|
||||
|
||||
private ActionMessages() {
|
||||
// no instance
|
||||
|
@ -37,9 +44,11 @@ public class ActionMessages {
|
|||
*/
|
||||
public static String getString(String key) {
|
||||
try {
|
||||
return RESOURCE_BUNDLE.getString(key);
|
||||
return fgResourceBundle.getString(key);
|
||||
} catch (MissingResourceException e) {
|
||||
return '!' + key + '!';
|
||||
} catch (NullPointerException e) {
|
||||
return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,14 @@ public class CViewMessages {
|
|||
|
||||
private static final String RESOURCE_BUNDLE= "org.eclipse.cdt.internal.ui.cview.CViewMessages";//$NON-NLS-1$
|
||||
|
||||
private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
|
||||
private static ResourceBundle fgResourceBundle;
|
||||
static {
|
||||
try {
|
||||
fgResourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE);
|
||||
} catch (MissingResourceException x) {
|
||||
fgResourceBundle = null;
|
||||
}
|
||||
}
|
||||
|
||||
private CViewMessages() {
|
||||
}
|
||||
|
@ -28,6 +35,8 @@ public class CViewMessages {
|
|||
return fgResourceBundle.getString(key);
|
||||
} catch (MissingResourceException e) {
|
||||
return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
|
||||
} catch (NullPointerException e) {
|
||||
return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,14 @@ public class CEditorMessages
|
|||
private static final String RESOURCE_BUNDLE = "org.eclipse.cdt.internal.ui.editor.CEditorMessages"; //$NON-NLS-1$
|
||||
|
||||
|
||||
private static ResourceBundle fgResourceBundle = ResourceBundle.getBundle( RESOURCE_BUNDLE );
|
||||
private static ResourceBundle fgResourceBundle;
|
||||
static {
|
||||
try {
|
||||
fgResourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE);
|
||||
} catch (MissingResourceException x) {
|
||||
fgResourceBundle = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private CEditorMessages()
|
||||
|
@ -36,6 +43,8 @@ public class CEditorMessages
|
|||
catch( MissingResourceException e )
|
||||
{
|
||||
return "!" + key + "!"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
} catch (NullPointerException e) {
|
||||
return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,14 @@ public class OpenTypeMessages {
|
|||
|
||||
private static final String RESOURCE_BUNDLE= "org.eclipse.cdt.internal.ui.opentype.OpenTypeMessages";//$NON-NLS-1$
|
||||
|
||||
private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
|
||||
private static ResourceBundle fgResourceBundle;
|
||||
static {
|
||||
try {
|
||||
fgResourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE);
|
||||
} catch (MissingResourceException x) {
|
||||
fgResourceBundle = null;
|
||||
}
|
||||
}
|
||||
|
||||
private OpenTypeMessages() {
|
||||
}
|
||||
|
@ -28,6 +35,8 @@ public class OpenTypeMessages {
|
|||
return fgResourceBundle.getString(key);
|
||||
} catch (MissingResourceException e) {
|
||||
return '!' + key + '!';
|
||||
} catch (NullPointerException e) {
|
||||
return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,14 @@ public class PreferencesMessages {
|
|||
|
||||
private static final String RESOURCE_BUNDLE= "org.eclipse.cdt.internal.ui.preferences.PreferencesMessages";//$NON-NLS-1$
|
||||
|
||||
private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
|
||||
private static ResourceBundle fgResourceBundle;
|
||||
static {
|
||||
try {
|
||||
fgResourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE);
|
||||
} catch (MissingResourceException x) {
|
||||
fgResourceBundle = null;
|
||||
}
|
||||
}
|
||||
|
||||
private PreferencesMessages() {
|
||||
}
|
||||
|
@ -28,6 +35,8 @@ public class PreferencesMessages {
|
|||
return fgResourceBundle.getString(key);
|
||||
} catch (MissingResourceException e) {
|
||||
return '!' + key + '!';
|
||||
} catch (NullPointerException e) {
|
||||
return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,14 @@ import java.util.ResourceBundle;
|
|||
public class CSearchMessages {
|
||||
private static final String RESOURCE_BUNDLE= CSearchMessages.class.getName();
|
||||
|
||||
private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
|
||||
private static ResourceBundle fgResourceBundle;
|
||||
static {
|
||||
try {
|
||||
fgResourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE);
|
||||
} catch (MissingResourceException x) {
|
||||
fgResourceBundle = null;
|
||||
}
|
||||
}
|
||||
|
||||
private CSearchMessages() {
|
||||
}
|
||||
|
@ -36,6 +43,8 @@ public class CSearchMessages {
|
|||
return fgResourceBundle.getString(key);
|
||||
} catch (MissingResourceException e) {
|
||||
return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
|
||||
} catch (NullPointerException e) {
|
||||
return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
|
|
@ -12,7 +12,14 @@ import java.util.ResourceBundle;
|
|||
public class LinkedPositionMessages {
|
||||
|
||||
private static final String RESOURCE_BUNDLE= LinkedPositionMessages.class.getName();
|
||||
private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
|
||||
private static ResourceBundle fgResourceBundle;
|
||||
static {
|
||||
try {
|
||||
fgResourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE);
|
||||
} catch (MissingResourceException x) {
|
||||
fgResourceBundle = null;
|
||||
}
|
||||
}
|
||||
|
||||
private LinkedPositionMessages() {
|
||||
}
|
||||
|
@ -22,6 +29,8 @@ public class LinkedPositionMessages {
|
|||
return fgResourceBundle.getString(key);
|
||||
} catch (MissingResourceException e) {
|
||||
return '!' + key + '!';
|
||||
} catch (NullPointerException e) {
|
||||
return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,14 @@ import java.util.ResourceBundle;
|
|||
public class NewWizardMessages {
|
||||
|
||||
private static final String RESOURCE_BUNDLE= NewWizardMessages.class.getName();
|
||||
private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
|
||||
private static ResourceBundle fgResourceBundle;
|
||||
static {
|
||||
try {
|
||||
fgResourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE);
|
||||
} catch (MissingResourceException x) {
|
||||
fgResourceBundle = null;
|
||||
}
|
||||
}
|
||||
|
||||
private NewWizardMessages() {
|
||||
}
|
||||
|
@ -29,6 +36,8 @@ public class NewWizardMessages {
|
|||
return fgResourceBundle.getString(key);
|
||||
} catch (MissingResourceException e) {
|
||||
return '!' + key + '!';
|
||||
} catch (NullPointerException e) {
|
||||
return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,8 @@ import org.eclipse.ui.model.WorkbenchLabelProvider;
|
|||
public class CElementWorkingSetPage extends WizardPage implements IWorkingSetPage {
|
||||
|
||||
final private static String PAGE_TITLE= WorkingSetMessages.getString("CElementWorkingSetPage.title"); //$NON-NLS-1$
|
||||
final private static String PAGE_ID= WorkingSetMessages.getString("CElementWorkingSetPage"); //$NON-NLS-1$
|
||||
//final private static String PAGE_ID= WorkingSetMessages.getString("CElementWorkingSetPage"); //$NON-NLS-1$
|
||||
final private static String PAGE_ID= "CElementWorkingSetPage"; //$NON-NLS-1$
|
||||
|
||||
private final static int SIZING_SELECTION_WIDGET_WIDTH = 50;
|
||||
private final static int SIZING_SELECTION_WIDGET_HEIGHT = 200;
|
||||
|
@ -118,7 +119,7 @@ public class CElementWorkingSetPage extends WizardPage implements IWorkingSetPag
|
|||
|
||||
//WorkbenchHelp.setHelp(composite, IHelpContextIds.WORKING_SET_RESOURCE_PAGE);
|
||||
Label label = new Label(composite, SWT.WRAP);
|
||||
label.setText(WorkingSetMessages.getString("CElementWorkingSetPage.content")); //$NON-NLS-1$
|
||||
label.setText(WorkingSetMessages.getString("CElementWorkingSetPage.name")); //$NON-NLS-1$
|
||||
GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
|
||||
label.setLayoutData(data);
|
||||
label.setFont(font);
|
||||
|
@ -136,7 +137,7 @@ public class CElementWorkingSetPage extends WizardPage implements IWorkingSetPag
|
|||
text.setFocus();
|
||||
|
||||
label = new Label(composite, SWT.WRAP);
|
||||
label.setText(WorkingSetMessages.getString("CElementWorkingSetPage.label.tree")); //$NON-NLS-1$
|
||||
label.setText(WorkingSetMessages.getString("CElementWorkingSetPage.content")); //$NON-NLS-1$
|
||||
data = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
|
||||
label.setLayoutData(data);
|
||||
label.setFont(font);
|
||||
|
|
|
@ -18,8 +18,14 @@ class WorkingSetMessages {
|
|||
|
||||
private static final String RESOURCE_BUNDLE= WorkingSetMessages.class.getName();
|
||||
|
||||
private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
|
||||
|
||||
private static ResourceBundle fgResourceBundle;
|
||||
static {
|
||||
try {
|
||||
fgResourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE);
|
||||
} catch (MissingResourceException x) {
|
||||
fgResourceBundle = null;
|
||||
}
|
||||
}
|
||||
private WorkingSetMessages() {
|
||||
}
|
||||
|
||||
|
@ -28,6 +34,8 @@ class WorkingSetMessages {
|
|||
return fgResourceBundle.getString(key);
|
||||
} catch (MissingResourceException e) {
|
||||
return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
|
||||
} catch (NullPointerException e) {
|
||||
return "#" + key + "#"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue