British english on JavaFX controls
Hello, I'm trying to get the JavaFX controls (specifically the ColorPicker) to display British English labels, that is Colour instead of Color, but don't seem to be getting anywhere - do I need to do anything more than setting the default Locale? For instance: public void start(Stage primaryStage) { Locale.setDefault(Locale.UK); primaryStage.setScene(new Scene(new ColorPicker())); primaryStage.show(); } ...gives me the ColorPicker with the US spelling of color. (Setting the locale to other languages seems to work fine.) Any ideas? Thanks, Michael
Re: British english on JavaFX controls
Looking at the com/sun/javafx/scene/control/skin/resources/controls package there's not extra properties file for en nor one for en_UK. Wild guess you can fix this is that you put such a properties file in exactly this package of of your application and it will be picked up. Tom On 16.10.14 14:06, Michael Berry wrote: Hello, I'm trying to get the JavaFX controls (specifically the ColorPicker) to display British English labels, that is Colour instead of Color, but don't seem to be getting anywhere - do I need to do anything more than setting the default Locale? For instance: public void start(Stage primaryStage) { Locale.setDefault(Locale.UK); primaryStage.setScene(new Scene(new ColorPicker())); primaryStage.show(); } ...gives me the ColorPicker with the US spelling of color. (Setting the locale to other languages seems to work fine.) Any ideas? Thanks, Michael
Re: British english on JavaFX controls
Wouldn't you also have to fix the call to setLocale to en_UK? Sent from my iPhone On Oct 16, 2014, at 8:34 AM, Tom Schindl tom.schi...@bestsolution.at wrote: Looking at the com/sun/javafx/scene/control/skin/resources/controls package there's not extra properties file for en nor one for en_UK. Wild guess you can fix this is that you put such a properties file in exactly this package of of your application and it will be picked up. Tom On 16.10.14 14:06, Michael Berry wrote: Hello, I'm trying to get the JavaFX controls (specifically the ColorPicker) to display British English labels, that is Colour instead of Color, but don't seem to be getting anywhere - do I need to do anything more than setting the default Locale? For instance: public void start(Stage primaryStage) { Locale.setDefault(Locale.UK); primaryStage.setScene(new Scene(new ColorPicker())); primaryStage.show(); } ...gives me the ColorPicker with the US spelling of color. (Setting the locale to other languages seems to work fine.) Any ideas? Thanks, Michael
Re: British english on JavaFX controls
Thanks for the suggested fix - unfortunately though that doesn't seem to work. The following: @Override public void start(Stage primaryStage) throws Exception { Locale.setDefault(new Locale(en, UK)); System.out.println(ResourceBundle.getBundle(com/sun/javafx/scene/control/skin/resources/controls).getString(ColorPicker.customColorLink)); primaryStage.setScene(new Scene(new ColorPicker())); primaryStage.show(); } ...prints out Custom colour (British spelling), but the control doesn't pick this up. Any idea if I could force a refresh on this somehow to get it to pick up the british labels? Thanks, Michael On 16 October 2014 13:37, Jim Clarke jimclar...@me.com wrote: Wouldn't you also have to fix the call to setLocale to en_UK? Sent from my iPhone On Oct 16, 2014, at 8:34 AM, Tom Schindl tom.schi...@bestsolution.at wrote: Looking at the com/sun/javafx/scene/control/skin/resources/controls package there's not extra properties file for en nor one for en_UK. Wild guess you can fix this is that you put such a properties file in exactly this package of of your application and it will be picked up. Tom On 16.10.14 14:06, Michael Berry wrote: Hello, I'm trying to get the JavaFX controls (specifically the ColorPicker) to display British English labels, that is Colour instead of Color, but don't seem to be getting anywhere - do I need to do anything more than setting the default Locale? For instance: public void start(Stage primaryStage) { Locale.setDefault(Locale.UK); primaryStage.setScene(new Scene(new ColorPicker())); primaryStage.show(); } ...gives me the ColorPicker with the US spelling of color. (Setting the locale to other languages seems to work fine.) Any ideas? Thanks, Michael
Re: British english on JavaFX controls
Right should be en_GB this is what Locale.UK maps to. What needs to done is to create a controls_en_GB.properties file and put the british translations in there. Tom On 16.10.14 14:37, Jim Clarke wrote: Wouldn't you also have to fix the call to setLocale to en_UK? Sent from my iPhone On Oct 16, 2014, at 8:34 AM, Tom Schindl tom.schi...@bestsolution.at wrote: Looking at the com/sun/javafx/scene/control/skin/resources/controls package there's not extra properties file for en nor one for en_UK. Wild guess you can fix this is that you put such a properties file in exactly this package of of your application and it will be picked up. Tom On 16.10.14 14:06, Michael Berry wrote: Hello, I'm trying to get the JavaFX controls (specifically the ColorPicker) to display British English labels, that is Colour instead of Color, but don't seem to be getting anywhere - do I need to do anything more than setting the default Locale? For instance: public void start(Stage primaryStage) { Locale.setDefault(Locale.UK); primaryStage.setScene(new Scene(new ColorPicker())); primaryStage.show(); } ...gives me the ColorPicker with the US spelling of color. (Setting the locale to other languages seems to work fine.) Any ideas? Thanks, Michael
Re: British english on JavaFX controls
On 16.10.14 16:15, Tom Schindl wrote: Ok - it ResourceBundle.getBundle() uses the classloader of the caller which means the ExtensionClassloader so having the additional properties in your local dir does help. does NOT help! Tom
Re: British english on JavaFX controls
Hi Tom, Sure, that makes sense, thanks for the info. Don't suppose there's a workaround you know of? This is for an application which has a bundled JRE, so I can potentially just add the language file in the proper location - it'd just be nice to have a fix that doesn't require modification if possible! Michael On 16 October 2014 15:20, Tom Schindl tom.schi...@bestsolution.at wrote: On 16.10.14 16:15, Tom Schindl wrote: Ok - it ResourceBundle.getBundle() uses the classloader of the caller which means the ExtensionClassloader so having the additional properties in your local dir does help. does NOT help! Tom
Re: British english on JavaFX controls
Sure, JIRA is here: https://javafx-jira.kenai.com/browse/RT-39004 Afraid I'm not sure about AWT / Swing, I've never tried to add a translation there! Michael On 16 October 2014 15:38, Stephen F Northover steve.x.northo...@oracle.com wrote: Please enter a JIRA for the missing translation. If AWT/Swing is missing a translation, is there a way to add it short of modifying the system? Steve On 2014-10-16, 10:28 AM, Michael Berry wrote: Hi Tom, Sure, that makes sense, thanks for the info. Don't suppose there's a workaround you know of? This is for an application which has a bundled JRE, so I can potentially just add the language file in the proper location - it'd just be nice to have a fix that doesn't require modification if possible! Michael On 16 October 2014 15:20, Tom Schindl tom.schi...@bestsolution.at wrote: On 16.10.14 16:15, Tom Schindl wrote: Ok - it ResourceBundle.getBundle() uses the classloader of the caller which means the ExtensionClassloader so having the additional properties in your local dir does help. does NOT help! Tom
Re: British english on JavaFX controls
On 10/16/2014 7:38 AM, Stephen F Northover wrote: Please enter a JIRA for the missing translation. If AWT/Swing is missing a translation, is there a way to add it short of modifying the system? I don't think Swing (or any other part of the JDK classes for that matter) would reach out to an application classloaded resource. Also the translations are in resource classes buried in the implementation and you have to get the source of the class to even know what you were supposed to provide and translate. FWIW I do not believe there is any British English resource translation in the JDK classes either .. nor Canadian for that matter :-) I suspect there was so little different it was not worth it even though the bar to entry is pretty low here. You can ask the localization (or is that localisation ? :-) team what they have to say .. cc'd Michael Fang. -phil. Steve On 2014-10-16, 10:28 AM, Michael Berry wrote: Hi Tom, Sure, that makes sense, thanks for the info. Don't suppose there's a workaround you know of? This is for an application which has a bundled JRE, so I can potentially just add the language file in the proper location - it'd just be nice to have a fix that doesn't require modification if possible! Michael On 16 October 2014 15:20, Tom Schindl tom.schi...@bestsolution.at wrote: On 16.10.14 16:15, Tom Schindl wrote: Ok - it ResourceBundle.getBundle() uses the classloader of the caller which means the ExtensionClassloader so having the additional properties in your local dir does help. does NOT help! Tom
Re: British english on JavaFX controls
Thanks Phil. I have given up on Canadian spelling where computers concerned. Michael Fang is on the JIRA. Steve On 2014-10-16, 3:34 PM, Phil Race wrote: On 10/16/2014 7:38 AM, Stephen F Northover wrote: Please enter a JIRA for the missing translation. If AWT/Swing is missing a translation, is there a way to add it short of modifying the system? I don't think Swing (or any other part of the JDK classes for that matter) would reach out to an application classloaded resource. Also the translations are in resource classes buried in the implementation and you have to get the source of the class to even know what you were supposed to provide and translate. FWIW I do not believe there is any British English resource translation in the JDK classes either .. nor Canadian for that matter :-) I suspect there was so little different it was not worth it even though the bar to entry is pretty low here. You can ask the localization (or is that localisation ? :-) team what they have to say .. cc'd Michael Fang. -phil. Steve On 2014-10-16, 10:28 AM, Michael Berry wrote: Hi Tom, Sure, that makes sense, thanks for the info. Don't suppose there's a workaround you know of? This is for an application which has a bundled JRE, so I can potentially just add the language file in the proper location - it'd just be nice to have a fix that doesn't require modification if possible! Michael On 16 October 2014 15:20, Tom Schindl tom.schi...@bestsolution.at wrote: On 16.10.14 16:15, Tom Schindl wrote: Ok - it ResourceBundle.getBundle() uses the classloader of the caller which means the ExtensionClassloader so having the additional properties in your local dir does help. does NOT help! Tom