fixed the lookup path for standard qt messages so that standard dialogs will be translated + fixed categories names for adv search dialog

This commit is contained in:
Jean-Francois Dockes 2012-10-19 10:51:36 +02:00
parent 3e8d43a2e4
commit a7ec04a73d
2 changed files with 17 additions and 15 deletions

View File

@ -133,20 +133,20 @@ void AdvSearch::init()
maxDateDTE->setCalendarPopup(calpop);
// Translations for known categories
cat_translations[QString::fromUtf8("texts")] = tr("texts");
cat_rtranslations[tr("texts")] = QString::fromUtf8("texts");
cat_translations[QString::fromUtf8("texts")] = tr("text");
cat_rtranslations[tr("texts")] = QString::fromUtf8("text");
cat_translations[QString::fromUtf8("spreadsheets")] = tr("spreadsheets");
cat_rtranslations[tr("spreadsheets")] = QString::fromUtf8("spreadsheets");
cat_translations[QString::fromUtf8("spreadsheet")] = tr("spreadsheet");
cat_rtranslations[tr("spreadsheets")] = QString::fromUtf8("spreadsheet");
cat_translations[QString::fromUtf8("presentations")] = tr("presentations");
cat_rtranslations[tr("presentations")] =QString::fromUtf8("presentations");
cat_translations[QString::fromUtf8("presentation")] = tr("presentation");
cat_rtranslations[tr("presentation")] =QString::fromUtf8("presentation");
cat_translations[QString::fromUtf8("media")] = tr("media");
cat_rtranslations[tr("media")] = QString::fromUtf8("media");
cat_translations[QString::fromUtf8("messages")] = tr("messages");
cat_rtranslations[tr("messages")] = QString::fromUtf8("messages");
cat_translations[QString::fromUtf8("message")] = tr("message");
cat_rtranslations[tr("message")] = QString::fromUtf8("message");
cat_translations[QString::fromUtf8("other")] = tr("other");
cat_rtranslations[tr("other")] = QString::fromUtf8("other");

View File

@ -30,6 +30,7 @@
#include <qcheckbox.h>
#include <qcombobox.h>
#include <QLocale>
#include <QLibraryInfo>
#include "rcldb.h"
#include "rclconfig.h"
@ -297,12 +298,6 @@ int main(int argc, char **argv)
Usage();
// Translation file for Qt
QString slang = QLocale::system().name().left(2);
QTranslator qt(0);
qt.load(QString("qt_") + slang, "." );
app.installTranslator( &qt );
string reason;
theconfig = recollinit(recollCleanup, sigcleanup, reason, &a_config);
if (!theconfig || !theconfig->ok()) {
@ -311,8 +306,15 @@ int main(int argc, char **argv)
QMessageBox::critical(0, "Recoll", msg);
exit(1);
}
snapshotConfig();
// fprintf(stderr, "recollinit done\n");
snapshotConfig();
// Translations for Qt standard widgets
QString slang = QLocale::system().name().left(2);
QTranslator qt_trans(0);
qt_trans.load(QString("qt_%1").arg(slang),
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
app.installTranslator(&qt_trans);
// Translations for Recoll
string translatdir = path_cat(theconfig->getDatadir(), "translations");