Thread: Re: pgAdmin3 wxstd.po new translation file (don't translate if

Re: pgAdmin3 wxstd.po new translation file (don't translate if

From
Jean-Michel POURE
Date:
On Sunday 06 July 2003 19:52, you wrote:
> I recieve an error
> "Cannot set locale to fa_IR". I have run the program with farsi with those
> 20 translated strings and it looked good. Could this be a file permission
> error? I will keep trying!

This bug was fixed recently by Andreas. I am rebuilding the binaries. You will
be able to download and install them in a couple of minutes.

Under RedHat, Persian displays in quite large fonts. Are you able to select
the font size in Kde or Gnome easily? Does it suit your needs or would you
prefer a custom size selection in pgAdmin3?

Cheers,
Jean-Michel


Re: pgAdmin3 wxstd.po new translation file (don't

From
Andreas Pflug
Date:
Jean-Michel POURE wrote:

>On Sunday 06 July 2003 19:52, you wrote:
>
>
>>I recieve an error
>>"Cannot set locale to fa_IR". I have run the program with farsi with those
>>20 translated strings and it looked good. Could this be a file permission
>>error? I will keep trying!
>>
>>
>
>This bug was fixed recently by Andreas. I am rebuilding the binaries. You will
>be able to download and install them in a couple of minutes.
>
Actually what I fixed was *not* that inability to set the locale to
fa_IR. pgAdmin3 assumed the setting of locale to be always successful,
and stored this in preferences. Now the returncode is checked, and if
setting locale was unsuccessful the previous value will be preserved.

I had a deeper look as my Linux system (vanilla SuSE 8.1) and found out
that the fa_IR locale actually is named fa_IR.utf8, but wxWindows isn't
aware of that. The attached patch will make wxWindows able to use Farsi.

Regards,
Andreas
Index: intl.cpp
===================================================================
RCS file: /pack/cvsroots/wxwindows/wxWindows/src/common/intl.cpp,v
retrieving revision 1.96
diff -c -r1.96 intl.cpp
*** intl.cpp    2003/06/13 10:16:19    1.96
--- intl.cpp    2003/07/07 00:30:25
***************
*** 141,146 ****
--- 141,163 ----
  #endif // __UNIX__


+ #if wxUSE_UNICODE
+
+ static wxWCharBuffer wxSetlocaleUtf(int c, const wxChar *lc)
+ {
+     wxWCharBuffer l=wxSetlocale(c, lc);
+     if (!l)
+     {
+     wxString buf(lc);
+     buf += wxT(".utf8");
+     l=wxSetlocale(c, buf.c_str());
+     }
+     return l;
+ }
+ #else
+ #define wxSetlocaleUtf(c, lc)  wxSetlocale(c, lc)
+ #endif
+
  // ----------------------------------------------------------------------------
  // wxMsgCatalogFile corresponds to one disk-file message catalog.
  //
***************
*** 615,621 ****
      wxCHECK_MSG( szLocale, FALSE, _T("no locale to set in wxLocale::Init()") );
    }

!   m_pszOldLocale = wxStrdup(wxSetlocale(LC_ALL, szLocale));
    if ( m_pszOldLocale == NULL )
      wxLogError(_("locale '%s' can not be set."), szLocale);

--- 632,638 ----
      wxCHECK_MSG( szLocale, FALSE, _T("no locale to set in wxLocale::Init()") );
    }

!   m_pszOldLocale = wxStrdup(wxSetlocaleUtf(LC_ALL, szLocale));
    if ( m_pszOldLocale == NULL )
      wxLogError(_("locale '%s' can not be set."), szLocale);

***************
*** 679,690 ****
      else
          locale = info->CanonicalName;

!     wxMB2WXbuf retloc = wxSetlocale(LC_ALL, locale);

      if ( !retloc )
      {
          // Some C libraries don't like xx_YY form and require xx only
!         retloc = wxSetlocale(LC_ALL, locale.Mid(0,2));
      }
      if ( !retloc )
      {
--- 696,707 ----
      else
          locale = info->CanonicalName;

!     wxMB2WXbuf retloc = wxSetlocaleUtf(LC_ALL, locale);

      if ( !retloc )
      {
          // Some C libraries don't like xx_YY form and require xx only
!         retloc = wxSetlocaleUtf(LC_ALL, locale.Mid(0,2));
      }
      if ( !retloc )
      {
***************
*** 702,714 ****
          else if (mid == wxT("nn"))
              locale = wxT("no_NY");

!         retloc = wxSetlocale(LC_ALL, locale);
      }
      if ( !retloc )
      {
          // (This time, we changed locale in previous if-branch, so try again.)
          // Some C libraries don't like xx_YY form and require xx only
!         retloc = wxSetlocale(LC_ALL, locale.Mid(0,2));
      }
      if ( !retloc )
      {
--- 719,731 ----
          else if (mid == wxT("nn"))
              locale = wxT("no_NY");

!         retloc = wxSetlocaleUtf(LC_ALL, locale);
      }
      if ( !retloc )
      {
          // (This time, we changed locale in previous if-branch, so try again.)
          // Some C libraries don't like xx_YY form and require xx only
!         retloc = wxSetlocaleUtf(LC_ALL, locale.Mid(0,2));
      }
      if ( !retloc )
      {
***************
*** 764,770 ****
              }
              else
              {
!                 retloc = wxSetlocale(LC_ALL, locale);
  #ifdef SETLOCALE_FAILS_ON_UNICODE_LANGS
                  if (codepage == 0 && (const wxChar*)retloc == NULL)
                  {
--- 781,787 ----
              }
              else
              {
!                 retloc = wxSetlocaleUtf(LC_ALL, locale);
  #ifdef SETLOCALE_FAILS_ON_UNICODE_LANGS
                  if (codepage == 0 && (const wxChar*)retloc == NULL)
                  {
***************
*** 1512,1518 ****

      // restore old locale
      wxSetLocale(m_pOldLocale);
!     wxSetlocale(LC_ALL, m_pszOldLocale);
      free((wxChar *)m_pszOldLocale);     // const_cast
  }

--- 1529,1535 ----

      // restore old locale
      wxSetLocale(m_pOldLocale);
!     wxSetlocaleUtf(LC_ALL, m_pszOldLocale);
      free((wxChar *)m_pszOldLocale);     // const_cast
  }


Re: pgAdmin3 wxstd.po new translation file (don't

From
"Hiroshi Saito"
Date:
Hi Andreas.

As for Japan as well, this problem is remarkable.
But, it is tried to solve it with the point of view by a setup of locale.
However,
japanese links with UTF-8 of locale if it says about early "SUN".
It was written in compliment the freebsd_notes.html as well about this
countermeasure.
Your patch will solve a problem.
But,
Will a wxWindows team accept this?

Regards,
Hiroshi-Saito

From: "Andreas Pflug" <pgadmin@pse-consulting.de>

> Jean-Michel POURE wrote:
>
> >On Sunday 06 July 2003 19:52, you wrote:
> >
> >
> >>I recieve an error
> >>"Cannot set locale to fa_IR". I have run the program with farsi with
those
> >>20 translated strings and it looked good. Could this be a file
permission
> >>error? I will keep trying!
> >>
> >>
> >
> >This bug was fixed recently by Andreas. I am rebuilding the binaries. You
will
> >be able to download and install them in a couple of minutes.
> >
> Actually what I fixed was *not* that inability to set the locale to
> fa_IR. pgAdmin3 assumed the setting of locale to be always successful,
> and stored this in preferences. Now the returncode is checked, and if
> setting locale was unsuccessful the previous value will be preserved.
>
> I had a deeper look as my Linux system (vanilla SuSE 8.1) and found out
> that the fa_IR locale actually is named fa_IR.utf8, but wxWindows isn't
> aware of that. The attached patch will make wxWindows able to use Farsi.
>
> Regards,
> Andreas
>


Re: pgAdmin3 wxstd.po new translation file (don't

From
Andreas Pflug
Date:
Hiroshi Saito wrote:

>Hi Andreas.
>
>As for Japan as well, this problem is remarkable.
>But, it is tried to solve it with the point of view by a setup of locale.
>However,
>japanese links with UTF-8 of locale if it says about early "SUN".
>It was written in compliment the freebsd_notes.html as well about this
>countermeasure.
>Your patch will solve a problem.
>But,
>Will a wxWindows team accept this?
>
>
>
I posted this to wxWindows, let's see what happens.

Regards,
Andreas



Re: pgAdmin3 wxstd.po new translation file (don't

From
"Hiroshi Saito"
Date:
Hi Andreas.

It is a wonderful report. A problem was solved in this.
https://sourceforge.net/tracker/index.php?func=detail&aid=766893&group_id=98
63&atid=309863

Your work is always wonderful.

Regards,
Hiroshi-Saito

From: "Andreas Pflug" <pgadmin@pse-consulting.de>


> Hiroshi Saito wrote:
>
> >Hi Andreas.
> >
> >As for Japan as well, this problem is remarkable.
> >But, it is tried to solve it with the point of view by a setup of locale.
> >However,
> >japanese links with UTF-8 of locale if it says about early "SUN".
> >It was written in compliment the freebsd_notes.html as well about this
> >countermeasure.
> >Your patch will solve a problem.
> >But,
> >Will a wxWindows team accept this?
> >
> >
> >
> I posted this to wxWindows, let's see what happens.


Re: pgAdmin3 wxstd.po new translation file (don't

From
Andreas Pflug
Date:
Hiroshi Saito wrote:

>Hi Andreas.
>
>It is a wonderful report. A problem was solved in this.
>https://sourceforge.net/tracker/index.php?func=detail&aid=766893&group_id=98
>63&atid=309863
>
>Your work is always wonderful.
>
>
Thanks, I'd be lucky if it was :-)

But I'll try my best (usually).

Regards