mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-10-30 09:30:47 +03:00
Fix qml translations
This commit is contained in:
parent
aac1604c5f
commit
4fa2a6e9aa
31 changed files with 79785 additions and 12 deletions
|
@ -692,13 +692,6 @@ set_target_properties(nheko
|
|||
CMAKE_SKIP_INSTALL_RPATH TRUE
|
||||
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
|
||||
#
|
||||
|
@ -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)
|
||||
target_compile_definitions(nheko PRIVATE WIN32_LEAN_AND_MEAN)
|
||||
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
17
src/main.cpp
17
src/main.cpp
|
@ -334,10 +334,21 @@ main(int argc, char *argv[])
|
|||
|
||||
QTranslator qtTranslator;
|
||||
if (qtTranslator.load(QLocale(),
|
||||
QStringLiteral("qt"),
|
||||
QStringLiteral("qtbase"),
|
||||
QStringLiteral("_"),
|
||||
QLibraryInfo::path(QLibraryInfo::TranslationsPath)))
|
||||
QLibraryInfo::path(QLibraryInfo::TranslationsPath))) {
|
||||
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;
|
||||
if (appTranslator.load(QLocale(),
|
||||
|
@ -345,6 +356,8 @@ main(int argc, char *argv[])
|
|||
QStringLiteral("_"),
|
||||
QStringLiteral(":/translations")))
|
||||
app.installTranslator(&appTranslator);
|
||||
else
|
||||
qDebug() << "Failed to load nheko translations";
|
||||
|
||||
MainWindow w(nullptr);
|
||||
// QQuickView w;
|
||||
|
|
Loading…
Reference in a new issue