TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
-
znakeeye
- Newbie
- Posts: 44
- Joined: Mon Jan 07, 2013 12:00 am
Post
by znakeeye » Mon Mar 18, 2013 11:45 pm
This line takes 3 seconds on my Nexus 4 (using English/UK locale):
The culprit is this line:
Code: Select all
bundle = ResourceBundle.getBundle(languages, currentLocale);
Not sure why this activate() function is even called. It seems it only looks for the line/column separators. Really odd!
Suggestions?
-
Yeray
- Site Admin
- Posts: 9613
- Joined: Tue Dec 05, 2006 12:00 am
- Location: Girona, Catalonia
-
Contact:
Post
by Yeray » Tue Mar 19, 2013 3:36 pm
Hi,
The activate() function creates the bundle to localize the strings the component shows. The activate() function only retrieves the separator strings, but the bundle is later used for other texts (361 references to getString() function, from Language.java).
As you'll see in the language files, there are more than a thousand translated strings; this may be the reason of this delay.
If you know another way to do this, don't hesitate to let us know.
-
znakeeye
- Newbie
- Posts: 44
- Joined: Mon Jan 07, 2013 12:00 am
Post
by znakeeye » Tue Mar 19, 2013 8:10 pm
I removed the localization entirely (assuming "design time") since I do not use any of the localized strings. I did have to set the format for my axis labels explicitly, but I can live with that
Regarding localization, why not use the resource system that comes with Android? Just put xml resources in "values", "values-de", "values-nl" etc and load strings using an instance of Context (I think TChart will do) + getResources() + getString().
http://developer.android.com/guide/topi ... ource.html
The resources will automatically adapt to the current locale.
-
Yeray
- Site Admin
- Posts: 9613
- Joined: Tue Dec 05, 2006 12:00 am
- Location: Girona, Catalonia
-
Contact:
Post
by Yeray » Mon Mar 25, 2013 11:42 am
Hi Kristoffer,
I've added it to the wish list to be investigated for inclusion in next releases (TJ71016547).
Thanks for reporting it.