Skip to content

Commit

Permalink
Fix translation file load
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugen Fischer authored and Eugen Fischer committed Nov 2, 2023
1 parent 7fd6341 commit 3858e6d
Showing 1 changed file with 9 additions and 25 deletions.
34 changes: 9 additions & 25 deletions src/gui/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -993,32 +993,16 @@ void Application::setupTranslations()
installTranslator(qtkeychainTranslator);

//Make sure, the current language is the last one, because we want to have our languge files to be the last ones
if(uiLanguages.indexOf(lang) == uiLanguages.size() - 1)
if(lang.startsWith(QLatin1String("de")))
{
bool germanFileLoaded = false;
bool englishFileLoaded = false;

//Now search for german or english locales
for (QString lang : qAsConst(uiLanguages))
{
if(!germanFileLoaded && lang.startsWith(QLatin1String("de")))
{
if(!translator->load(QLatin1String("client_magenta_de"), trPath)){
qCritical(lcApplication) << "Could not find magenta language file";
}
else{
germanFileLoaded = true;
}
}
else if(!englishFileLoaded && lang.startsWith(QLatin1String("en")))
{
if(!translator->load(QLatin1String("client_magenta_en"), trPath)){
qCritical(lcApplication) << "Could not find magenta language file";
}
else{
englishFileLoaded = true;
}
}
if(!translator->load(QLatin1String("client_magenta_de"), trPath)){
qCritical(lcApplication) << "Could not find magenta language file";
}
}
else if(lang.startsWith(QLatin1String("en")))
{
if(!translator->load(QLatin1String("client_magenta_en"), trPath)){
qCritical(lcApplication) << "Could not find magenta language file";
}
}
break;
Expand Down

0 comments on commit 3858e6d

Please sign in to comment.