mertaydin
mertaydin

Reputation: 2244

How can i do localization in JavaME?

I have a question about localization files in JavaME.

I want to use my strings to put on appropriate places of applicaton in different languages that depends on phones' language.

I researched this topic and rode some articles like http://www.developer.nokia.com/Community/Wiki/Localising_text_files_in_Java_ME.

I will locate my string.txt file to Resources folder in application, this can help me?

Thank everyone.

Upvotes: 0

Views: 113

Answers (2)

Jaska
Jaska

Reputation: 1047

I assume here that you mean CLDC/MIDP by JavaME.

Java ME has a resource concept but no string resource bundles such as .properties files found in Java SE/EE. There is a lightway implementation for ME called JSR 238. It provides string resources similar to .properties. Unfortunately JSR 238 is not part of standard CLDC/MIDP stack. Some device manufactors have included JSR 238 into their devices but some such as Nokia have not. If you plan to run your applications on several deveices you can not relye JSR 238 having there.

What you can do is to download a reference implementation of JSR 238 and include those classes into to JAR file of your application. Another solution is to write your own resourde bundle class.

If you use CDC tthen the standard resource bundles classes (.properties) are there.

Upvotes: 2

Telmo Pimentel Mota
Telmo Pimentel Mota

Reputation: 4043

According to the Nokia sample you pointed, you will need a strings-??.txt file for each language you give support. Where you replace ?? with the proper language code: en for English, fr for French, etc
What problems are you facing?

Upvotes: 1

Related Questions