Details for the issue
What did you do?
Started the app for the first time (fresh install, no existing settings file).
What did you expect to see?
The GUI in English, matching my Windows display language.
What did you see instead?
The GUI in a mix of Swedish and English (the Swedish translation seems incomplete).
My Windows display language is English. My region and regional format are Sweden/Swedish.

Cause (from reading the source)
In src/Settings.cpp, the default for General/language is:
return QLocale::system().name();
This is derived from the regional format (sv_SE), not the Windows display language. src/Application.cpp then loads sqlb_<that value> and saves it back with Settings::setValue("General", "language", name), so the choice sticks after the first launch.
Suggested fix
Use the first entry of QLocale::system().uiLanguages() as the default, which reflects the display language. As far as I can tell, the value needs - converted to _, because QTranslator::load() only splits on _ and .:
const QStringList ui = QLocale::system().uiLanguages();
if(!ui.isEmpty())
return ui.first().replace('-', '_');
return QLocale::system().name();
I haven't built or tested this, and I haven't checked tags with a script such as zh-Hans-CN (Simplified Chinese).
Useful extra information
DB4S v3.13.1 [built for i386-little_endian-ilp32] on Windows 10 Version 2009 (winnt/10.0.26200) [x86_64]
using SQLite Version 3.46.1
and Qt 5.15.2
Details for the issue
What did you do?
Started the app for the first time (fresh install, no existing settings file).
What did you expect to see?
The GUI in English, matching my Windows display language.
What did you see instead?
The GUI in a mix of Swedish and English (the Swedish translation seems incomplete).

My Windows display language is English. My region and regional format are Sweden/Swedish.
Cause (from reading the source)
In
src/Settings.cpp, the default forGeneral/languageis:This is derived from the regional format (
sv_SE), not the Windows display language.src/Application.cppthen loadssqlb_<that value>and saves it back withSettings::setValue("General", "language", name), so the choice sticks after the first launch.Suggested fix
Use the first entry of
QLocale::system().uiLanguages()as the default, which reflects the display language. As far as I can tell, the value needs-converted to_, becauseQTranslator::load()only splits on_and.:I haven't built or tested this, and I haven't checked tags with a script such as
zh-Hans-CN(Simplified Chinese).Useful extra information