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:
button_name = English
button_name = svenska
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:
button_name = English
button_name = Svenska
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.
Last Post: 09-06-2006, 02:23 PM
Last Post: 05-23-2005, 05:22 PM
By Steven Upton in forum XML
Last Post: 01-28-2002, 05:23 PM
Last Post: 03-16-2001, 05:00 AM
By ray in forum Enterprise
Last Post: 03-17-2000, 12:59 PM
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center