Fix qml translations

This commit is contained in:
Nicolas Werner 2023-07-13 01:10:09 +02:00
parent aac1604c5f
commit 4fa2a6e9aa
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
31 changed files with 79785 additions and 12 deletions

View file

@ -692,13 +692,6 @@ set_target_properties(nheko
CMAKE_SKIP_INSTALL_RPATH TRUE CMAKE_SKIP_INSTALL_RPATH TRUE
AUTOMOC ON) AUTOMOC ON)
#
# Bundle translations
#
file(GLOB LANG_TS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/resources/langs/*.ts")
qt_add_translations(nheko RESOURCE_PREFIX "/translations" TS_FILES ${LANG_TS_SRC})
# #
# Add qml files # Add qml files
# #
@ -824,6 +817,14 @@ qt_add_qml_module(nheko
#) #)
#
# Bundle translations
#
file(GLOB LANG_TS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/resources/langs/*.ts")
qt_add_translations(nheko RESOURCE_PREFIX "/translations" TS_FILES
${LANG_TS_SRC} SOURCES ${QML_SOURCES} ${SRC_FILES})
if(WIN32) if(WIN32)
target_compile_definitions(nheko PRIVATE WIN32_LEAN_AND_MEAN) target_compile_definitions(nheko PRIVATE WIN32_LEAN_AND_MEAN)
if(MSVC) if(MSVC)

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -334,10 +334,21 @@ main(int argc, char *argv[])
QTranslator qtTranslator; QTranslator qtTranslator;
if (qtTranslator.load(QLocale(), if (qtTranslator.load(QLocale(),
QStringLiteral("qt"), QStringLiteral("qtbase"),
QStringLiteral("_"), QStringLiteral("_"),
QLibraryInfo::path(QLibraryInfo::TranslationsPath))) QLibraryInfo::path(QLibraryInfo::TranslationsPath))) {
app.installTranslator(&qtTranslator); app.installTranslator(&qtTranslator);
} else
qDebug() << "Failed to load qtbase translations: "
<< QLibraryInfo::path(QLibraryInfo::TranslationsPath);
QTranslator qmlTranslator;
if (qmlTranslator.load(QLocale(),
QStringLiteral("qtdeclarative"),
QStringLiteral("_"),
QLibraryInfo::path(QLibraryInfo::TranslationsPath))) {
app.installTranslator(&qmlTranslator);
} else
qDebug() << "Failed to load qtdeclarative translations";
QTranslator appTranslator; QTranslator appTranslator;
if (appTranslator.load(QLocale(), if (appTranslator.load(QLocale(),
@ -345,6 +356,8 @@ main(int argc, char *argv[])
QStringLiteral("_"), QStringLiteral("_"),
QStringLiteral(":/translations"))) QStringLiteral(":/translations")))
app.installTranslator(&appTranslator); app.installTranslator(&appTranslator);
else
qDebug() << "Failed to load nheko translations";
MainWindow w(nullptr); MainWindow w(nullptr);
// QQuickView w; // QQuickView w;