Java

Moderators: zibadian
Number of threads: 7818
Number of posts: 18218

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
messages appear in different languages? english & german Posted by Nav2k on 30 Mar 2006 at 6:17 AM
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

Report
Re: messages appear in different languages? english & german Posted by zibadian on 30 Mar 2006 at 7:59 AM
: 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.
Report
Re: messages appear in different languages? english & german Posted by arb123 on 30 Mar 2006 at 8:15 AM
: 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.

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





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.