Loading translation improved.
This commit is contained in:
parent
a23de4dcf0
commit
9fcfb8e3ba
1 changed files with 5 additions and 14 deletions
|
@ -21,21 +21,12 @@ int main(int argc, char *argv[])
|
||||||
QCoreApplication::setOrganizationDomain("rustysoft.de");
|
QCoreApplication::setOrganizationDomain("rustysoft.de");
|
||||||
QCoreApplication::setApplicationName("kima2");
|
QCoreApplication::setApplicationName("kima2");
|
||||||
|
|
||||||
QTranslator qTranslator;
|
QTranslator qtTranslator;
|
||||||
QLocale german(QLocale::German);
|
|
||||||
#ifdef __linux__
|
if (qtTranslator.load(QLocale::system(), u"qtbase"_qs, u"_"_qs,
|
||||||
bool retVal =
|
QLibraryInfo::path(QLibraryInfo::TranslationsPath))) {
|
||||||
qTranslator.load("qt_" + german.name(), QLibraryInfo::path(QLibraryInfo::TranslationsPath));
|
kimaApp.installTranslator(&qtTranslator);
|
||||||
if (!retVal) {
|
|
||||||
throw std::runtime_error("Could not load translation.");
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#ifdef _WIN32
|
|
||||||
QApplication::setStyle(QStyleFactory::create("Fusion"));
|
|
||||||
qTranslator.load("qt_" + german.name(),
|
|
||||||
QApplication::applicationDirPath() + QDir::separator() + "translations");
|
|
||||||
#endif
|
|
||||||
kimaApp.installTranslator(&qTranslator);
|
|
||||||
|
|
||||||
QSettings settings{};
|
QSettings settings{};
|
||||||
while (!settings.contains("global/cashPointNo")) {
|
while (!settings.contains("global/cashPointNo")) {
|
||||||
|
|
Loading…
Reference in a new issue