2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

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.
This commit is contained in:
Lioncash 2020-12-31 10:28:42 -05:00
parent 803ac4ca59
commit 8c27a74132

View file

@ -1054,14 +1054,18 @@ bool GMainWindow::LoadROM(const QString& filename, std::size_t program_index) {
const u16 error_id = static_cast<u16>(result) - loader_id; const u16 error_id = static_cast<u16>(result) - loader_id;
const std::string error_code = fmt::format("({:04X}-{:04X})", loader_id, error_id); const std::string error_code = fmt::format("({:04X}-{:04X})", loader_id, error_id);
LOG_CRITICAL(Frontend, "Failed to load ROM! {}", error_code); LOG_CRITICAL(Frontend, "Failed to load ROM! {}", error_code);
QMessageBox::critical(
this, const auto title =
tr("Error while loading ROM! ").append(QString::fromStdString(error_code)), tr("Error while loading ROM! %1", "%1 signifies a numeric error code.")
QString::fromStdString(fmt::format( .arg(QString::fromStdString(error_code));
"{}<br>Please follow <a href='https://yuzu-emu.org/help/quickstart/'>the " const auto description =
"yuzu quickstart guide</a> to redump your files.<br>You can refer " tr("%1<br>Please follow <a href='https://yuzu-emu.org/help/quickstart/'>the "
"to the yuzu wiki</a> or the yuzu Discord</a> for help.", "yuzu quickstart guide</a> to redump your files.<br>You can refer "
static_cast<Loader::ResultStatus>(error_id)))); "to the yuzu wiki</a> or the yuzu Discord</a> for help.",
"%1 signifies a numeric error ID.")
.arg(error_id);
QMessageBox::critical(this, title, description);
} else { } else {
QMessageBox::critical( QMessageBox::critical(
this, tr("Error while loading ROM!"), this, tr("Error while loading ROM!"),