-rw-r--r-- | library/qpeapplication.cpp | 38 |
1 files changed, 10 insertions, 28 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 70ffec1..4dbfbd8 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp @@ -19,6 +19,7 @@ ** $Id$ ** **********************************************************************/ +#define QTOPIA_INTERNAL_LANGLIST #include <stdlib.h> #include <unistd.h> #include <qfile.h> @@ -137,22 +138,7 @@ class ResourceMimeFactory : public QMimeSourceFactory { public: ResourceMimeFactory() { - QStringList path; - QString lang = getenv("LANG"); - if ( !lang.isEmpty() ) - path += QPEApplication::qpeDir() + "/help/" + lang + "/html"; - path += QPEApplication::qpeDir() + "/pics"; - path += QPEApplication::qpeDir() + "/help/en/html"; - path += QPEApplication::qpeDir() + "/docs"; - QString dir = QDir::current().canonicalPath(); - if ( dir == "/" ) - dir += "/docs"; - else { - path += dir + "/../pics"; - dir += "/../docs"; - path += dir; - } - setFilePath( path ); + setFilePath( Global::helpPath() ); setExtensionType("html","text/html;charset=UTF-8"); } @@ -537,26 +523,22 @@ QPEApplication::QPEApplication( int& argc, char **argv, Type t ) qwsSetDecoration( new QPEDecoration() ); #ifndef QT_NO_TRANSLATION - char *l = getenv( "LANG" ); - QString lang; - if ( l ) { - lang = l; + QStringList langs = Global::languageList(); + for (QStringList::ConstIterator it = langs.begin(); it!=langs.end(); ++it) { + QString lang = *it; - /* - Config config("qpe"); - config.setGroup( "Appearance" ); - lang = config.readEntry( "Language", lang ); - */ + QTranslator * trans; + QString tfn; - QTranslator * trans = new QTranslator(this); - QString tfn = qpeDir()+"/i18n/"+lang+"/"+d->appName+".qm"; + trans = new QTranslator(this); + tfn = qpeDir()+"/i18n/"+lang+"/libqpe.qm"; if ( trans->load( tfn )) installTranslator( trans ); else delete trans; trans = new QTranslator(this); - tfn = qpeDir()+"/i18n/"+lang+"/libqpe.qm"; + tfn = qpeDir()+"/i18n/"+lang+"/"+d->appName+".qm"; if ( trans->load( tfn )) installTranslator( trans ); else |