Skip to Content
author's profile photo Former Member
Former Member

Clear text of user's country

Hi all,

I am searching for a hint on the following topic:

In an EP6 PortalComponent I have to display the country property of a portal user's address (not his locale).

The UME API delivers the "ISO-3166 two-letter uppercase code" (US,DE,...).

How can I get the clear text (United States, Germany, Vereinigte Staten, Deutschland, ...) for this code?

Thanks for suggestions

Ingo Biermann

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jan 12, 2005 at 10:05 AM

    Hi Ingo,

    the method getDisplayCountry(Locale inLocale) from java.util.Locale http://java.sun.com/j2se/1.3/docs/api/java/util/Locale.html should do the required job.

    Hope that helps

    PD

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Ingo,

      the question is, for whom do you want to present the country text? For the user in question? For a third user?

      Anyhow, the reply given will work, you just have to care what locale you pass to display the user's locale.

      If you want to present the country in the language of the user in question (en-CH),

      userInQuestionLocale.getDisplayCountry(userInQuestionLocale);
      

      will do the job, displaying "Switzerland".

      If you want to present the country of the user in question (en-CH => CH) in the language of a third user (de-FR),

      userInQuestionLocale.getDisplayCountry(userFromRequestLocale);
      

      will do the job, displaying "Schweiz".

      Hope it helps

      Detlev

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.