Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kovzol committed Jan 22, 2024
1 parent 1706121 commit 365ff90
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/ui/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ static int ui_languageselected(uih_context *c, int p)
}

void setLanguage(const char *lang) {
bool success;
if (lang == NULL || strcmp(languages2[UIH_LANG_SYS_DEFAULT], lang) == 0) {
languageSysDefault = true;
} else {
Expand All @@ -458,14 +459,13 @@ void setLanguage(const char *lang) {
language = QLocale::system().name();
}
strcpy(languageSetting, language.toStdString().c_str());
qtTranslator.load("qt_" + language,
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
success = qtTranslator.load("qt_" + language,
QLibraryInfo::path(QLibraryInfo::TranslationsPath));
qApp->installTranslator(&qtTranslator);
qtBaseTranslator.load(QLocale::system(),
success = qtBaseTranslator.load(QLocale::system(),
QStringLiteral("qtbase_"));
qApp->installTranslator(&qtBaseTranslator);
xaosTranslator.load("XaoS_" + language,
":/i18n");
success = xaosTranslator.load("XaoS_" + language, ":/i18n");
qApp->installTranslator(&xaosTranslator);

/* Without this some locales (e.g. the Hungarian) replaces "." to ","
Expand All @@ -475,6 +475,7 @@ void setLanguage(const char *lang) {
setlocale(LC_NUMERIC, "C");
// printf("Language set to %s\n", languageSetting);
// fflush(stdout);

}

static void ui_registermenus_i18n(void)
Expand Down

0 comments on commit 365ff90

Please sign in to comment.