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