summaryrefslogtreecommitdiff
path: root/BKUApplet/src/main/java
diff options
context:
space:
mode:
authorclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2008-11-03 12:36:42 +0000
committerclemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2008-11-03 12:36:42 +0000
commit6211ed7f96c4ee6e1616a7c1e44477b9f3e8117f (patch)
treec419abc42763c58d9e77e473c95e63addc8ccb0a /BKUApplet/src/main/java
parent16b188bae57cfc10c94a0e251a815ab35345e113 (diff)
downloadmocca-6211ed7f96c4ee6e1616a7c1e44477b9f3e8117f.tar.gz
mocca-6211ed7f96c4ee6e1616a7c1e44477b9f3e8117f.tar.bz2
mocca-6211ed7f96c4ee6e1616a7c1e44477b9f3e8117f.zip
localization
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@140 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'BKUApplet/src/main/java')
-rw-r--r--BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java20
-rw-r--r--BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java17
2 files changed, 13 insertions, 24 deletions
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
index 50d66d80..bde055ec 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
@@ -40,7 +40,6 @@ public class BKUApplet extends JApplet {
private static Log log = LogFactory.getLog(BKUApplet.class);
public static final String GUI_STYLE = "GuiStyle";
- public final static String RESOURCE_BUNDLE_BASE = "at/gv/egiz/bku/online/applet/Messages";
public final static String LOCALE_PARAM_KEY = "Locale";
public final static String LOGO_URL_KEY = "LogoURL";
public final static String WSDL_URL = "WSDL_URL";
@@ -52,7 +51,6 @@ public class BKUApplet extends JApplet {
public static final String REDIRECT_URL = "RedirectURL";
public static final String REDIRECT_TARGET = "RedirectTarget";
public static final String HASHDATA_DISPLAY_INTERNAL = "internal";
- protected ResourceBundle resourceBundle;
protected BKUWorker worker;
protected Thread workerThread;
@@ -64,14 +62,9 @@ public class BKUApplet extends JApplet {
log.info("Welcome to MOCCA\n");
log.debug("Called init()");
HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory.getInstance());
- String localeString = getMyAppletParameter(LOCALE_PARAM_KEY);
- Locale locale = null;
- if (localeString != null) {
- locale = new Locale(localeString);
- resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE,
- locale);
- } else {
- resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE);
+ String locale = getMyAppletParameter(LOCALE_PARAM_KEY);
+ if (locale != null) {
+ this.setLocale(new Locale(locale));
}
String backgroundString = getMyAppletParameter(BACKGROUND_PARAM);
URL background = null;
@@ -84,15 +77,16 @@ public class BKUApplet extends JApplet {
}
String guiStyle = getMyAppletParameter(GUI_STYLE);
BKUGUIFacade gui = BKUGUIFactory.createGUI(guiStyle);
+ log.debug("setting GUI locale to " + getLocale());
AppletHelpListener helpListener = null;
try {
URL helpURL = getMyAppletParameterURL(HELP_URL);
- helpListener = new AppletHelpListener(getAppletContext(), helpURL, locale);
+ helpListener = new AppletHelpListener(getAppletContext(), helpURL, getLocale());
} catch (MalformedURLException ex) {
log.error("invalid help URL: " + ex.getMessage());
}
- gui.init(getContentPane(), localeString, background, helpListener);
- worker = new BKUWorker(gui, this, resourceBundle);
+ gui.init(getContentPane(), getLocale(), background, helpListener);
+ worker = new BKUWorker(gui, this);
}
@Override
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java
index 78f3dc12..843f6c4c 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java
@@ -48,7 +48,6 @@ import at.gv.egiz.stal.service.types.ObjectFactory;
import at.gv.egiz.stal.service.types.RequestType;
import at.gv.egiz.stal.service.types.ResponseType;
import at.gv.egiz.stal.util.STALTranslator;
-import javax.naming.ConfigurationException;
public class BKUWorker extends AbstractSMCCSTAL implements Runnable,
ActionListener, SMCCSTALRequestHandler {
@@ -57,25 +56,22 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable,
protected BKUGUIFacade gui;
protected BKUApplet parent;
private STALPortType stalPort;
-// private URL hashDataURL;
protected List<String> actionCommandList = new ArrayList<String>();
protected Boolean actionPerformed = false;
protected boolean finished = false;
- protected ResourceBundle errorMessages;
/**
*
* @param gui
* must not be null
*/
- public BKUWorker(BKUGUIFacade gui, BKUApplet parent,
- ResourceBundle errorMessageBundle) {
- if ((gui == null) || (parent == null) || (errorMessageBundle == null)) {
+ public BKUWorker(BKUGUIFacade gui, BKUApplet parent) {
+ if (gui == null || parent == null) {
throw new NullPointerException("Parameter must not be set to null");
}
this.gui = gui;
+ this.locale = gui.getLocale();
this.parent = parent;
- this.errorMessages = errorMessageBundle;
addRequestHandler(QuitRequest.class, this);
// register SignRequestHandler once we have a webservice port
}
@@ -86,9 +82,9 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable,
* @param gui
* @param errorMessageBundle
*/
- protected BKUWorker(BKUGUIFacade gui, ResourceBundle errorMessageBundle) {
+ protected BKUWorker(BKUGUIFacade gui) {
this.gui = gui;
- this.errorMessages = errorMessageBundle;
+ this.locale = gui.getLocale();
addRequestHandler(QuitRequest.class, this);
}
@@ -342,8 +338,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable,
}
break;
case SMCCHelper.CARD_FOUND:
- // gui.showWaitDialog(null);
- signatureCard = smccHelper.getSignatureCard(errorMessages.getLocale());
+ signatureCard = smccHelper.getSignatureCard(locale);
return false;
}
smccHelper.update(3000);