You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Brendan cheng <cc...@hotmail.com> on 2013/03/15 08:45:03 UTC
Localization question
Hi,
I try to set a specific locale that is different from system default. However, I can only success in the most outer component. Let's take the tutorial BXMLExplorer as an example. I added a resource bxmlexplorer_de.json and modified the startup code as:
Resources resources = new Resources(getClass().getName(), new Locale("de"));
BXMLSerializer bxmlSerializer = new BXMLSerializer();
window = (BXMLExplorerWindow) bxmlSerializer.readObject(
BXMLExplorer.class.getResource("bxml_explorer_window.bxml"),
resources);
window.open(display);
it works for the "bxml_explorer_window.bxml" but doesn't work any other subsequent component, like FileBrowserSheet which is still in English.
Also, If use "include" in bxml file, shall we treat it differently?
Regards,
Brendan
Re: Localization question
Posted by Sandro Martini <sa...@gmail.com>.
Hi Brendan,
> Just want to confirm that there is no way to change the globally locale setting from within Pivot, right?
yes, (if I remember well) ...
> Unless, change the system default?
yes, via code or via system properties, take a look here:
http://stackoverflow.com/questions/8809098/how-do-i-set-the-default-locale-for-my-jvm
http://www.tutorialspoint.com/java/util/locale_setdefault.htm
http://www.oracle.com/technetwork/articles/javase/locale-140624.html#using
try with this, and if there is something still to change/improve in
2.0.x tell us ... otherwise maybe we could think at a more structured
approach for 2.1 ... suggestions ?
Keep us updated.
Bye,
Sandro
Re: Localization question
Posted by Brendan <cc...@hotmail.com>.
Hi Sandro,
Just want to confirm that there is no way to change the globally locale
setting from within Pivot, right?
Unless, change the system default?
Is that means I just have to create different locale file and have no set up
from program to have the different locale pick up by the system
automatically? I used to have resource set up every times I load a bxml
file.
Thanks,
Brendan
--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Localization-question-tp4022515p4022523.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
Re: Localization question
Posted by Sandro Martini <sa...@gmail.com>.
Hi Brendan,
you set the Locale only in your resources variable (and not globally
in your application) ... could be this the problem ?
Otherwise, please could you post a minimal sample today/tomorrow, so
we can check it ?
Thanks,
Sandro