mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 12:45:26 -05:00
support for translating rbutil. Translation files (*.qm) can be in the binary folder or in the resource :/lang. Incomplete german translation available for testing.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14061 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
917e0acd64
commit
82373b246e
6 changed files with 275 additions and 227 deletions
|
|
@ -7,7 +7,7 @@
|
|||
* \/ \/ \/ \/ \/
|
||||
*
|
||||
* Copyright (C) 2007 by Dominik Riebeling
|
||||
* $Id:$
|
||||
* $Id$
|
||||
*
|
||||
* All files in this archive are subject to the GNU General Public License.
|
||||
* See the file COPYING in the source tree root for full license agreement.
|
||||
|
|
@ -25,8 +25,22 @@
|
|||
int main( int argc, char ** argv ) {
|
||||
QApplication app( argc, argv );
|
||||
|
||||
QString absolutePath = QFileInfo(qApp->arguments().at(0)).absolutePath() + "/";
|
||||
// portable installation:
|
||||
// check for a configuration file in the program folder.
|
||||
QSettings *user;
|
||||
if(QFileInfo(absolutePath + "RockboxUtility.ini").isFile())
|
||||
user = new QSettings(absolutePath + "RockboxUtility.ini", QSettings::IniFormat, 0);
|
||||
else user = new QSettings(QSettings::IniFormat, QSettings::UserScope, "rockbox.org", "RockboxUtility");
|
||||
|
||||
QTranslator translator;
|
||||
// translator.load("rbutil_de.qm");
|
||||
if(user->value("defaults/lang").toString() != "")
|
||||
// install translator
|
||||
if(user->value("defaults/lang", "").toString() != "") {
|
||||
if(!translator.load(user->value("defaults/lang").toString(), absolutePath))
|
||||
translator.load(user->value("defaults/lang").toString(), ":/lang");
|
||||
}
|
||||
delete user;
|
||||
app.installTranslator(&translator);
|
||||
|
||||
RbUtilQt window(0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue