messages appear in different languages? english & german - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

messages appear in different languages? english & german

Nav2kNav2k Posts: 1Member
Hi all,

I've got a bit of a problem, some messages (very few) appear in German when using the api's. For example:
JOptionPane.showConfirmDialog(ownedFrom, "Are you sure you want to close this case?","Close requester",JOptionPane.YES_NO_OPTION)

Comes up as a "Ja" and "Nein" option instead of "Yes" and "No".
Is there anyway I can acheive consistency throughout my code? As mentioned before it's only for some messages.

It should be noted that I'm currently in Switzerland where a lot of things are German, but I have all my *known* options set on English.

Thanks in advance for any replies.


-Naveen

Comments

  • zibadianzibadian Posts: 6,349Member
    : Hi all,
    :
    : I've got a bit of a problem, some messages (very few) appear in German when using the api's. For example:
    : JOptionPane.showConfirmDialog(ownedFrom, "Are you sure you want to close this case?","Close requester",JOptionPane.YES_NO_OPTION)
    :
    : Comes up as a "Ja" and "Nein" option instead of "Yes" and "No".
    : Is there anyway I can acheive consistency throughout my code? As mentioned before it's only for some messages.
    :
    : It should be noted that I'm currently in Switzerland where a lot of things are German, but I have all my *known* options set on English.
    :
    : Thanks in advance for any replies.
    :
    :
    : -Naveen
    :
    :
    The captions of the "yes"-"no" buttons, and other messages, are taken from the OS which is running. If that OS is German, then the messages will appear in German. If it is in Dutch it will appear in Dutch, without any changes in your code. The only two ways to ensure (some) consistency is to:
    1 Create all dialogs from scratch and don't rely on "default" dialogs
    2 Create a multi-lingual version of you application, which checks the language of the OS.
    The first option will show everything in the language it is coded in. The language of the other option will depend on the OS settings and the availability of the language data.
  • arb123arb123 Posts: 696Member
    : It should be noted that I'm currently in Switzerland where a lot of things are German, but I have all my *known* options set on English.

    This is probably due to the Locale the JVM is using. See the java.util.Locale class + set the default to the one you want when the app starts.

    ---------------------------------
    [size=1](Its just my sig)
    HOWTO ask questions: http://catb.org/~esr/faqs/smart-questions.html[/size]

Sign In or Register to comment.