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:
parent
0d76b1ab5f
commit
7c00f6ba86
3 changed files with 1278 additions and 1 deletions
1264
wpa_supplicant/wpa_gui-qt4/lang/wpa_gui_de.ts
Normal file
1264
wpa_supplicant/wpa_gui-qt4/lang/wpa_gui_de.ts
Normal file
File diff suppressed because it is too large
Load diff
|
@ -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)) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
TEMPLATE = app
|
||||
LANGUAGE = C++
|
||||
TRANSLATIONS = lang/wpa_gui_de.ts
|
||||
|
||||
CONFIG += qt warn_on release
|
||||
|
||||
|
|
Loading…
Reference in a new issue