mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Make sure we handle untranslated Subsurface correctly
At least on the Mac we otherwise switch to the next language which is not what the user likely intended. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
1a98e049dc
commit
2d69d4a5ef
1 changed files with 4 additions and 1 deletions
|
@ -85,7 +85,10 @@ void init_ui(int *argcp, char ***argvp)
|
||||||
xslt_path = strdup(getSubsurfaceDataPath("xslt").toAscii().data());
|
xslt_path = strdup(getSubsurfaceDataPath("xslt").toAscii().data());
|
||||||
|
|
||||||
QLocale loc;
|
QLocale loc;
|
||||||
if (loc.uiLanguages().first() != "en-US") {
|
// we don't have translations for English - if we don't check for this
|
||||||
|
// Qt will proceed to load the second language in preference order - not what we want
|
||||||
|
// on Linux this tends to be en-US, but on the Mac it's just en
|
||||||
|
if (!loc.uiLanguages().first().startsWith("en")) {
|
||||||
qtTranslator = new QTranslator;
|
qtTranslator = new QTranslator;
|
||||||
if (qtTranslator->load(loc,"qt", "_", QLibraryInfo::location(QLibraryInfo::TranslationsPath))) {
|
if (qtTranslator->load(loc,"qt", "_", QLibraryInfo::location(QLibraryInfo::TranslationsPath))) {
|
||||||
application->installTranslator(qtTranslator);
|
application->installTranslator(qtTranslator);
|
||||||
|
|
Loading…
Reference in a new issue