wpa_gui: Add Qt translator installation and German translation

This takes QTranslator into use and adds a German translation of
wpa_gui.
This commit is contained in:
Stefan Oswald 2010-04-11 22:58:08 +03:00 committed by Jouni Malinen
parent 0d76b1ab5f
commit 7c00f6ba86
3 changed files with 1278 additions and 1 deletions

File diff suppressed because it is too large Load diff

View file

@ -16,6 +16,8 @@
#include <winsock.h>
#endif /* CONFIG_NATIVE_WINDOWS */
#include <QApplication>
#include <QtCore/QLibraryInfo>
#include <QtCore/QTranslator>
#include "wpagui.h"
@ -47,9 +49,19 @@ void WpaGuiApp::saveState(QSessionManager &manager)
int main(int argc, char *argv[])
{
WpaGuiApp app(argc, argv);
WpaGui w(&app);
QTranslator translator;
QString locale;
QString resourceDir;
int ret;
locale = QLocale::system().name();
resourceDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
if (!translator.load("wpa_gui_" + locale, resourceDir))
translator.load("wpa_gui_" + locale, "lang");
app.installTranslator(&translator);
WpaGui w(&app);
#ifdef CONFIG_NATIVE_WINDOWS
WSADATA wsaData;
if (WSAStartup(MAKEWORD(2, 0), &wsaData)) {

View file

@ -1,5 +1,6 @@
TEMPLATE = app
LANGUAGE = C++
TRANSLATIONS = lang/wpa_gui_de.ts
CONFIG += qt warn_on release