mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 20:55:17 -05:00
Install a second translator for using the internal translation of Qt's widgets. Embedding them into the resources is still missing.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18165 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
aa52f0b81c
commit
d2241e4e48
1 changed files with 6 additions and 0 deletions
|
|
@ -39,6 +39,7 @@ int main( int argc, char ** argv ) {
|
|||
|
||||
QString applang = QLocale::system().name();
|
||||
QTranslator translator;
|
||||
QTranslator qttrans;
|
||||
// install translator
|
||||
if(!user->value("lang", "").toString().isEmpty()) {
|
||||
applang = user->value("lang", "").toString();
|
||||
|
|
@ -46,10 +47,15 @@ int main( int argc, char ** argv ) {
|
|||
if(!applang.isEmpty()) {
|
||||
if(!translator.load("rbutil_" + applang, absolutePath))
|
||||
translator.load("rbutil_" + applang, ":/lang");
|
||||
if(!qttrans.load("qt_" + applang,
|
||||
QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
|
||||
translator.load("qt_" + applang, ":/lang");
|
||||
|
||||
QLocale::setDefault(applang);
|
||||
}
|
||||
delete user;
|
||||
app.installTranslator(&translator);
|
||||
app.installTranslator(&qttrans);
|
||||
|
||||
RbUtilQt window(0);
|
||||
window.show();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue