summaryrefslogtreecommitdiffstats
path: root/src/qmainrec.cpp
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2016-04-09 17:06:23 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2016-04-09 17:06:23 +0200
commitfa3008044034b173121bd51bf034fa3e2b6ff607 (patch)
tree774933c3c3b204a130e56e289a9b2d8083820fa4 /src/qmainrec.cpp
parent916cfbd5c313562c76212064438e4292a1556b1b (diff)
QPhotRec: add French translation
Diffstat (limited to 'src/qmainrec.cpp')
-rw-r--r--src/qmainrec.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/qmainrec.cpp b/src/qmainrec.cpp
index 43b9c94..842ee61 100644
--- a/src/qmainrec.cpp
+++ b/src/qmainrec.cpp
@@ -25,6 +25,7 @@
#endif
#include <QApplication>
+#include <QTranslator>
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
@@ -103,8 +104,20 @@ int main(int argc, char *argv[])
}
}
#endif
- QApplication a(argc, argv);
log_handle=log_open("qphotorec.log", TD_LOG_CREATE, &log_errno);
+ QApplication a(argc, argv);
+ QTranslator translator;
+ QString locale = QLocale::system().name().section('_', 0, 0);
+ log_info("%s\n", locale.toStdString().c_str());
+ if(translator.load(QLocale(), "qphotorec", ".", ":lang/", ".qm"))
+ {
+ a.installTranslator(&translator);
+ log_info("translator installed\n");
+ }
+ else
+ {
+ log_info("translator not installed\n");
+ }
#ifdef HAVE_DUP2
if(log_handle)
{