Creating a simple application that can switch between English and Chinese..

Hi guys,

I need your help with regards to this simple application. I want to create a simple program that can switch between English and Chinese Language

My initial screen would look like this:

|Choose your language:|

|--|

| o English |

| o Chinese |

| |

| EXIT ||OK|

|-

When I choose chinese I want to display a list items listed below (Menu,Call,Contact,SMS) including labels (BACK ,OK) in

chinese characters.

-

| Menu|

| Call |

| Contact|

| SMS |

|-- |

| BACK || OK|

I'm planning to use a separate text file or Resource file (sort of properties file) which contains the definition of menu's in unicode ex .menu = "\u4014...."; that will be called whenever I select the language I am going to use to display a proper unicode...

But I don't know how to start it. Please guide me on how to start or give any idea on what's the best technique to use... should i create a separate a class for chinese,english and resource file ?.... Please help!!!

Thanks in advance.

regards,

psyeu

[1129 byte] By [psyeua] at [2007-11-27 6:07:35]
# 1
Give the promised dukes before asking something else !!!!!!!!!!!!!!!!!!!!!!!!!!!!
suparenoa at 2007-7-12 16:58:45 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2

Use somewhat like this skeleton:

class res

{

private instance=new res();

public static res getInstance(){ return instance;}

public final int ID_MENU = 0;

public final int ID_SMS = 1;

//and so on

public String getString(int id)

{

.................

}

public loadLang(int lang)

{

...................

}

private String strings[];

}

.............

.........

paint(Graphics g)

{

g.drawString( res.getInstance().getString(res.ID_MENU),.....);

}

After that you should think about automation:

in your building script you should insert program that will generate java-file with declared IDs.

Message was edited by:

learnphysics

null

learnphysicsa at 2007-7-12 16:58:45 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 3
Do i have to use one class and two other text files one for en and another for ch?
psyeua at 2007-7-12 16:58:45 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 4
Use this guide for Internationalization of J2ME apps. This provides a good way of this not using JSR:238 http://java.sun.com/developer/J2METechTips/2001/tt0129.html
find_suvro@SDNa at 2007-7-12 16:58:45 > top of Java-index,Java Mobility Forums,Java ME Technologies...