qttranslator_v2.patch
src/qtui/qtui.cc | ||
---|---|---|
18 | 18 |
*/ |
19 | 19 | |
20 | 20 |
#include <QApplication> |
21 |
#include <QLibraryInfo> |
|
21 | 22 |
#include <QPointer> |
23 |
#include <QTranslator> |
|
22 | 24 | |
23 | 25 |
#include <libaudcore/i18n.h> |
24 | 26 |
#include <libaudcore/plugin.h> |
... | ... | |
55 | 57 |
audqt::cleanup(); |
56 | 58 |
} |
57 | 59 | |
58 |
void run() { QApplication::exec(); } |
|
60 |
void run() |
|
61 |
{ |
|
62 |
QTranslator translator; |
|
63 |
QLocale locale = QLocale::system(); |
|
64 |
QString dir = QLibraryInfo::location(QLibraryInfo::TranslationsPath); |
|
65 | ||
66 |
if (translator.load(locale, "qt", "_", dir)) |
|
67 |
QApplication::installTranslator(&translator); |
|
68 | ||
69 |
if (translator.load(locale, "qtbase", "_", dir)) |
|
70 |
QApplication::installTranslator(&translator); |
|
71 | ||
72 |
QApplication::exec(); |
|
73 |
} |
|
59 | 74 | |
60 | 75 |
void show(bool show) |
61 | 76 |
{ |
src/skins-qt/plugin.cc | ||
---|---|---|
22 | 22 |
#include <glib.h> |
23 | 23 | |
24 | 24 |
#include <QApplication> |
25 |
#include <QLibraryInfo> |
|
25 | 26 |
#include <QPointer> |
27 |
#include <QTranslator> |
|
26 | 28 | |
27 | 29 |
#include <libaudcore/audstrings.h> |
28 | 30 |
#include <libaudcore/drct.h> |
... | ... | |
78 | 80 |
audqt::cleanup (); |
79 | 81 |
} |
80 | 82 | |
81 |
void run () { QApplication::exec (); } |
|
83 |
void run () |
|
84 |
{ |
|
85 |
QTranslator translator; |
|
86 |
QLocale locale = QLocale::system (); |
|
87 |
QString dir = QLibraryInfo::location (QLibraryInfo::TranslationsPath); |
|
88 | ||
89 |
if (translator.load (locale, "qt", "_", dir)) |
|
90 |
QApplication::installTranslator (& translator); |
|
91 | ||
92 |
if (translator.load (locale, "qtbase", "_", dir)) |
|
93 |
QApplication::installTranslator (& translator); |
|
94 | ||
95 |
QApplication::exec (); |
|
96 |
} |
|
82 | 97 | |
83 | 98 |
void quit () |
84 | 99 |
{ |