diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/CMakeLists.txt | 14 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_ui.cpp | 1 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 5 |
3 files changed, 14 insertions, 6 deletions
diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index f6b389ede..50007338f 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt | |||
| @@ -221,6 +221,9 @@ if (ENABLE_QT_TRANSLATION) | |||
| 221 | # Update source TS file if enabled | 221 | # Update source TS file if enabled |
| 222 | if (GENERATE_QT_TRANSLATION) | 222 | if (GENERATE_QT_TRANSLATION) |
| 223 | get_target_property(SRCS yuzu SOURCES) | 223 | get_target_property(SRCS yuzu SOURCES) |
| 224 | # these calls to qt_create_translation also creates a rule to generate en.qm which conflicts with providing english plurals | ||
| 225 | # so we have to set a OUTPUT_LOCATION so that we don't have multiple rules to generate en.qm | ||
| 226 | set_source_files_properties(${YUZU_QT_LANGUAGES}/en.ts PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/translations") | ||
| 224 | qt_create_translation(QM_FILES | 227 | qt_create_translation(QM_FILES |
| 225 | ${SRCS} | 228 | ${SRCS} |
| 226 | ${UIS} | 229 | ${UIS} |
| @@ -229,7 +232,13 @@ if (ENABLE_QT_TRANSLATION) | |||
| 229 | -source-language en_US | 232 | -source-language en_US |
| 230 | -target-language en_US | 233 | -target-language en_US |
| 231 | ) | 234 | ) |
| 232 | add_custom_target(translation ALL DEPENDS ${YUZU_QT_LANGUAGES}/en.ts) | 235 | |
| 236 | # Generate plurals into dist/english_plurals/generated_en.ts so it can be used to revise dist/english_plurals/en.ts | ||
| 237 | set(GENERATED_PLURALS_FILE ${PROJECT_SOURCE_DIR}/dist/english_plurals/generated_en.ts) | ||
| 238 | set_source_files_properties(${GENERATED_PLURALS_FILE} PROPERTIES OUTPUT_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/plurals") | ||
| 239 | qt_create_translation(QM_FILES ${SRCS} ${UIS} ${GENERATED_PLURALS_FILE} OPTIONS -pluralonly -source-language en_US -target-language en_US) | ||
| 240 | |||
| 241 | add_custom_target(translation ALL DEPENDS ${YUZU_QT_LANGUAGES}/en.ts ${GENERATED_PLURALS_FILE}) | ||
| 233 | endif() | 242 | endif() |
| 234 | 243 | ||
| 235 | # Find all TS files except en.ts | 244 | # Find all TS files except en.ts |
| @@ -239,6 +248,9 @@ if (ENABLE_QT_TRANSLATION) | |||
| 239 | # Compile TS files to QM files | 248 | # Compile TS files to QM files |
| 240 | qt_add_translation(LANGUAGES_QM ${LANGUAGES_TS}) | 249 | qt_add_translation(LANGUAGES_QM ${LANGUAGES_TS}) |
| 241 | 250 | ||
| 251 | # Compile english plurals TS file to en.qm | ||
| 252 | qt_add_translation(LANGUAGES_QM ${PROJECT_SOURCE_DIR}/dist/english_plurals/en.ts) | ||
| 253 | |||
| 242 | # Build a QRC file from the QM file list | 254 | # Build a QRC file from the QM file list |
| 243 | set(LANGUAGES_QRC ${CMAKE_CURRENT_BINARY_DIR}/languages.qrc) | 255 | set(LANGUAGES_QRC ${CMAKE_CURRENT_BINARY_DIR}/languages.qrc) |
| 244 | file(WRITE ${LANGUAGES_QRC} "<RCC><qresource prefix=\"languages\">\n") | 256 | file(WRITE ${LANGUAGES_QRC} "<RCC><qresource prefix=\"languages\">\n") |
diff --git a/src/yuzu/configuration/configure_ui.cpp b/src/yuzu/configuration/configure_ui.cpp index 2e98ede8e..48f71b53c 100644 --- a/src/yuzu/configuration/configure_ui.cpp +++ b/src/yuzu/configuration/configure_ui.cpp | |||
| @@ -219,6 +219,7 @@ void ConfigureUi::InitializeLanguageComboBox() { | |||
| 219 | for (const auto& lang : languages) { | 219 | for (const auto& lang : languages) { |
| 220 | if (QString::fromLatin1(lang.id) == QStringLiteral("en")) { | 220 | if (QString::fromLatin1(lang.id) == QStringLiteral("en")) { |
| 221 | ui->language_combobox->addItem(lang.name, QStringLiteral("en")); | 221 | ui->language_combobox->addItem(lang.name, QStringLiteral("en")); |
| 222 | language_files.removeOne(QStringLiteral("en.qm")); | ||
| 222 | continue; | 223 | continue; |
| 223 | } | 224 | } |
| 224 | for (int i = 0; i < language_files.size(); ++i) { | 225 | for (int i = 0; i < language_files.size(); ++i) { |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index f8c234082..d03f1ef69 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -3975,11 +3975,6 @@ void GMainWindow::UpdateUITheme() { | |||
| 3975 | } | 3975 | } |
| 3976 | 3976 | ||
| 3977 | void GMainWindow::LoadTranslation() { | 3977 | void GMainWindow::LoadTranslation() { |
| 3978 | // If the selected language is English, no need to install any translation | ||
| 3979 | if (UISettings::values.language == QStringLiteral("en")) { | ||
| 3980 | return; | ||
| 3981 | } | ||
| 3982 | |||
| 3983 | bool loaded; | 3978 | bool loaded; |
| 3984 | 3979 | ||
| 3985 | if (UISettings::values.language.isEmpty()) { | 3980 | if (UISettings::values.language.isEmpty()) { |