Mercurial > hg > sonic-visualiser
diff main/main.cpp @ 165:33280c031d19
* Add a colour database, and Add New Colour function to the colour combo
in property box. The colour property is only correctly handled in the
waveform layer so far.
* Add en_GB translation, to translate those annoying Color texts in the
Qt colour picker dialog.
author | Chris Cannam |
---|---|
date | Wed, 11 Jul 2007 17:21:37 +0000 |
parents | dfaf4f9330b5 |
children | 4d762fe10919 |
line wrap: on
line diff
--- a/main/main.cpp Thu Jul 05 15:36:37 2007 +0000 +++ b/main/main.cpp Wed Jul 11 17:21:37 2007 +0000 @@ -31,6 +31,7 @@ #include <QSettings> #include <QIcon> #include <QSessionManager> +#include <QDir> #include <iostream> #include <signal.h> @@ -236,7 +237,17 @@ QTranslator qtTranslator; QString qtTrName = QString("qt_%1").arg(language); std::cerr << "Loading " << qtTrName.toStdString() << "..." << std::endl; - qtTranslator.load(qtTrName); + bool success = false; + if (!(success = qtTranslator.load(qtTrName))) { + QString qtDir = getenv("QTDIR"); + if (qtDir != "") { + success = qtTranslator.load + (qtTrName, QDir(qtDir).filePath("translations")); + } + } + if (!success) { + std::cerr << "Failed to load Qt translation for locale" << std::endl; + } application.installTranslator(&qtTranslator); QTranslator svTranslator;