|
-
Internationalization
Hi,
I am trying to create a small application as a help in language studdying. And I want to localize it to a cupple of differant languages, to start with: Japanese, English and swedish.
so I have read loads of articles about internationalization, though my Java-knowledge isn't that strong, and I am still pretty new to Java.
so what I have done this far is setup some .properties files to help out with localization issues. these are still simple, and contains one "variable" for each language, this is then used to change the name of a button when the language is changed.
All fine so far, my three properties files looks like this:
en_US:
button_name = English
se_SE:
button_name = svenska
ja_JP:
button_name = nihongo
so this is all fine, and then I ran into some trouble, namely that both Swedish (and particularly Japanese), have "special Chars", in Swedish it's "åäö" so that's when I started to convert it into UTF8 which didn't pose much problems.
simply made a string, converted it to bytes and used the String constructor that can do this for me, in pseudo it would be something like:
String str1 = "Svenska är kul";
byte [] non_unicode = str1.getBytes();
String unicode = new String(non_unicode, "UTF8");
this all worked fine, but for Japanese... well I tried to make a string:
String str1 = 日本語
and realized that my editor (Netbeans v5.5) didn't think highly of this kind of coding 
After I have poked around I found out that you can find the chars by using escape-charakteres which uses Hex representation.. but it would be a major pain to find out every kana, not to talk about finding the kanji :P
so on to the question already!
I just wonder if anyone know how I should go about this, what I would like most of all would be if I could simply create three files which looks like this, and then just use the correct charset to render them later on:
file: Localization_en_US.properties
button_name = English
file: Localization_se_SE.properties
button_name = Svenska
file: Localization_ja_JP.properties
button_name = 日本語
I'm not sure if the problem is within my development environment, and if it's something I haven't setup correctly, or if it's simply just not possible to work it the way I wanted, but well I hope you understand my problem and if not I will gladly try to elaborate if it means I can get help solving this problem
Last edited by qrikko; 01-05-2007 at 02:46 AM.
Similar Threads
-
Replies: 0
Last Post: 09-06-2006, 02:23 PM
-
Replies: 13
Last Post: 05-23-2005, 05:22 PM
-
By Steven Upton in forum XML
Replies: 1
Last Post: 01-28-2002, 05:23 PM
-
Replies: 0
Last Post: 03-16-2001, 05:00 AM
-
By ray in forum Enterprise
Replies: 0
Last Post: 03-17-2000, 12:59 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks