From 803ac4ca59782fadd9f9f957cc7462168e6d7fd9 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 31 Dec 2020 10:21:12 -0500 Subject: [PATCH 1/2] main: Tidy up enum comparison enum classes are comparable with one another, so these casts aren't necessary. --- src/yuzu/main.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 7aa5152263..e8f979440b 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1049,8 +1049,7 @@ bool GMainWindow::LoadROM(const QString& filename, std::size_t program_index) { break; default: - if (static_cast(result) > - static_cast(Core::System::ResultStatus::ErrorLoader)) { + if (result > Core::System::ResultStatus::ErrorLoader) { const u16 loader_id = static_cast(Core::System::ResultStatus::ErrorLoader); const u16 error_id = static_cast(result) - loader_id; const std::string error_code = fmt::format("({:04X}-{:04X})", loader_id, error_id); From 8c27a74132c25e14a051777053559ad044d5a316 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 31 Dec 2020 10:28:42 -0500 Subject: [PATCH 2/2] main: Make the loader error dialog fully translatable Makes the dialog fully localizable and also adds disambiguation comments to help translators understand what the formatting specifiers indicate. --- src/yuzu/main.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index e8f979440b..2905f0224e 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1054,14 +1054,18 @@ bool GMainWindow::LoadROM(const QString& filename, std::size_t program_index) { const u16 error_id = static_cast(result) - loader_id; const std::string error_code = fmt::format("({:04X}-{:04X})", loader_id, error_id); LOG_CRITICAL(Frontend, "Failed to load ROM! {}", error_code); - QMessageBox::critical( - this, - tr("Error while loading ROM! ").append(QString::fromStdString(error_code)), - QString::fromStdString(fmt::format( - "{}
Please follow the " - "yuzu quickstart guide to redump your files.
You can refer " - "to the yuzu wiki or the yuzu Discord for help.", - static_cast(error_id)))); + + const auto title = + tr("Error while loading ROM! %1", "%1 signifies a numeric error code.") + .arg(QString::fromStdString(error_code)); + const auto description = + tr("%1
Please follow the " + "yuzu quickstart guide to redump your files.
You can refer " + "to the yuzu wiki or the yuzu Discord for help.", + "%1 signifies a numeric error ID.") + .arg(error_id); + + QMessageBox::critical(this, title, description); } else { QMessageBox::critical( this, tr("Error while loading ROM!"),