From: Jouke V. <jo...@pv...> - 2002-10-25 17:20:14
|
Hi, I got a Japanese translationfile in UTF-8, which looks OK in poEdit and UltraEdit, and tried to use it using Wx::Locale, but no-go: it looks like line-noise. And another thing that is quite flakey: I have a preferences window in my application and when I try to change the language there more than three times in one session, the application crashes without any error-message. Since this wasn't there when I used Locale::Maketext::Lexicon (I didn't change any logic in the program, I just replaced the gettext from that module to that from Wx::Locale and of course the initialization), this must have something to do with Wx::Locale. Now, the machine I'm testing on is Windows XP, I'm using wxPerl 0.12 (the PPM binary from the site) and ActivePerl build 633. The .po/.mo files are OK, since poEdit handles everything correctly. And oh yeah, with some locale-sets (for example 'nl') I get a popup window (from Wx) that it can't set that locale (although 'nl' is my default on this machine) and it continues with the correct translations...isn't that weird? I've tried to set it to 'nl', 'nl-nl', 'nl_nl', but nothing works. As far as I know it should just be 'nl' (which worked with Locale::Maketext::Lexicon). Any ideas on these problems? -- ---------------------------------------------------------------------- | Jouke Visser | http://jouke.pvoice.org (personal) | | | http://www.pvoice.org (pVoice & pStory) | | Perl GUI Geek | http://wxperl.pvoice.org (wxPerl) | ---------------------------------------------------------------------- |
From: Jouke V. <jo...@pv...> - 2002-10-26 07:47:53
|
OK, looking further into the wxWindows documentation, (specifically the section 'Writing non-English applications') it says the following: When you tell the wxLocale class to load a message catalog that contains correct header, it checks the charset. The catalog is then converted to the charset used (see wxLocale::GetSystemEncoding and wxLocale::GetSystemEncodingName) by user's operating system. This is default behaviour of the wxLocale class; you can disable it by not passing wxLOCALE_CONV_ENCODING to wxLocale::Init. This sounds very logical. In fact, I wanted to try it, but then it said 'You can use wxEncodingConverter and wxFontMapper to display text:'. Well, wxFontMapper *is* implemented in wxPerl, but wxEncodingConverter *isn't*. So There Is the Answer. If we want to be able to write unicode-enabled applications in wxPerl, we *need* wxEncodingConverter at the least. Mattia, please? Jouke On Fri, Oct 25, 2002 at 07:04:17PM +0200, Jouke Visser wrote: > Hi, > > I got a Japanese translationfile in UTF-8, which looks OK in poEdit and UltraEdit, and tried to use it using Wx::Locale, but no-go: it looks like line-noise. > > And another thing that is quite flakey: I have a preferences window in my application and when I try to change the language there more than three times in one session, the application crashes without any error-message. Since this wasn't there when I used Locale::Maketext::Lexicon (I didn't change any logic in the program, I just replaced the gettext from that module to that from Wx::Locale and of course the initialization), this must have something to do with Wx::Locale. > > Now, the machine I'm testing on is Windows XP, I'm using wxPerl 0.12 (the PPM binary from the site) and ActivePerl build 633. > > The .po/.mo files are OK, since poEdit handles everything correctly. > > And oh yeah, with some locale-sets (for example 'nl') I get a popup window (from Wx) that it can't set that locale (although 'nl' is my default on this machine) and it continues with the correct translations...isn't that weird? I've tried to set it to 'nl', 'nl-nl', 'nl_nl', but nothing works. As far as I know it should just be 'nl' (which worked with Locale::Maketext::Lexicon). > > Any ideas on these problems? > -- > ---------------------------------------------------------------------- > | Jouke Visser | http://jouke.pvoice.org (personal) | > | | http://www.pvoice.org (pVoice & pStory) | > | Perl GUI Geek | http://wxperl.pvoice.org (wxPerl) | > ---------------------------------------------------------------------- > > > ------------------------------------------------------- > This sf.net email is sponsored by: Influence the future > of Java(TM) technology. Join the Java Community > Process(SM) (JCP(SM)) program now. > http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en > _______________________________________________ > wxperl-users mailing list > wxp...@li... > https://lists.sourceforge.net/lists/listinfo/wxperl-users -- ---------------------------------------------------------------------- | Jouke Visser | http://jouke.pvoice.org (personal) | | | http://www.pvoice.org (pVoice & pStory) | | Perl GUI Geek | http://wxperl.pvoice.org (wxPerl) | ---------------------------------------------------------------------- |
From: Simon F. <sf...@fl...> - 2002-10-26 18:04:13
|
I'm a little confused by "Writing non-English applications". I can't tell if you need to use wxFontMapper and wxEncodingConverter, or only if you disable the default behaviour of wxLocale, by not using the wxLOCALE_CONV_ENCODING flag. Although, looking at wxLocale::Init(), the docs say that wxLOCALE_CONV_ENCODING is meaningless in the unicode build. According to this post to wx-users, wxEncodingConverter can only handle encodings of 1 byte per char, so maybe that too is meaningless in unicode build: http://makeashorterlink.com/?Y3A322042 I'm interested to see where this discussion goes. I'm using Wx::Locale in an app I'm writing, although there are no immediate plans to support anything other than English. I'd like to know what changes I'll need to make if we decide we need to support other languages/charsets. I assumed I would only need a new .po file. Simon > OK, looking further into the wxWindows documentation, (specifically > the section 'Writing non-English applications') it says the following: > > When you tell the wxLocale class to load a message catalog that > contains correct header, it checks the charset. The catalog is then > converted to the charset used (see wxLocale::GetSystemEncoding and > wxLocale::GetSystemEncodingName) by user's operating system. This is > default behaviour of the wxLocale class; you can disable it by not > passing wxLOCALE_CONV_ENCODING to wxLocale::Init. > > This sounds very logical. In fact, I wanted to try it, but then it > said 'You can use wxEncodingConverter and wxFontMapper to display > text:'. Well, wxFontMapper *is* implemented in wxPerl, but > wxEncodingConverter *isn't*. > > So There Is the Answer. If we want to be able to write unicode- > enabled applications in wxPerl, we *need* wxEncodingConverter at the > least. > > Mattia, please? > > Jouke > > On Fri, Oct 25, 2002 at 07:04:17PM +0200, Jouke Visser wrote: > > Hi, > > > > I got a Japanese translationfile in UTF-8, which looks OK in poEdit and UltraEdit, and tried to use it using Wx::Locale, but no-go: it looks like line-noise. > > > > And another thing that is quite flakey: I have a preferences window in my application and when I try to change the language there more than three times in one session, the application crashes without any error-message. Since this wasn't there when I used Locale::Maketext::Lexicon (I didn't change any logic in the program, I just replaced the gettext from that module to that from Wx::Locale and of course the initialization), this must have something to do with Wx::Locale. > > > > Now, the machine I'm testing on is Windows XP, I'm using wxPerl 0.12 (the PPM binary from the site) and ActivePerl build 633. > > > > The .po/.mo files are OK, since poEdit handles everything correctly. > > > > And oh yeah, with some locale-sets (for example 'nl') I get a popup window (from Wx) that it can't set that locale (although 'nl' is my default on this machine) and it continues with the correct translations...isn't that weird? I've tried to set it to 'nl', 'nl-nl', 'nl_nl', but nothing works. As far as I know it should just be 'nl' (which worked with Locale::Maketext::Lexicon). > > > > Any ideas on these problems? > > -- > > ---------------------------------------------------------------------- > > | Jouke Visser | http://jouke.pvoice.org (personal) | > > | | http://www.pvoice.org (pVoice & pStory) | > > | Perl GUI Geek | http://wxperl.pvoice.org (wxPerl) | > > ---------------------------------------------------------------------- > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by: Influence the future > > of Java(TM) technology. Join the Java Community > > Process(SM) (JCP(SM)) program now. > > http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en > > _______________________________________________ > > wxperl-users mailing list > > wxp...@li... > > https://lists.sourceforge.net/lists/listinfo/wxperl-users > > -- > ---------------------------------------------------------------------- > | Jouke Visser | http://jouke.pvoice.org (personal) > | | | http://www.pvoice.org (pVoice & > pStory) | | Perl GUI Geek | http://wxperl.pvoice.org > (wxPerl) | > ---------------------------------------------------------------------- > > ------------------------------------------------------- > This SF.net email is sponsored by: ApacheCon, November 18-21 in > Las Vegas (supported by COMDEX), the only Apache event to be > fully supported by the ASF. http://www.apachecon.com > _______________________________________________ > wxperl-users mailing list > wxp...@li... > https://lists.sourceforge.net/lists/listinfo/wxperl-users #! |
From: Simon F. <sf...@fl...> - 2002-10-26 18:10:14
|
I said: > According to this post to wx-users, wxEncodingConverter can only > handle encodings of 1 byte per char, so maybe that too is > meaningless in unicode build: > > http://makeashorterlink.com/?Y3A322042 That probably was outdated information, according to wxEncodingConverter docs, it can convert to/from Unicode, if wxWindows. But I still thought this would happen behind the scenes if you used wxLocale. Simon |
From: Jouke V. <jo...@pv...> - 2002-10-27 07:30:57
|
> That probably was outdated information, according to wxEncodingConverter > docs, it can convert to/from Unicode, if wxWindows. > > But I still thought this would happen behind the scenes if you used wxLocale. Well, obviously not. I can give you my japanese .po and .mo files just so you can fiddle around with it. In poEdit it displays OK, so the file is OK and my Windows settings are OK too, but when my own app is supposed to display it, it is just line-noise. -- ---------------------------------------------------------------------- | Jouke Visser | http://jouke.pvoice.org (personal) | | | http://www.pvoice.org (pVoice & pStory) | | Perl GUI Geek | http://wxperl.pvoice.org (wxPerl) | ---------------------------------------------------------------------- |
From: Simon F. <sf...@fl...> - 2002-10-27 15:02:45
|
[snip] > I can give you my japanese .po and .mo files > just so you can fiddle around with it. In poEdit it displays OK, so > the file is OK and my Windows settings are OK too, but when my own > app is supposed to display it, it is just line-noise. I wonder how poedit does it; a quick grep of the poedit sources doesn't show any matches for wxEncodingConverter. I'll try with the chinese locale files that come with poedit. Simon |
From: Mattia B. <mb...@ds...> - 2002-10-28 15:25:16
|
On Sun, 27 Oct 2002, Simon Flack wrote: >[snip] > >> I can give you my japanese .po and .mo files >> just so you can fiddle around with it. In poEdit it displays OK, so >> the file is OK and my Windows settings are OK too, but when my own >> app is supposed to display it, it is just line-noise. > >I wonder how poedit does it; a quick grep of the poedit sources doesn't show >any matches for wxEncodingConverter. I'll try with the chinese locale files >that come with poedit. I _think_ poEdit uses wxCSConv classes. And _if_ wxWindows is compiled in Unicode mode, everything should just work (it does for me). Regards Mattia |
From: Jouke V. <jo...@pv...> - 2002-10-28 15:28:56
|
> > > I _think_ poEdit uses wxCSConv classes. And _if_ wxWindows is compiled >in Unicode mode, everything should just work (it does for me). > But the wxPerl documentation says that wxCSConv is not implemented...how should I use it then? -- -------------------------------------------------------------------- | Jouke Visser | http://jouke.pvoice.org (personal) | | | http://www.pvoice.org (pVoice & pStory)| | Perl GUI Geek | http://wxperl.pvoice.org (wxPerl) | -------------------------------------------------------------------- |
From: Mattia B. <mb...@ds...> - 2002-10-28 15:33:04
|
On Mon, 28 Oct 2002, Jouke Visser wrote: >> >> >> I _think_ poEdit uses wxCSConv classes. And _if_ wxWindows is compiled >>in Unicode mode, everything should just work (it does for me). >> >But the wxPerl documentation says that wxCSConv is not implemented...how >should I use it then? Encode.pm; it has the same functionality, and has a more perl-ish interface. Regards Mattia |
From: Jouke V. <jo...@pv...> - 2002-10-28 15:54:49
|
> > >>But the wxPerl documentation says that wxCSConv is not implemented...how >>should I use it then? >> > Encode.pm; it has the same functionality, and has a more perl-ish >interface. > OK, very clear. That leaves me with only one question. What are the parameters of the Wx::Locale->new() function? In the wxLocale.pm demo it takes three parameters, a string representing the user-readable language, and two times the two-letter language abbreviation ('en', 'en' for example). When I try this for example for 'ja' (the standard abbreviation for Japanese), I get the error 'locale 'ja' can not be set', which is an error from wxWindows. I call Wx::Locale with: Wx::Locale->new(gettext_noop('Japanese'), 'ja', 'ja'); And I get the same for Wx::Locale->new(gettext_noop('Dutch'), 'nl', 'nl'); Any idea about that? PS: the new binary seems to work, although my Win2K system itself here doesn't allow other charactersets and I can't install others here at work, but it looks different than it did with the other binary. -- -------------------------------------------------------------------- | Jouke Visser | http://jouke.pvoice.org (personal) | | | http://www.pvoice.org (pVoice & pStory)| | Perl GUI Geek | http://wxperl.pvoice.org (wxPerl) | -------------------------------------------------------------------- |
From: Jouke V. <jo...@pv...> - 2002-10-28 15:58:30
|
To be more precise: the ones that work: 'en', 'fr' and 'it' the ones that don't work: 'nl', 'de', 'es', 'pt_br', 'jp' These languages are the ones that I have .po and .mo files for Jouke Jouke Visser wrote: > > > > > >>But the wxPerl documentation says that wxCSConv is not > implemented...how > >>should I use it then? > >> > > Encode.pm; it has the same functionality, and has a more perl-ish > >interface. > > > OK, very clear. That leaves me with only one question. What are the > parameters of the Wx::Locale->new() function? In the wxLocale.pm demo it > takes three parameters, a string representing the user-readable > language, and two times the two-letter language abbreviation ('en', 'en' > for example). > > When I try this for example for 'ja' (the standard abbreviation for > Japanese), I get the error 'locale 'ja' can not be set', which is an > error from wxWindows. I call Wx::Locale with: > > Wx::Locale->new(gettext_noop('Japanese'), 'ja', 'ja'); > > And I get the same for > > Wx::Locale->new(gettext_noop('Dutch'), 'nl', 'nl'); > > Any idea about that? > > PS: the new binary seems to work, although my Win2K system itself here > doesn't allow other charactersets and I can't install others here at > work, but it looks different than it did with the other binary. > -- -------------------------------------------------------------------- | Jouke Visser | http://jouke.pvoice.org (personal) | | | http://www.pvoice.org (pVoice & pStory)| | Perl GUI Geek | http://wxperl.pvoice.org (wxPerl) | -------------------------------------------------------------------- |
From: Mattia B. <mb...@ds...> - 2002-10-29 18:50:50
|
On Mon, 28 Oct 2002 16:58:25 +0100 Jouke Visser <jo...@pv...> wrote: > To be more precise: > > the ones that work: 'en', 'fr' and 'it' > the ones that don't work: 'nl', 'de', 'es', 'pt_br', 'jp' The third argument to wxLocale->new is (I discovered it just now), platform specific[1]; in Windows (according to MSVC5 documentation) de => deu (german) | dea (austrian german) nl => nlb (belgian dutch) | ndl (netherland(ese?) dutch) es => esp (default) | esm (mexican) | esn (modern) ... [2] > These languages are the ones that I have .po and .mo files for Regards Mattia [1] you can argue that wxWindows is all about avoiding platform specificity (and I agree with you). I think the reason is that there juat way too much weird paltforms around to cope with. You can always ask on wx-users, though. [2] to be hones that page does not list "it" nor "fr", nor "en", but since them "just worked" I did not notice until now |
From: Mattia B. <mb...@ds...> - 2002-10-29 18:51:13
|
On Mon, 28 Oct 2002 16:54:03 +0100 Jouke Visser <jo...@pv...> wrote: > OK, very clear. That leaves me with only one question. What are the > parameters of the Wx::Locale->new() function? In the wxLocale.pm demo it > takes three parameters, a string representing the user-readable > language, and two times the two-letter language abbreviation ('en', 'en' > for example). What about the wxWindows documentation? Anyway, the second parameter is the directory prefix used to look up the .po file, the third is used in the call to setlocale(). As I just discovered (see the other mail), the third parameter is system-dependent. > When I try this for example for 'ja' (the standard abbreviation for > Japanese), I get the error 'locale 'ja' can not be set', which is an > error from wxWindows. I call Wx::Locale with: MSVCRT things the abbreviation for japanese is "jpn"... (again, see the other mail). > Any idea about that? > > PS: the new binary seems to work, although my Win2K system itself here > doesn't allow other charactersets and I can't install others here at > work, but it looks different than it did with the other binary. It works for me (after installing the chinese support). Regards Mattia |
From: Mattia B. <mb...@ds...> - 2002-10-28 15:29:51
|
On Sun, 27 Oct 2002, Jouke Visser wrote: >> That probably was outdated information, according to wxEncodingConverter >> docs, it can convert to/from Unicode, if wxWindows. >> >> But I still thought this would happen behind the scenes if you used wxLocale. >Well, obviously not. I can give you my japanese .po and .mo files just > so you can fiddle around with it. In poEdit it displays OK, so the file > is OK and my Windows settings are OK too, but when my own app is > supposed to display it, it is just line-noise. poEdit is compiled in Unicode mode, the wxPerl/wxWindows you are using is not. (it should just work with the release I just uploaded). Regards Mattia |
From: Mattia B. <mb...@ds...> - 2002-10-28 18:33:28
|
On Sat, 26 Oct 2002 09:31:53 +0200 Jouke Visser <jo...@pv...> wrote: > > This sounds very logical. In fact, I wanted to try it, but then it said > 'You can use wxEncodingConverter and wxFontMapper to display text:'. > Well, wxFontMapper *is* implemented in wxPerl, but wxEncodingConverter > *isn't*. > > So There Is the Answer. If we want to be able to write unicode-enabled > applications in wxPerl, we *need* wxEncodingConverter at the least. > > Mattia, please? It is not that I can't wrap wxEncodingConverter, but why not use Encode.pm, which is ready, and works (AFAIK)? Regards Mattia |
From: Mattia B. <mb...@ds...> - 2002-10-28 18:33:35
|
On Fri, 25 Oct 2002 19:04:17 +0200 Jouke Visser <jo...@pv...> wrote: > Hi, > > I got a Japanese translationfile in UTF-8, which looks OK in poEdit and > UltraEdit, and tried to use it using Wx::Locale, but no-go: it looks > like line-noise. Of course! You are not using an Unicode-capable wxPerl/wxWindows. > And another thing that is quite flakey: I have a preferences window in > my application and when I try to change the language there more than > three times in one session, the application crashes without any > error-message. Since this wasn't there when I used > Locale::Maketext::Lexicon (I didn't change any logic in the program, I > just replaced the gettext from that module to that from Wx::Locale and > of course the initialization), this must have something to do with > Wx::Locale. OK, but I can't reproduce it in the demo. Test case? > Now, the machine I'm testing on is Windows XP, I'm using wxPerl 0.12 > (the PPM binary from the site) and ActivePerl build 633. > > The .po/.mo files are OK, since poEdit handles everything correctly. > > And oh yeah, with some locale-sets (for example 'nl') I get a popup > window (from Wx) that it can't set that locale (although 'nl' is my > default on this machine) and it continues with the correct > translations...isn't that weird? I've tried to set it to 'nl', 'nl-nl', > 'nl_nl', but nothing works. As far as I know it should just be 'nl' > (which worked with Locale::Maketext::Lexicon). I can reproduce this, but I need to investigate it. Regards Mattia |
From: Jouke V. <jo...@pv...> - 2002-10-29 09:38:25
|
> > >>I got a Japanese translationfile in UTF-8, which looks OK in poEdit and >>UltraEdit, and tried to use it using Wx::Locale, but no-go: it looks >>like line-noise. >> >Of course! You are not using an Unicode-capable wxPerl/wxWindows. > Well, with the new binary it's fixed indeed. I can see perfect Japanese characters (that if it's correctly translated should represent what I hope it will ;-) ) Thanks! >>And another thing that is quite flakey: I have a preferences window in >>my application and when I try to change the language there more than >>three times in one session, the application crashes without any >>error-message. Since this wasn't there when I used >>Locale::Maketext::Lexicon (I didn't change any logic in the program, I >>just replaced the gettext from that module to that from Wx::Locale and >>of course the initialization), this must have something to do with >>Wx::Locale. >> >OK, but I can't reproduce it in the demo. Test case? > >>Now, the machine I'm testing on is Windows XP, I'm using wxPerl 0.12 >>(the PPM binary from the site) and ActivePerl build 633. >> >>The .po/.mo files are OK, since poEdit handles everything correctly. >> >>And oh yeah, with some locale-sets (for example 'nl') I get a popup >>window (from Wx) that it can't set that locale (although 'nl' is my >>default on this machine) and it continues with the correct >>translations...isn't that weird? I've tried to set it to 'nl', 'nl-nl', >>'nl_nl', but nothing works. As far as I know it should just be 'nl' >>(which worked with Locale::Maketext::Lexicon). >> >I can reproduce this, but I need to investigate it. > It seems that both are related. I can't really give you a testcase. From what I deduced so far the problem is as follows: I have a preferences window in my app. If I change the language (and therefore the locale), there is no problem as long as the locale-change doesn't produce that "Locale 'xx' can't be set" error. If it does, the app crashes without any error or warning. It doesn't even produce that Locale-set error. But when I restart the application, it has remembered my locale-change, produces the Locale-set error, and when I change it again, the same thing happens: I can change to whatever language I want, as often as I want, until I choose a language that produces the same error again and it crashes again without that error. If you want to I can send you the complete source of my app, but I think that causes too much confusion. If you really need example code, I can try to strip out all code that's not related to this issue and send it to you then. -- -------------------------------------------------------------------- | Jouke Visser | http://jouke.pvoice.org (personal) | | | http://www.pvoice.org (pVoice & pStory)| | Perl GUI Geek | http://wxperl.pvoice.org (wxPerl) | -------------------------------------------------------------------- |
From: Mattia B. <mb...@ds...> - 2002-10-29 11:14:20
|
On Tue, 29 Oct 2002, Jouke Visser wrote: <app crashing, wxLocale related> >It seems that both are related. I can't really give you a testcase. From >what I deduced so far the problem is as follows: > >I have a preferences window in my app. If I change the language (and >therefore the locale), there is no problem as long as the locale-change >doesn't produce that "Locale 'xx' can't be set" error. If it does, the >app crashes without any error or warning. It doesn't even produce that >Locale-set error. But when I restart the application, it has remembered >my locale-change, produces the Locale-set error, and when I change it >again, the same thing happens: I can change to whatever language I want, >as often as I want, until I choose a language that produces the same >error again and it crashes again without that error. > >If you want to I can send you the complete source of my app, but I think >that causes too much confusion. If you really need example code, I can >try to strip out all code that's not related to this issue and send it >to you then. I think this characterisation is good enough, I will let you know if still I can't reproduce. Thanks Mattia |
From: Mattia B. <mb...@ds...> - 2002-10-31 17:47:20
|
On Tue, 29 Oct 2002 12:14:00 +0100 (CET) Mattia Barbon <mb...@ds...> wrote: > 02 12:14:00 +0100 (CET) > Status: O > > On Tue, 29 Oct 2002, Jouke Visser wrote: > > <app crashing, wxLocale related> > > >It seems that both are related. I can't really give you a testcase. > From > >what I deduced so far the problem is as follows: > > > >I have a preferences window in my app. If I change the language (and > >therefore the locale), there is no problem as long as the locale-change > >doesn't produce that "Locale 'xx' can't be set" error. If it does, the > >app crashes without any error or warning. It doesn't even produce that > >Locale-set error. But when I restart the application, it has remembered > >my locale-change, produces the Locale-set error, and when I change it > >again, the same thing happens: I can change to whatever language I > want, > >as often as I want, until I choose a language that produces the same > >error again and it crashes again without that error. > > > >If you want to I can send you the complete source of my app, but I > think > >that causes too much confusion. If you really need example code, I can > >try to strip out all code that's not related to this issue and send it > >to you then. > > I think this characterisation is good enough, I will let you know if > still I can't reproduce. I still can't reporduce it. Now I need your sources (stripped down if possible). Thanks Mattia |