hi J
程序能翻译,但无法显示汉字
后附原代码,帮助找找哪里出错了.
thanks,
liqi
程序能翻译,但无法显示汉字
程序能翻译,但无法显示汉字
- Attachments
-
- hellworld.rar
- (14.81 KiB) Downloaded 10357 times
Re: 程序能翻译,但无法显示汉字
Hi liqi,
are you saying you have problems in this new version, but not in your previous sample?
It could be the order in which the initialization is called (after the form is created).
Doing the initialization in an Application class like in your earlier samples is probably better.
You will want to inherit from GuiApplication rather than Application for GUI applications.
On the other hand, I spent many hours trying to get your first samples working, but gettext refuses to give me any translation!!! It always returns me the original string!
Did you manage to get it working? Of course my system locale is set to english, but I tried to set the LC_ALL and LANG and LANGUAGE variables to other things. I could never get it to work!
Could you please try to add another translation in another locale, e.g. one that is not installed on your system? (e.g. French: Bonjour:) )
Thank you!
-Jerome
are you saying you have problems in this new version, but not in your previous sample?
It could be the order in which the initialization is called (after the form is created).
Doing the initialization in an Application class like in your earlier samples is probably better.
You will want to inherit from GuiApplication rather than Application for GUI applications.
On the other hand, I spent many hours trying to get your first samples working, but gettext refuses to give me any translation!!! It always returns me the original string!
Did you manage to get it working? Of course my system locale is set to english, but I tried to set the LC_ALL and LANG and LANGUAGE variables to other things. I could never get it to work!
Could you please try to add another translation in another locale, e.g. one that is not installed on your system? (e.g. French: Bonjour:) )
Thank you!
-Jerome
Re: 程序能翻译,但无法显示汉字
Thanks to cortana` on ##mingw, I got it working.
We were missing:
bind_textdomain_codeset(PACKAGE, "UTF-8");
I don't know if this will help you as well
Regards,
Jerome
We were missing:
bind_textdomain_codeset(PACKAGE, "UTF-8");
I don't know if this will help you as well
Regards,
Jerome
Re: 程序能翻译,但无法显示汉字
I am not sure what code page the Windows console is set to on Chinese systems by default.
But to be able to write UTF-8 text to the Windows console, you should invoke:
SetConsoleOutputCP(CP_UTF8); (where CP_UTF8 is defined to be 65001)
At least on Windows XP for whatever reason this does not work with raster fonts, setting the font of the console to 'Lucida Console' fixes it.
This should be useful to output information to the console, as all our localized text will be returned in UTF-8
By the way, have you done anything towards making .po/.mo files for the Ecere SDK yet?
I am looking forward to having many localized versions of the SDK
Thanks!
Jerome
But to be able to write UTF-8 text to the Windows console, you should invoke:
SetConsoleOutputCP(CP_UTF8); (where CP_UTF8 is defined to be 65001)
At least on Windows XP for whatever reason this does not work with raster fonts, setting the font of the console to 'Lucida Console' fixes it.
This should be useful to output information to the console, as all our localized text will be returned in UTF-8
By the way, have you done anything towards making .po/.mo files for the Ecere SDK yet?
I am looking forward to having many localized versions of the SDK
Thanks!
Jerome
Re: 程序能翻译,但无法显示汉字
When I call bind_textdomain_codeset in the Ecgettext() constructor, with your original code, this works for me?