mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-27 09:12:46 +01:00
yuzu/main: Make error messages within OnCoreError more localization-friendly
Previously, a translated string was being appended onto another string in a manner that doesn't allow the translator to control where the appended text is placed. This can be a nuisance for languages where grammar and text ordering differs from English. We now append the strings via the format strings themselves, which allows translators to reorder where the text will be placed.
This commit is contained in:
parent
9e689a81f8
commit
5085a16d78
1 changed files with 8 additions and 7 deletions
|
@ -1843,13 +1843,14 @@ void GMainWindow::OnCoreError(Core::System::ResultStatus result, std::string det
|
||||||
"data, or other bugs.");
|
"data, or other bugs.");
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case Core::System::ResultStatus::ErrorSystemFiles: {
|
case Core::System::ResultStatus::ErrorSystemFiles: {
|
||||||
QString message = tr("yuzu was unable to locate a Switch system archive");
|
QString message;
|
||||||
if (!details.empty()) {
|
if (details.empty()) {
|
||||||
message.append(tr(": %1. ").arg(QString::fromStdString(details)));
|
message =
|
||||||
|
tr("yuzu was unable to locate a Switch system archive. %1").arg(common_message);
|
||||||
} else {
|
} else {
|
||||||
message.append(tr(". "));
|
message = tr("yuzu was unable to locate a Switch system archive: %1. %2")
|
||||||
|
.arg(QString::fromStdString(details), common_message);
|
||||||
}
|
}
|
||||||
message.append(common_message);
|
|
||||||
|
|
||||||
answer = QMessageBox::question(this, tr("System Archive Not Found"), message,
|
answer = QMessageBox::question(this, tr("System Archive Not Found"), message,
|
||||||
QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
|
QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
|
||||||
|
@ -1858,8 +1859,8 @@ void GMainWindow::OnCoreError(Core::System::ResultStatus result, std::string det
|
||||||
}
|
}
|
||||||
|
|
||||||
case Core::System::ResultStatus::ErrorSharedFont: {
|
case Core::System::ResultStatus::ErrorSharedFont: {
|
||||||
QString message = tr("yuzu was unable to locate the Switch shared fonts. ");
|
const QString message =
|
||||||
message.append(common_message);
|
tr("yuzu was unable to locate the Switch shared fonts. %1").arg(common_message);
|
||||||
answer = QMessageBox::question(this, tr("Shared Fonts Not Found"), message,
|
answer = QMessageBox::question(this, tr("Shared Fonts Not Found"), message,
|
||||||
QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
|
QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
|
||||||
status_message = tr("Shared Font Missing");
|
status_message = tr("Shared Font Missing");
|
||||||
|
|
Loading…
Reference in a new issue