Commit 578a0684 authored by Dirk Wilden's avatar Dirk Wilden

load multiple translation files

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6752 383ad7c9-94d9-4d36-a494-682f7c89f535
parent a6275ae5
......@@ -333,13 +333,28 @@ int main(int argc, char **argv)
app.installTranslator(&qtTranslator);
// install translator for Core Application
QTranslator myappTranslator;
QString translationDir = OpenFlipper::Options::translationsDirStr() + QDir::separator();
std::cerr << "Loading own translations from: " << QString(OpenFlipper::Options::translationsDirStr() + QDir::separator() + "OpenFlipper_" + tLang).toStdString() << std::endl;
if ( myappTranslator.load(OpenFlipper::Options::translationsDirStr() + QDir::separator() + "OpenFlipper_" + tLang) )
std::cerr << "Loaded" << std::endl;
std::cerr << "Loading own translations from: " << QString(translationDir + " (" + tLang + ")").toStdString() << std::endl;
QDir dir(translationDir);
dir.setFilter(QDir::Files);
QFileInfoList list = dir.entryInfoList();
for (int i = 0; i < list.size(); ++i) {
QFileInfo fileInfo = list.at(i);
if ( fileInfo.baseName().contains(tLang) ){
QTranslator* myAppTranslator = new QTranslator();
if ( myAppTranslator->load( fileInfo.filePath() ) ){
std::cerr << "Loaded " << fileInfo.fileName().toStdString() << std::endl;
app.installTranslator(&myappTranslator);
app.installTranslator(myAppTranslator);
}
}
}
// After setting all Options from command line, build the real gui
w->init();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment