+ String configDir = System.getenv("CONFIG_DIR");
+ if (configDir == null) {
+ configDir = new File(System.getProperty("user.home"), ".fanfix")
+ .getPath();
+ }
+ if (configDir != null) {
+ if (!new File(configDir).exists()) {
+ new File(configDir).mkdirs();
+ } else {
+ Bundles.setDirectory(configDir);
+ }
+
+ try {
+ config = new ConfigBundle();
+ config.updateFile(configDir);
+ } catch (IOException e) {
+ syserr(e);
+ }
+ try {
+ uiconfig = new UiConfigBundle();
+ uiconfig.updateFile(configDir);
+ } catch (IOException e) {
+ syserr(e);
+ }
+ try {
+ trans = new StringIdBundle(getLang());
+ trans.updateFile(configDir);
+ } catch (IOException e) {
+ syserr(e);
+ }
+
+ Bundles.setDirectory(configDir);
+ }
+
+ uiconfig = new UiConfigBundle();