this is fixed in revision 2560.

ede 

On 29.12.2011 22:06, Stefan Steiniger wrote:
> oh well, thanks for the tip ... then I have to do some more searching. 
> Sadly I could not figure yet where the german word used in the tooltip 
> is stored.
> 
> stefan
> 
> Am 29.12.11 21:34, schrieb Michaël Michaud:
>> Hi Stefan,
>>
>> For undo redo, the tooltip depends on the action to undo/redo.
>> So this is not a fixed string but a dynamic one.
>> Don't remember the details of how and when the tooltip is called.
>>
>> Hope that helps,
>>
>> Michaël
>>
>> Le 29/12/2011 19:43, Stefan Steiniger a écrit :
>>> so - not just to Ede but to everyone.
>>>
>>> Hei, so I am trying to figure out what is going wrong with the tooltip
>>> strings for undo&   redo buttons in the toolbar.
>>> It is that strings are not translated in the plugins, so I changed that.
>>>
>>> However, my new strings that are assigned with getName() in the button
>>> initialization of JUMPWorkbenchConfiguration file are somehow later
>>> magically replaced by other german strings?
>>>
>>> Can anyone shed light on what happens?
>>>
>>> stefan
>>>
>>> Am 29.12.11 18:32, schrieb Stefan Steiniger:
>>>> uhh.. its actually the same for the undo&    redo buttons tooltip texts in
>>>> the main toolbar (its in German instead in English)
>>>>
>>>> i.e. do we treat the "-18n" switch issue as "bug" or as "not supported"
>>>> anymore. Though, I would like to keep things inline (=bug) with (my)
>>>> previous efforts for "-i18n" Where strings are variables and load in
>>>> runtime.
>>>>
>>>> any opinions?
>>>>
>>>> stefan
>>>>
>>>> Am 29.12.11 18:11, schrieb Stefan Steiniger:
>>>>> Hei Ede,
>>>>>
>>>>> when I start OJ with the -18n en option (my quick switch for development
>>>>> and testing), then your menu in [Tools>Edit Geometry>Ausgewählte
>>>>> Geometrien/... ] is in German and not in English.
>>>>>
>>>>> do you know why?
>>>>>
>>>>> cheers from Chemnitz,
>>>>> stefan
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
>>>>> infrastructure or vast IT resources to deliver seamless, secure access to
>>>>> virtual desktops. With this all-in-one solution, easily deploy virtual
>>>>> desktops for less than the cost of PCs and save 60% on VDI infrastructure
>>>>> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
>>>>> _______________________________________________
>>>>> Jump-pilot-devel mailing list
>>>>> Jump-pilot-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>>> ------------------------------------------------------------------------------
>>>> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
>>>> infrastructure or vast IT resources to deliver seamless, secure access to
>>>> virtual desktops. With this all-in-one solution, easily deploy virtual
>>>> desktops for less than the cost of PCs and save 60% on VDI infrastructure
>>>> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
>>>> _______________________________________________
>>>> Jump-pilot-devel mailing list
>>>> Jump-pilot-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>> ------------------------------------------------------------------------------
>>> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
>>> infrastructure or vast IT resources to deliver seamless, secure access to
>>> virtual desktops. With this all-in-one solution, easily deploy virtual
>>> desktops for less than the cost of PCs and save 60% on VDI infrastructure
>>> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
>>> _______________________________________________
>>> Jump-pilot-devel mailing list
>>> Jump-pilot-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
>> infrastructure or vast IT resources to deliver seamless, secure access to
>> virtual desktops. With this all-in-one solution, easily deploy virtual
>> desktops for less than the cost of PCs and save 60% on VDI infrastructure
>> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
>> _______________________________________________
>> Jump-pilot-devel mailing list
>> Jump-pilot-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> 
> ------------------------------------------------------------------------------
> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
> infrastructure or vast IT resources to deliver seamless, secure access to
> virtual desktops. With this all-in-one solution, easily deploy virtual 
> desktops for less than the cost of PCs and save 60% on VDI infrastructure 
> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
--- Begin Message ---
Revision: 2560
          http://jump-pilot.svn.sourceforge.net/jump-pilot/?rev=2560&view=rev
Author:   edso
Date:     2011-12-31 12:25:15 +0000 (Sat, 31 Dec 2011)
Log Message:
-----------
- bugfix: -i18n was not applied globally as default locale

Modified Paths:
--------------
    core/trunk/ChangeLog
    core/trunk/src/com/vividsolutions/jump/I18N.java
    core/trunk/src/com/vividsolutions/jump/workbench/JUMPWorkbench.java

Modified: core/trunk/ChangeLog
===================================================================
--- core/trunk/ChangeLog        2011-12-30 14:55:38 UTC (rev 2559)
+++ core/trunk/ChangeLog        2011-12-31 12:25:15 UTC (rev 2560)
@@ -1,6 +1,7 @@
 # for display continuity sake please use 2 spaces instead of tabs
 
 2011-12-30 ede
+  - bugfix: -i18n was not applied globally as default locale
   - bugfix 3439132: File dialog item for all supported files is too long
   - OpenWizard is now also centered on main window similar to other Wizards
   - added hint to not use tabs in ChangeLog, replaced sneaked in tabs with 
