]> git.pld-linux.org Git - packages/qt4.git/blob - qt4-locale.patch
- ascii() is obsoleted, using toLatin1() which returns QByteArray which has a convers...
[packages/qt4.git] / qt4-locale.patch
1 --- qt-copy/tools/assistant/main.cpp.orig       2005-05-13 16:39:06.000000000 +0200
2 +++ qt-copy/tools/assistant/main.cpp    2005-05-13 19:58:41.956418200 +0200
3 @@ -272,11 +272,11 @@
4          resourceDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
5  
6      QTranslator translator( 0 );
7 -    translator.load( QLatin1String("assistant_") + QLocale::system().name().toLower(), resourceDir );
8 +    translator.load( QLatin1String("assistant"), resourceDir + QLatin1String("/") + QLatin1String(QTextCodec::locale()) + QLatin1String("/LC_MESSAGES") );
9      a.installTranslator( &translator );
10  
11      QTranslator qtTranslator( 0 );
12 -    qtTranslator.load( QLatin1String("qt_") + QLocale::system().name().toLower(), resourceDir );
13 +    qtTranslator.load( QLatin1String("qt"), resourceDir + QLatin1String("/") + QLatin1String(QTextCodec::locale()) + QLatin1String("/LC_MESSAGES") );
14      a.installTranslator( &qtTranslator );
15  
16      Config *conf = Config::loadConfig( profileName );
17 --- qt-copy/src/corelib/codecs/qtextcodec.cpp.niedakh   2005-05-13 16:34:37.000000000 +0200
18 +++ qt-copy/src/corelib/codecs/qtextcodec.cpp   2005-05-13 22:31:48.036921696 +0200
19 @@ -63,6 +63,9 @@
20  #include <langinfo.h>
21  #endif
22  
23 +#include <qfile.h>
24 +#include <qtextstream.h>
25 +
26  
27  #ifndef QT_NO_COMPONENT
28  Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
29 @@ -359,6 +362,26 @@
30              lang = qstrdup(qgetenv("LANG"));
31          }
32  
33 +         QString lang_s (lang);
34 +
35 +         QFile * plik = new QFile("/usr/share/locale/locale.alias");
36 +         if (plik->open(QIODevice::ReadOnly))
37 +         {
38 +                 QTextStream stream(plik);
39 +                 QString line;
40 +                 while (!stream.atEnd()) {
41 +                         line = stream.readLine();
42 +                         if (!line.startsWith("#") && ( line.left(line.indexOf(QChar('t'))) == lang_s.toLower() ) )
43 +                         {
44 +                               if (lang) delete [] lang;
45 +                                lang = qstrdup((line.mid(line.lastIndexOf(QChar('t')))).toLatin1());
46 +                         }
47 +                }
48 +               plik->close();
49 +         }
50 +        if (plik) delete plik;
51 +                                       
52 +
53          // Now try these in order:
54          // 1. CODESET from ctype if it contains a .CODESET part (e.g. en_US.ISO8859-15)
55          // 2. CODESET from lang if it contains a .CODESET part
This page took 0.079571 seconds and 4 git commands to generate.