Home » U++ Library support » U++ Libraries and TheIDE: i18n, Unicode and Internationalization » Localisation clarifications
Localisation clarifications [message #5425] |
Thu, 21 September 2006 08:18 |
lundman
Messages: 175 Registered: March 2006 Location: Tokyo
|
Experienced Member |
|
|
I have read the thread:
http://www.arilect.com/upp/forum/index.php?t=msg&th=1017 &start=0&
So I added a .t file (read that too literally, so eventually renamed it to lang.t). Added Swedish (seSV) and Japanese (jaJP), and Synchronised. This all looked good.
For example, I ended up with:
T_("File")
jaJP("フィル")
svSE("Fil")
T_("About")
jaJP("について")
svSE("Beskriv")
I then use:
SetLanguage(LNG_('S','V','S','E'));
And I use it:
void UFxp::MainMenu(Bar& bar){
bar.Add(t_("File"),THISBACK(FileMenu));
}
void UFxp::FileMenu(Bar& bar){
bar.Add(t_("About"),THISBACK(do_About));
}
And for some reason, my "File" menu is still "File", but "About" actually turns up in Swedish. In Japanese I just get square boxes, presumably as it uses the wrong font.
What I am curious about is, why would you want to use SetLanguage in your code? Should it not use the Environment variables to decide which locate is preferred? If I always pick SetLanguage(ENGLISH), would that not break the idea that anyone can do .tr files to add their own locale to an application?
Is SetLanguage really supposed to be used if I have a Language> menu, and let users pick a language that way? Ie, I should leave it alone, and only set it if I chose to offer an option to set languages.
Should I be able to set LANG to seSV.UTF-8 or jaJP.UTF-8 and have my application use that language?
|
|
|
|
|
|
|
|
Re: Localisation clarifications [message #5451 is a reply to message #5449] |
Fri, 22 September 2006 11:07 |
|
mirek
Messages: 14038 Registered: November 2005
|
Ultimate Member |
|
|
lundman wrote on Thu, 21 September 2006 20:28 |
That I have:
# file lang.t
lang.t: UTF-8 Unicode C++ program text
# echo LC_CTYPE
ja_JP.UTF-8
# head lang.t
T_("Engine Connect")
jaJP("日本語")
svSE("Engine Anknyta")
But, I suspect it IS working, but because it no longer (automatically?) changes to use the correct font, it just shows square boxes. Why did it pick the right font when no jaJP was defined? (Even though the app itself had no Japanese, it worked when I printed Japanese file names). Once I add jaJP, it no longer does.
Before (notice the wide/2byte font)
http://netbsd.interq.or.jp/~lundman/UFxp5.jpg
After (notice thin normal font, which I could also get if I unsetenv LC_CTYPE in the old build)
http://netbsd.interq.or.jp/~lundman/UFxp6.jpg
|
Well, this really looks like wrong font used. Frankly, I am becoming a kind of desperate about X.org / *X desktop environment font settings...
Anyway, you can try to solve the problem by Draw::SetStdFont - at least we will know what is going on...
|
|
|
Goto Forum:
Current Time: Fri Sep 20 03:19:12 CEST 2024
Total time taken to generate the page: 0.02509 seconds
|