Swing menu internationalization

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
skyhook
Posts: 8
Joined: Tue Mar 03, 2015 2:34 pm
antibot: No, of course not.

Swing menu internationalization

Post by skyhook » Tue Mar 31, 2015 7:06 am

Hi,

can someone post to me some peace of code, example, where to place files, resources in another language to internationalize swing menus?

Thanks.

Naxter
Posts: 45
Joined: Thu Jun 26, 2014 8:24 am
antibot: No, of course not.
Location: Germany, Aachen

Re: Swing menu internationalization

Post by Naxter » Tue Mar 31, 2015 7:22 am

Which IDE are you using?

skyhook
Posts: 8
Joined: Tue Mar 03, 2015 2:34 pm
antibot: No, of course not.

Re: Swing menu internationalization

Post by skyhook » Tue Mar 31, 2015 9:49 pm

I am creating desktop application with Netbeans platforms framework so i am using Netbeans. I have Bundle.properties files for other text and other languages. But i cannot find any example how easy customize text from jfreechart components.

M.

Naxter
Posts: 45
Joined: Thu Jun 26, 2014 8:24 am
antibot: No, of course not.
Location: Germany, Aachen

Re: Swing menu internationalization

Post by Naxter » Thu Apr 02, 2015 12:28 pm

Mostly you use the bundles aswell. Which components do you want to internationalize ?

If you create your own component, you just use it like you always use it:

Code: Select all

String international = Nbbundle.getMessage(<Yourclass>.class, "yourkey.title");
component.setXAxisName(international);
Do you mean this situation? Or do i misunderstand your problem?

skyhook
Posts: 8
Joined: Tue Mar 03, 2015 2:34 pm
antibot: No, of course not.

Re: Swing menu internationalization

Post by skyhook » Fri Apr 03, 2015 10:03 pm

For example i want to customize swing menu, when you right click on graph. There is menu with:

Properties
Copy
Save as...
Print
Zoom in
Zoom out
Auto range

and i want to replace these text with text from my Bundle file. I want internationalize these texts.

M.

Naxter
Posts: 45
Joined: Thu Jun 26, 2014 8:24 am
antibot: No, of course not.
Location: Germany, Aachen

Re: Swing menu internationalization

Post by Naxter » Fri Apr 10, 2015 10:32 am

Check under org.jfree.chart.LocalizationBundle.properties. You have different Locales there, maybe you have to add you country or just edit the ones which are there

Locked