summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-01-01 16:23:46 +0100
committerGitHub <noreply@github.com>2023-01-01 16:23:46 +0100
commit0b228fde15b82767caa08df2104b4d7850e58837 (patch)
treef2b8e60966c5e6f458429381383bf806608937ce
parentMerge pull request #9526 from ColinKinloch/choose_clang_format (diff)
parentsettings: comment language blocklist columns (diff)
downloadyuzu-0b228fde15b82767caa08df2104b4d7850e58837.tar
yuzu-0b228fde15b82767caa08df2104b4d7850e58837.tar.gz
yuzu-0b228fde15b82767caa08df2104b4d7850e58837.tar.bz2
yuzu-0b228fde15b82767caa08df2104b4d7850e58837.tar.lz
yuzu-0b228fde15b82767caa08df2104b4d7850e58837.tar.xz
yuzu-0b228fde15b82767caa08df2104b4d7850e58837.tar.zst
yuzu-0b228fde15b82767caa08df2104b4d7850e58837.zip
-rw-r--r--src/yuzu/configuration/configure_system.cpp36
-rw-r--r--src/yuzu/configuration/configure_system.ui12
2 files changed, 47 insertions, 1 deletions
diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp
index 9b14e5903..94049f2f4 100644
--- a/src/yuzu/configuration/configure_system.cpp
+++ b/src/yuzu/configuration/configure_system.cpp
@@ -14,6 +14,26 @@
#include "yuzu/configuration/configuration_shared.h"
#include "yuzu/configuration/configure_system.h"
+constexpr std::array<u32, 7> LOCALE_BLOCKLIST{
+ // pzzefezrpnkzeidfej
+ // thhsrnhutlohsternp
+ // BHH4CG U
+ // Raa1AB S
+ // nn9
+ // ts
+ 0b0100011100001100000, // Japan
+ 0b0000001101001100100, // Americas
+ 0b0100110100001000010, // Europe
+ 0b0100110100001000010, // Australia
+ 0b0000000000000000000, // China
+ 0b0100111100001000000, // Korea
+ 0b0100111100001000000, // Taiwan
+};
+
+static bool IsValidLocale(u32 region_index, u32 language_index) {
+ return ((LOCALE_BLOCKLIST.at(region_index) >> language_index) & 1) == 0;
+}
+
ConfigureSystem::ConfigureSystem(Core::System& system_, QWidget* parent)
: QWidget(parent), ui{std::make_unique<Ui::ConfigureSystem>()}, system{system_} {
ui->setupUi(this);
@@ -34,6 +54,22 @@ ConfigureSystem::ConfigureSystem(Core::System& system_, QWidget* parent)
}
});
+ const auto locale_check = [this](int index) {
+ const bool valid_locale =
+ IsValidLocale(ui->combo_region->currentIndex(), ui->combo_language->currentIndex());
+ ui->label_warn_invalid_locale->setVisible(!valid_locale);
+ if (!valid_locale) {
+ ui->label_warn_invalid_locale->setText(
+ tr("Warning: \"%1\" is not a valid language for region \"%2\"")
+ .arg(ui->combo_language->currentText())
+ .arg(ui->combo_region->currentText()));
+ }
+ };
+
+ connect(ui->combo_language, qOverload<int>(&QComboBox::currentIndexChanged), this,
+ locale_check);
+ connect(ui->combo_region, qOverload<int>(&QComboBox::currentIndexChanged), this, locale_check);
+
ui->label_console_id->setVisible(Settings::IsConfiguringGlobal());
ui->button_regenerate_console_id->setVisible(Settings::IsConfiguringGlobal());
diff --git a/src/yuzu/configuration/configure_system.ui b/src/yuzu/configuration/configure_system.ui
index 46892f5c1..0459cd924 100644
--- a/src/yuzu/configuration/configure_system.ui
+++ b/src/yuzu/configuration/configure_system.ui
@@ -326,7 +326,7 @@
</item>
<item>
<property name="text">
- <string>English</string>
+ <string>American English</string>
</property>
</item>
<item>
@@ -546,6 +546,16 @@
</spacer>
</item>
<item>
+ <widget class="QLabel" name="label_warn_invalid_locale">
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
<widget class="QLabel" name="label_disable_info">
<property name="text">
<string>System settings are available only when game is not running.</string>