[258599] Message Bundles
diff --git a/plugins/org.eclipse.actf.ai.tts.sapi/src/messages.properties b/plugins/org.eclipse.actf.ai.tts.sapi/src/messages.properties
index 90f7462..cf9256d 100644
--- a/plugins/org.eclipse.actf.ai.tts.sapi/src/messages.properties
+++ b/plugins/org.eclipse.actf.ai.tts.sapi/src/messages.properties
@@ -8,8 +8,8 @@
# Contributors:
# IBM Corporation - initial API and implementation
###############################################################################
-tts.sapi.description=SAPI 5 TTS Settings
-tts.sapi.voicename=&Voice name:
-tts.sapi.audiooutput=&Audio Output Device:
-tts.sapi.notAvailable=SAPI 5 TTS is not Available
-tts.sapi.test=&Test
\ No newline at end of file
+tts_sapi_description=SAPI 5 TTS Settings
+tts_sapi_voicename=&Voice name:
+tts_sapi_audiooutput=&Audio Output Device:
+tts_sapi_notAvailable=SAPI 5 TTS is not Available
+tts_sapi_test=&Test
diff --git a/plugins/org.eclipse.actf.ai.tts.sapi/src/messages_ja.properties b/plugins/org.eclipse.actf.ai.tts.sapi/src/messages_ja.properties
index 6fc8595..e2558f5 100644
--- a/plugins/org.eclipse.actf.ai.tts.sapi/src/messages_ja.properties
+++ b/plugins/org.eclipse.actf.ai.tts.sapi/src/messages_ja.properties
@@ -8,8 +8,8 @@
# Contributors:
# IBM Corporation - initial API and implementation
###############################################################################
-tts.sapi.description=SAPI 5 TTS\u8a2d\u5b9a
-tts.sapi.voicename=\u97f3\u58f0(&V):
-tts.sapi.audiooutput=\u30aa\u30fc\u30c7\u30a3\u30aa\u518d\u751f\u30c7\u30d0\u30a4\u30b9(&A):
-tts.sapi.notAvailable=SAPI 5 TTS \u306f\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093
-tts.sapi.test=\u30c6\u30b9\u30c8(&T)
\ No newline at end of file
+tts_sapi_description=SAPI 5 TTS\u8a2d\u5b9a
+tts_sapi_voicename=\u97f3\u58f0(&V):
+tts_sapi_audiooutput=\u30aa\u30fc\u30c7\u30a3\u30aa\u518d\u751f\u30c7\u30d0\u30a4\u30b9(&A):
+tts_sapi_notAvailable=SAPI 5 TTS \u306f\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093
+tts_sapi_test=\u30c6\u30b9\u30c8(&T)
\ No newline at end of file
diff --git a/plugins/org.eclipse.actf.ai.tts.sapi/src/org/eclipse/actf/ai/tts/sapi/Messages.java b/plugins/org.eclipse.actf.ai.tts.sapi/src/org/eclipse/actf/ai/tts/sapi/Messages.java
index 82723f5..a52ce6a 100644
--- a/plugins/org.eclipse.actf.ai.tts.sapi/src/org/eclipse/actf/ai/tts/sapi/Messages.java
+++ b/plugins/org.eclipse.actf.ai.tts.sapi/src/org/eclipse/actf/ai/tts/sapi/Messages.java
@@ -8,34 +8,25 @@
* Contributors:
* Takashi ITOH - initial API and implementation
*******************************************************************************/
-
package org.eclipse.actf.ai.tts.sapi;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
+import org.eclipse.osgi.util.NLS;
-/**
- * This provides the resource string.
- */
-public class Messages {
- private static final String BUNDLE_NAME = "messages"; //$NON-NLS-1$
+public final class Messages extends NLS {
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
+ private static final String BUNDLE_NAME = "messages";//$NON-NLS-1$
private Messages() {
+ // Do not instantiate
}
- /**
- * @param key
- * the name of the resource string.
- * @return the string specified the key.
- */
- public static String getString(String key) {
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
+ public static String tts_sapi_description;
+ public static String tts_sapi_voicename;
+ public static String tts_sapi_audiooutput;
+ public static String tts_sapi_notAvailable;
+ public static String tts_sapi_test;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
-}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.actf.ai.tts.sapi/src/org/eclipse/actf/ai/tts/sapi/preferences/SapiPreferencePage.java b/plugins/org.eclipse.actf.ai.tts.sapi/src/org/eclipse/actf/ai/tts/sapi/preferences/SapiPreferencePage.java
index 148d5b8..fce14e1 100644
--- a/plugins/org.eclipse.actf.ai.tts.sapi/src/org/eclipse/actf/ai/tts/sapi/preferences/SapiPreferencePage.java
+++ b/plugins/org.eclipse.actf.ai.tts.sapi/src/org/eclipse/actf/ai/tts/sapi/preferences/SapiPreferencePage.java
@@ -35,13 +35,13 @@
public SapiPreferencePage() {
super();
- setDescription(Messages.getString("tts.sapi.description")); //$NON-NLS-1$
+ setDescription(Messages.tts_sapi_description);
setPreferenceStore(SAPIPlugin.getDefault().getPreferenceStore());
}
public void createFieldEditors() {
if (!TTSRegistry.isAvailable(SapiVoice.ID)) {
- setMessage(Messages.getString("tts.sapi.notAvailable"));
+ setMessage(Messages.tts_sapi_notAvailable);
return;
}
@@ -49,10 +49,8 @@
orgAudio = getPreferenceStore().getString(SapiVoice.AUDIO_OUTPUT);
final ComboFieldEditor voiceEditor, audioEditor;
- addField(voiceEditor = new SapiVoiceFieldEditor(Messages
- .getString("tts.sapi.voicename"), getFieldEditorParent())); //$NON-NLS-1$
- addField(audioEditor = new SapiAudioOutputFieldEditor(Messages
- .getString("tts.sapi.audiooutput"), getFieldEditorParent())); //$NON-NLS-1$
+ addField(voiceEditor = new SapiVoiceFieldEditor(Messages.tts_sapi_voicename, getFieldEditorParent())); //$NON-NLS-1$
+ addField(audioEditor = new SapiAudioOutputFieldEditor(Messages.tts_sapi_audiooutput, getFieldEditorParent())); //$NON-NLS-1$
Composite comp = new Composite(getFieldEditorParent(), SWT.NONE);
GridLayout layout = new GridLayout();
@@ -63,7 +61,7 @@
comp.setLayoutData(gd);
Button testButton = new Button(comp, SWT.NONE);
- testButton.setText(Messages.getString("tts.sapi.test"));
+ testButton.setText(Messages.tts_sapi_test);
testButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
SapiTestManager.getInstance().speakTest();
diff --git a/plugins/org.eclipse.actf.ai.voice/src/messages.properties b/plugins/org.eclipse.actf.ai.voice/src/messages.properties
index f78ffb2..ac9a91e 100644
--- a/plugins/org.eclipse.actf.ai.voice/src/messages.properties
+++ b/plugins/org.eclipse.actf.ai.voice/src/messages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2007 IBM Corporation and others.
+# Copyright (c) 2007, 2008 IBM Corporation and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
# Contributors:
# IBM Corporation - initial API and implementation
###############################################################################
-voice.description=Voice preferences
-voice.engine=TTS &engine
-voice.speed=&Speed:
-voice.test=&Test
+voice_description=Voice preferences
+voice_engine=TTS &engine
+voice_speed=&Speed:
+voice_test=&Test
diff --git a/plugins/org.eclipse.actf.ai.voice/src/messages_ja.properties b/plugins/org.eclipse.actf.ai.voice/src/messages_ja.properties
index 4b9afb7..2cc82db 100644
--- a/plugins/org.eclipse.actf.ai.voice/src/messages_ja.properties
+++ b/plugins/org.eclipse.actf.ai.voice/src/messages_ja.properties
@@ -1,4 +1,14 @@
-voice.description=\u97f3\u58f0\u8a2d\u5b9a
-voice.engine=TTS\u30a8\u30f3\u30b8\u30f3(&E)
-voice.speed=\u901f\u5ea6(&S):
-voice.test=\u30c6\u30b9\u30c8(&T)
+###############################################################################
+# Copyright (c) 2007, 2008 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+voice_description=\u97f3\u58f0\u8a2d\u5b9a
+voice_engine=TTS\u30a8\u30f3\u30b8\u30f3(&E)
+voice_speed=\u901f\u5ea6(&S):
+voice_test=\u30c6\u30b9\u30c8(&T)
diff --git a/plugins/org.eclipse.actf.ai.voice/src/org/eclipse/actf/ai/voice/internal/Messages.java b/plugins/org.eclipse.actf.ai.voice/src/org/eclipse/actf/ai/voice/internal/Messages.java
index f3bc8e9..5ed30b4 100644
--- a/plugins/org.eclipse.actf.ai.voice/src/org/eclipse/actf/ai/voice/internal/Messages.java
+++ b/plugins/org.eclipse.actf.ai.voice/src/org/eclipse/actf/ai/voice/internal/Messages.java
@@ -8,35 +8,24 @@
* Contributors:
* Takashi ITOH - initial API and implementation
*******************************************************************************/
-
package org.eclipse.actf.ai.voice.internal;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
+import org.eclipse.osgi.util.NLS;
-/**
- * This provides the resource string.
- */
-public class Messages {
- private static final String BUNDLE_NAME = "messages"; //$NON-NLS-1$
+public final class Messages extends NLS {
- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
- .getBundle(BUNDLE_NAME);
+ private static final String BUNDLE_NAME = "messages";//$NON-NLS-1$
private Messages() {
+ // Do not instantiate
}
- /**
- * @param key
- * the name of the resource string.
- * @return the string specified the key.
- */
- public static String getString(String key) {
- // TODO Auto-generated method stub
- try {
- return RESOURCE_BUNDLE.getString(key);
- } catch (MissingResourceException e) {
- return '!' + key + '!';
- }
+ public static String voice_description;
+ public static String voice_engine;
+ public static String voice_speed;
+ public static String voice_test;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
-}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.actf.ai.voice/src/org/eclipse/actf/ai/voice/preferences/VoicePreferencePage.java b/plugins/org.eclipse.actf.ai.voice/src/org/eclipse/actf/ai/voice/preferences/VoicePreferencePage.java
index 644a5cb..6dfe9ff 100644
--- a/plugins/org.eclipse.actf.ai.voice/src/org/eclipse/actf/ai/voice/preferences/VoicePreferencePage.java
+++ b/plugins/org.eclipse.actf.ai.voice/src/org/eclipse/actf/ai/voice/preferences/VoicePreferencePage.java
@@ -40,15 +40,14 @@
public VoicePreferencePage() {
super();
setPreferenceStore(VoicePlugin.getDefault().getPreferenceStore());
- setDescription(Messages.getString("voice.description")); //$NON-NLS-1$
+ setDescription(Messages.voice_description);
}
public void createFieldEditors() {
final RadioGroupFieldEditor rgfe;
String[][] labelAndIds = TTSRegistry.getLabelAndIds();
- addField(rgfe = new RadioGroupFieldEditor(IVoice.PREF_ENGINE, Messages
- .getString("voice.engine"), 1, labelAndIds, //$NON-NLS-1$
+ addField(rgfe = new RadioGroupFieldEditor(IVoice.PREF_ENGINE, Messages.voice_engine, 1, labelAndIds, //$NON-NLS-1$
getFieldEditorParent()));
Composite c = rgfe.getRadioBoxControl(getFieldEditorParent());
for (int i = 0; i < labelAndIds.length; i++) {
@@ -59,7 +58,7 @@
final ScaleFieldEditor speedEditor;
addField(speedEditor = new ScaleFieldEditor(IVoice.PREF_SPEED,
- Messages.getString("voice.speed"), //$NON-NLS-1$
+ Messages.voice_speed,
getFieldEditorParent(), IVoice.SPEED_MIN, IVoice.SPEED_MAX, 5,
25));
@@ -72,7 +71,7 @@
comp.setLayoutData(gd);
Button testButton = new Button(comp, SWT.NONE);
- testButton.setText(Messages.getString("voice.test"));
+ testButton.setText(Messages.voice_test);
testButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
diff --git a/plugins/org.eclipse.actf.ai.voice/src/org/eclipse/actf/ai/voice/preferences/util/ComboButtonFieldEditor.java b/plugins/org.eclipse.actf.ai.voice/src/org/eclipse/actf/ai/voice/preferences/util/ComboButtonFieldEditor.java
index 0e57ca5..958bb67 100644
--- a/plugins/org.eclipse.actf.ai.voice/src/org/eclipse/actf/ai/voice/preferences/util/ComboButtonFieldEditor.java
+++ b/plugins/org.eclipse.actf.ai.voice/src/org/eclipse/actf/ai/voice/preferences/util/ComboButtonFieldEditor.java
@@ -67,7 +67,7 @@
if (testButton == null) {
testButton = new Button(parent, SWT.PUSH);
if (testButtonText == null)
- testButtonText = Messages.getString("voice.test"); //$NON-NLS-1$
+ testButtonText = Messages.voice_test;
testButton.setText(testButtonText);
testButton.setFont(parent.getFont());
testButton.addSelectionListener(new SelectionAdapter() {