summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/rbsettings.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2008-07-25 19:28:24 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2008-07-25 19:28:24 +0000
commitc367c21a7683617c76bc9281991c3ee11adcdaa0 (patch)
tree95c8f9c53c1cac8b8024572bc4b8316786dce8ad /rbutil/rbutilqt/rbsettings.cpp
parent3f01df3f9c713f679d192061000e1441ec664439 (diff)
downloadrockbox-c367c21a7683617c76bc9281991c3ee11adcdaa0.tar.gz
rockbox-c367c21a7683617c76bc9281991c3ee11adcdaa0.tar.bz2
rockbox-c367c21a7683617c76bc9281991c3ee11adcdaa0.zip
Make rbutil check the system language and try to use the correct translation. A language selection in the configuration file will override this.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18118 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/rbsettings.cpp')
-rw-r--r--rbutil/rbutilqt/rbsettings.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/rbutil/rbutilqt/rbsettings.cpp b/rbutil/rbutilqt/rbsettings.cpp
index 38ed542ee7..d1f90ea7f6 100644
--- a/rbutil/rbutilqt/rbsettings.cpp
+++ b/rbutil/rbutilqt/rbsettings.cpp
@@ -252,7 +252,13 @@ QString RbSettings::curVoiceName()
QString RbSettings::curLang()
{
- return userSettings->value("lang").toString();
+ // QSettings::value only returns the default when the setting
+ // doesn't exist. Make sure to return the system language if
+ // the language in the configuration is present but empty too.
+ QString lang = userSettings->value("lang").toString();
+ if(lang.isEmpty())
+ lang = QLocale::system().name();
+ return lang;
}
QString RbSettings::curEncoder()