Vincent
Vincent

Reputation: 6188

Different languages

I'm developing an app for the nokia e75 using j2me. What is a good way of showing content in the right lang? I don't think that java beans are an option.

Just to be clear; the problem isn't to know what the lang is of the device, but how to generate the right content knowing the lang the user uses.

thx

Upvotes: 2

Views: 188

Answers (2)

Barmaley
Barmaley

Reputation: 16363

I'm using following strategy:

  1. Storing resources in Java properties files, like "KEY=Value"
  2. Separate resources for each language, like: messages_en, messages_fr, messages_gr and so on
  3. Use in code instead of static Strings references to Keys from properties
  4. Detect language using

    System.getProperty("microedition.locale");

  5. After locale detection load appropriate language resource

Upvotes: 1

Jigar Joshi
Jigar Joshi

Reputation: 240900

The standard way of detecting the user's language is to read the language set for the phone.

System.getProperty("microedition.locale");

Implementation of Localization/Internationalization depends on the framework you are using.

Upvotes: 1

Related Questions