Łata na QT - obsługa locale

Michal Kochanowicz michal w michal.waw.pl
Pon, 30 Cze 2003, 21:11:00 CEST


Poniżej komentarz do bugreportu dla Licq. Pokazana tam łatka wygląda
sensownie i ma szansę rozwiązać problem olewania LC_MESSAGES przez
programy dla QT. Może ktoś ją zaaplikować?

----- Forwarded message from "SourceForge.net" <noreply w sourceforge.net> -----

> To: noreply w sourceforge.net
> From: "SourceForge.net" <noreply w sourceforge.net>
> Subject: [ licq-Bugs-551799 ] Interface language ignores LC_MESSAGES
> Date: Mon, 30 Jun 2003 11:51:14 -0700
> 
> Bugs item #551799, was opened at 2002-05-03 04:31
> Message generated for change (Comment added) made by nobody
> You can respond by visiting: 
> https://sourceforge.net/tracker/?func=detail&atid=100254&aid=551799&group_id=254
> 
> Category: system
> Group: CVS build
> Status: Open
> Resolution: None
> Priority: 5
> Submitted By: Nobody/Anonymous (nobody)
> Assigned to: Nobody/Anonymous (nobody)
> Summary: Interface language ignores LC_MESSAGES
> 
> Initial Comment:
> Interface language should be set according to
> LC_MESSAGE environment variable. For now it is set
> according to LANG variable and LC_MESSAGES is ignored.
> 
> ----------------------------------------------------------------------
> 
> Comment By: Nobody/Anonymous (nobody)
> Date: 2003-06-30 11:51
> 
> Message:
> Logged In: NO 
> 
> Must be implemented in QTextCodec::locale() 
>  
>  
>  
> diff -urN qt-x11-free-3.1.2-orig/src/codecs/qtextcodec.cpp 
> qt-x11-free-3.1.2/src/codecs/qtextcodec.cpp 
> --- qt-x11-free-3.1.2-orig/src/codecs/qtextcodec.cpp    
> 2003-02-24 11:30:01 +0300 
> +++ qt-x11-free-3.1.2/src/codecs/qtextcodec.cpp 2003-06-10 
> 19:16:46 +0400 
> @@ -1546,7 +1546,13 @@ 
>  const char* QTextCodec::locale() 
>  { 
>      static QCString lang; 
> -    lang = getenv( "LANG" ); 
> +    lang = getenv( "LC_ALL" ); 
> +    if ( lang.isEmpty() ) { 
> +       lang = getenv( "LC_MESSAGES" ); 
> +    } 
> +    if ( lang.isEmpty() ) { 
> +       lang = getenv( "LANG" ); 
> +    } 
>   
>  #if !defined( QWS ) && defined( Q_OS_MAC ) 
>      if ( !lang.isEmpty() ) 
> @@ -2667,11 +2673,11 @@ 
>         // Get the first nonempty value from $LC_ALL, 
> $LC_CTYPE, and $LANG 
>         // environment variables. 
>         char * lang = qstrdup( getenv("LC_ALL") ); 
> -       if ( !lang || lang[0] == 0 || strcmp( lang, "C" ) 
> == 0 ) { 
> +       if ( !lang || lang[0] == 0 ) { 
>             if ( lang ) delete [] lang; 
>             lang = qstrdup( getenv("LC_CTYPE") ); 
>         } 
> -       if ( !lang || lang[0] == 0 || strcmp( lang, "C" ) 
> == 0 ) { 
> +       if ( !lang || lang[0] == 0 ) { 
>             if ( lang ) delete [] lang; 
>             lang = qstrdup( getenv("LANG") ); 
>         } 
> 
> ----------------------------------------------------------------------
> 
> Comment By: Nobody/Anonymous (nobody)
> Date: 2002-05-03 04:34
> 
> Message:
> Logged In: NO 
> 
> I've forgot my email: michal w michal.waw.pl
> 
> ----------------------------------------------------------------------
> 
> You can respond by visiting: 
> https://sourceforge.net/tracker/?func=detail&atid=100254&aid=551799&group_id=254
> 

----- End forwarded message -----

-- 
--= Michal Kochanowicz =--==--==BOFH==--==--= michal w michal.waw.pl =--
--= finger me for PGP public key or visit http://michal.waw.pl/PGP =--
--==--==--==--==--==-- Vodka. Connecting people.--==--==--==--==--==--
A chodzenie po górach SSIE!!!



Więcej informacji o liście dyskusyjnej pld-devel-pl