Skip to content

Commit

Permalink
Add Italian language loader and enable the option to support PR #335
Browse files Browse the repository at this point in the history
  • Loading branch information
dannagle committed Sep 30, 2023
1 parent dc6a505 commit 7f155fc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,15 @@ int main(int argc, char *argv[])
QDEBUG() << "app lang loaded" << translator.load(":/languages/packetsender_fr.qm");
QDEBUG() << QApplication::installTranslator(&translator_qt) << QApplication::installTranslator(&translator_qtbase) << QApplication::installTranslator(&translator) ;
}


if(language == "Italian") {
QDEBUG() << "qt lang loaded" << translator_qt.load(QString("qt_it"), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
QDEBUG() << "base lang loaded" << translator_qtbase.load(QString("qtbase_it"), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
QDEBUG() << "app lang loaded" << translator.load(":/languages/packetsender_it.qm");
QDEBUG() << QApplication::installTranslator(&translator_qt) << QApplication::installTranslator(&translator_qtbase) << QApplication::installTranslator(&translator) ;
}

QFile file_system(":/packetsender.css");
QFile file_dark(":/qdarkstyle/style.qss");

Expand Down
4 changes: 4 additions & 0 deletions src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,10 @@ QString Settings::language()
return "French";
}

if(language.contains("italian")) {
return "Italian";
}

return "English";
}

Expand Down
2 changes: 2 additions & 0 deletions src/translations.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
<file>languages/spanish-flag.png</file>
<file>languages/packetsender_de.qm</file>
<file>languages/packetsender_fr.qm</file>
<file>languages/italian-flag.png</file>
<file>languages/packetsender_it.qm</file>
</qresource>
</RCC>

0 comments on commit 7f155fc

Please sign in to comment.