double spaces

Modified: core/trunk/src/com/vividsolutions/jump/I18N.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/I18N.java    2011-12-30 14:55:38 UTC 
(rev 2559)
+++ core/trunk/src/com/vividsolutions/jump/I18N.java    2011-12-31 12:25:15 UTC 
(rev 2560)
@@ -34,14 +34,14 @@
 import java.text.MessageFormat;
 import java.util.HashMap;
 import java.util.Hashtable;
+import java.util.Locale;
 import java.util.Map;
 import java.util.ResourceBundle;
-import java.util.Locale;
 
+import org.apache.log4j.Logger;
+
 import com.vividsolutions.jump.workbench.JUMPWorkbench;
 
-import org.apache.log4j.Logger;
-
 /**
  * Singleton for the Internationalization (I18N)
  * 
@@ -103,7 +103,7 @@
   // STanner changed the place where are stored bundles. Now are in /language
   // public static ResourceBundle rb =
   // ResourceBundle.getBundle("com.vividsolutions.jump.jump");
-  public static ResourceBundle rb = ResourceBundle.getBundle("language/jump");
+  private static ResourceBundle jumpResourceBundle = 
ResourceBundle.getBundle("language/jump");
 
   // [Michael Michaud 2007-03-23] plugInsResourceBundle is deactivated because
   // all the methods
@@ -121,7 +121,7 @@
 
   /** The core OpenJUMP I18N instance. */
   private I18N() {
-    resourceBundle = rb;
+    resourceBundle = jumpResourceBundle;
   }
 
   /**
@@ -201,18 +201,11 @@
     // return SingletonHolder._singleton;
   }
 
-  /**
-   * Load file specified in command line (-i18n lang_country) (lang_country
-   * :language 2 letters + "_" + country 2 letters) Tries first to extract lang
-   * and country, and if only lang is specified, loads the corresponding
-   * resource bundle.
-   * 
-   * @param langcountry
-   */
-  public static void loadFile(final String langcountry) {
+  // [ede] utility method as it is used in several places 
(loadFile,getLanguage...)
+  public static Locale fromCode(final String localeCode) {
     // [Michael Michaud 2007-03-04] handle the case where lang is the only
     // variable instead of catching an ArrayIndexOutOfBoundsException
-    String[] lc = langcountry.split("_");
+    String[] lc = localeCode.split("_");
     Locale locale = Locale.getDefault();
     if (lc.length > 1) {
       LOG.debug("lang:" + lc[0] + " " + "country:" + lc[1]);
@@ -221,12 +214,32 @@
       LOG.debug("lang:" + lc[0]);
       locale = new Locale(lc[0]);
     } else {
-      LOG.debug(langcountry
+      LOG.debug(localeCode
         + " is an illegal argument to define lang [and country]");
     }
-    rb = ResourceBundle.getBundle("language/jump", locale);
+    
+    return locale;
   }
+  
+  /**
+   * Load file specified in command line (-i18n lang_country) (lang_country
+   * :language 2 letters + "_" + country 2 letters) Tries first to extract lang
+   * and country, and if only lang is specified, loads the corresponding
+   * resource bundle.
+   * 
+   * @param langcountry
+   */
+  public static void loadFile(final String langcountry) {
+    jumpResourceBundle = ResourceBundle.getBundle("language/jump", 
fromCode(langcountry));
+  }
 
+  public static void applyToRuntime() {
+    Locale loc = jumpResourceBundle.getLocale();
+    Locale.setDefault(loc);
+    System.setProperty("user.language", loc.getLanguage());
+    System.setProperty("user.country", loc.getCountry());
+  }
+  
   /**
    * Process text with the locale 'jump_<locale>.properties' file
    * 
@@ -236,7 +249,7 @@
    */
   public static String get(final String label) {
     try {
-      return rb.getString(label);
+      return jumpResourceBundle.getString(label);
     } catch (java.util.MissingResourceException e) {
       String[] labelpath = label.split("\\.");
       LOG.debug("No resource bundle or no translation found for the key : "
@@ -252,7 +265,7 @@
    * @return string signature for locale
    */
   public static String getLocale() {
-    return rb.getLocale().getLanguage() + "_" + rb.getLocale().getCountry();
+    return jumpResourceBundle.getLocale().getLanguage() + "_" + 
jumpResourceBundle.getLocale().getCountry();
   }
 
   /**
@@ -264,13 +277,27 @@
   public static String getLanguage() {
     if (JUMPWorkbench.I18N_SETLOCALE == "") {
       // No locale has been specified at startup: choose default locale
-      return rb.getLocale().getLanguage();
+      return jumpResourceBundle.getLocale().getLanguage();
     } else {
-      return JUMPWorkbench.I18N_SETLOCALE.split("_")[0];
+      return fromCode(JUMPWorkbench.I18N_SETLOCALE).getLanguage();
     }
   }
 
   /**
+   * Get the short signature for country (2 letter code)
+   * 
+   * @return string signature for country
+   */
+  public static String getCountry() {
+    if (JUMPWorkbench.I18N_SETLOCALE == "") {
+      // No locale has been specified at startup: choose default locale
+      return jumpResourceBundle.getLocale().getCountry();
+    } else {
+      return fromCode(JUMPWorkbench.I18N_SETLOCALE).getCountry();
+    }
+  }
+  
+  /**
    * Process text with the locale 'jump_<locale>.properties' file If no
    * resourcebundle is found, returns default string contained inside
    * com.vividsolutions.jump.jump
@@ -281,7 +308,7 @@
    */
   public static String getMessage(final String label, final Object[] objects) {
     try {
-      final MessageFormat mformat = new MessageFormat(rb.getString(label));
+      final MessageFormat mformat = new 
MessageFormat(jumpResourceBundle.getString(label));
       return mformat.format(objects);
     } catch (java.util.MissingResourceException e) {
       final String[] labelpath = label.split("\\.");

Modified: core/trunk/src/com/vividsolutions/jump/workbench/JUMPWorkbench.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/workbench/JUMPWorkbench.java 
2011-12-30 14:55:38 UTC (rev 2559)
+++ core/trunk/src/com/vividsolutions/jump/workbench/JUMPWorkbench.java 
2011-12-31 12:25:15 UTC (rev 2560)
@@ -311,39 +311,43 @@
                driverManager.loadDrivers(properties);
        }
 
-       public static void main(String[] args) {
-               try {
-                       // first fetch parameters, locale might be changed with 
-i18n switch
-                       parseCommandLine(args);
-                       // load i18n specified in command line ( '-i18n 
translation' )
-                       if (commandLine.hasOption(I18N_FILE)) {
-                               
I18N.loadFile(commandLine.getOption(I18N_FILE).getArg(0));
-                               I18N_SETLOCALE = 
commandLine.getOption(I18N_FILE).getArg(0);
-                       }
-                       
-                       // Init the L&F before instantiating the progress 
monitor [Jon Aquino]
-                       initLookAndFeel();
-                       // setFont to switch fonts if defaults cannot display 
current language [ede]
-                       // this changes the default font definition of the jre, 
first internationalized 
-                       // string shown is 'JUMPWorkbench.version' on 
splashpanel
-                       setFont();
-                       
-                       ProgressMonitor progressMonitor = (ProgressMonitor) 
progressMonitorClass
-                                       .newInstance();
-                       SplashPanel splashPanel = new 
SplashPanel(splashImage(), 
-                               I18N.get("ui.AboutDialog.version")+" " + 
JUMPVersion.CURRENT_VERSION );
-                       splashPanel.add(progressMonitor, new 
GridBagConstraints(0, 10, 1,
-                                       1, 1, 0, GridBagConstraints.NORTHWEST,
-                                       GridBagConstraints.HORIZONTAL, new 
Insets(0, 0, 0, 10), 0,
-                                       0));
+  public static void main(String[] args) {
+    try {
+      // first fetch parameters, locale might be changed with -i18n switch
+      parseCommandLine(args);
+      // load i18n specified in command line ( '-i18n translation' )
+      if (commandLine.hasOption(I18N_FILE)) {
+        I18N_SETLOCALE = commandLine.getOption(I18N_FILE).getArg(0);
+        I18N.loadFile(I18N_SETLOCALE);
+        // [ede] while the above only loads the correct resourcebundle, 
+        // the below applies the chosen locale to the whole runtime
+        I18N.applyToRuntime();
+      }
 
-                       main(args, I18N.get("JUMPWorkbench.jump"), new 
JUMPConfiguration(), splashPanel,
-                                       progressMonitor);
-               } catch (Throwable t) {
-                       WorkbenchFrame.showThrowable(t, null);
-               }
-       }
+      // Init the L&F before instantiating the progress monitor [Jon Aquino]
+      initLookAndFeel();
+      // setFont to switch fonts if defaults cannot display current language
+      // [ede]
+      // early change the default font definition of the jre if necessary, the 
first
+      // internationalized string shown is 'JUMPWorkbench.version' on 
splashpanel
+      setFont();
 
+      ProgressMonitor progressMonitor = (ProgressMonitor) progressMonitorClass
+          .newInstance();
+      SplashPanel splashPanel = new SplashPanel(splashImage(),
+          I18N.get("ui.AboutDialog.version") + " "
+              + JUMPVersion.CURRENT_VERSION);
+      splashPanel.add(progressMonitor, new GridBagConstraints(0, 10, 1, 1, 1,
+          0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
+          new Insets(0, 0, 0, 10), 0, 0));
+
+      main(args, I18N.get("JUMPWorkbench.jump"), new JUMPConfiguration(),
+          splashPanel, progressMonitor);
+    } catch (Throwable t) {
+      WorkbenchFrame.showThrowable(t, null);
+    }
+  }
+
        /**
         * setupClass is specified as a String to prevent it from being loaded
         * before we display the splash screen, in case setupClass takes a long 
time

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Jump-pilot-svn-notify mailing list
jump-pilot-svn-not...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-svn-notify

--- End Message ---
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to