mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Added a language preference to the Settings.
When the user first opens the application the default language is selected; this can be changed to a hardcoded one by going to system preferences and choosing the one you want. Restart required. Fixes #136 [Dirk Hohndel: whitespace fixes, removed qDebug() call, rephrased the message displayed prompting the user to restart.] Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
bfe5ccda1c
commit
4e263bae98
5 changed files with 118 additions and 18 deletions
|
@ -87,8 +87,12 @@ void init_ui(int *argcp, char ***argvp)
|
|||
QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath());
|
||||
xslt_path = strdup(getSubsurfaceDataPath("xslt").toAscii().data());
|
||||
|
||||
QLocale loc;
|
||||
QSettings s;
|
||||
s.beginGroup("Language");
|
||||
QLocale loc(s.value("UiLanguage", QLocale().uiLanguages().first()).toString());
|
||||
QString uiLang = loc.uiLanguages().first();
|
||||
s.endGroup();
|
||||
|
||||
// there's a stupid Qt bug on MacOS where uiLanguages doesn't give us the country info
|
||||
if (!uiLang.contains('-') && uiLang != loc.bcp47Name()) {
|
||||
QLocale loc2(loc.bcp47Name());
|
||||
|
@ -117,7 +121,6 @@ void init_ui(int *argcp, char ***argvp)
|
|||
}
|
||||
}
|
||||
|
||||
QSettings s;
|
||||
s.beginGroup("DiveComputer");
|
||||
default_dive_computer_vendor = getSetting(s, "dive_computer_vendor");
|
||||
default_dive_computer_product = getSetting(s,"dive_computer_product");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue