Skip to content

Commit

Permalink
GUI - further locale discovery tweaks
Browse files Browse the repository at this point in the history
Now Windows 10 appears to behave similarly to macOS Big Sur.
  • Loading branch information
samaaron committed Feb 1, 2021
1 parent b536d40 commit fb20bd6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/gui/qt/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ int main(int argc, char *argv[])

qRegisterMetaType<SonicPiLog::MultiMessage>("SonicPiLog::MultiMessage");

QString systemLocale = QLocale::system().uiLanguages()[0];
QString systemLocale = QLocale::system().uiLanguages()[0].replace("-", "_");

QTranslator qtTranslator;
qtTranslator.load("qt_" + systemLocale, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
app.installTranslator(&qtTranslator);

QTranslator translator;
bool i18n = translator.load(QLocale(), QLatin1String("sonic-pi"), QLatin1String("_"), QLatin1String(":/lang")) || systemLocale.startsWith("en") || systemLocale == "C";
bool i18n = translator.load(QLatin1String("sonic-pi_") + systemLocale, QLatin1String(":/lang")) || systemLocale.startsWith("en") || systemLocale == "C";
app.installTranslator(&translator);

app.setApplicationName(QObject::tr("Sonic Pi"));
Expand Down

0 comments on commit fb20bd6

Please sign in to comment.