]> git.pld-linux.org Git - packages/qt4.git/blob - qt4-locale.patch
- make it build
[packages/qt4.git] / qt4-locale.patch
1 --- qt-x11-preview-4.0.0-tp1/src/core/codecs/qtextcodec.cpp.orig        2004-07-08 11:14:42.000000000 +0200
2 +++ qt-x11-preview-4.0.0-tp1/src/core/codecs/qtextcodec.cpp     2004-07-14 13:30:02.957937568 +0200
3 @@ -2630,14 +2630,35 @@
4          // Get the first nonempty value from $LC_ALL, $LC_CTYPE, and $LANG
5          // environment variables.
6          char * lang = qstrdup(getenv("LC_ALL"));
7 -        if (!lang || lang[0] == 0 || strcmp(lang, "C") == 0) {
8 +        if (!lang || lang[0] == 0 ) {
9              if (lang) delete [] lang;
10              lang = qstrdup(getenv("LC_CTYPE"));
11          }
12 -        if (!lang || lang[0] == 0 || strcmp(lang, "C") == 0) {
13 +        if (!lang || lang[0] == 0 ) {
14              if (lang) delete [] lang;
15              lang = qstrdup(getenv("LANG"));
16          }
17 +        QString lang_s (lang);
18 +
19 +        QFile * plik = new QFile("/usr/share/locale/locale.alias");
20 +        if (plik->open(QIODevice::ReadOnly))
21 +        {
22 +                QTextStream stream(plik);
23 +                QString line;
24 +                int i = 1;
25 +                while (!stream.atEnd()) {
26 +                        line = stream.readLine();
27 +                        if (!line.startsWith("#") && ( line.left(line.indexOf(QChar('t'))) == lang_s.toLower() ) )
28 +                        {
29 +                               if (lang) delete [] lang;
30 +                                lang = qstrdup((line.mid(line.lastIndexOf(QChar('t')))).ascii());
31 +                        }
32 +                }
33 +                plik->close();
34 +        }
35 +       if (plik) delete plik;
36 +       
37 +       
38  
39          // Now try these in order:
40          // 1. CODESET from ctype if it contains a .CODESET part (e.g. en_US.ISO8859-15)
41 --- qt-x11-preview-4.0.0-tp1/tools/assistant/main.cpp.orig      2004-07-08 11:14:30.000000000 +0200
42 +++ qt-x11-preview-4.0.0-tp1/tools/assistant/main.cpp   2004-07-13 22:14:09.000000000 +0200
43 @@ -254,11 +254,11 @@
44          resourceDir = QFile::decodeName(qInstallPathTranslations());
45  
46      QTranslator translator( 0 );
47 -    translator.load( QLatin1String("assistant_") + QLatin1String(QTextCodec::locale()), resourceDir );
48 +    translator.load( QLatin1String("assistant"), resourceDir + QLatin1String("/") + QLatin1String(QTextCodec::locale()) + QLatin1String("/LC_MESSAGES") );
49      a.installTranslator( &translator );
50  
51      QTranslator qtTranslator( 0 );
52 -    qtTranslator.load( QLatin1String("qt_") + QLatin1String(QTextCodec::locale()), resourceDir );
53 +    qtTranslator.load( QLatin1String("qt"), resourceDir + QLatin1String("/") + QLatin1String(QTextCodec::locale()) + QLatin1String("/LC_MESSAGES") );
54      a.installTranslator( &qtTranslator );
55  
56      Config *conf = Config::loadConfig( profileName );
57
This page took 0.106887 seconds and 4 git commands to generate.