summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Lioncash2019-07-07 10:50:06 -0400
committerGravatar Lioncash2019-07-07 11:02:05 -0400
commit5085a16d7855ffe34ffafba3d86ffa8bc8de7a03 (patch)
treedaaf5873c3ec63c321ba03bf40ae39d23fe8f66b
parentMerge pull request #2674 from lioncash/reporter (diff)
downloadyuzu-5085a16d7855ffe34ffafba3d86ffa8bc8de7a03.tar.gz
yuzu-5085a16d7855ffe34ffafba3d86ffa8bc8de7a03.tar.xz
yuzu-5085a16d7855ffe34ffafba3d86ffa8bc8de7a03.zip
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.
-rw-r--r--src/yuzu/main.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index ae21f4753..381644694 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -1843,13 +1843,14 @@ void GMainWindow::OnCoreError(Core::System::ResultStatus result, std::string det
1843 "data, or other bugs."); 1843 "data, or other bugs.");
1844 switch (result) { 1844 switch (result) {
1845 case Core::System::ResultStatus::ErrorSystemFiles: { 1845 case Core::System::ResultStatus::ErrorSystemFiles: {
1846 QString message = tr("yuzu was unable to locate a Switch system archive"); 1846 QString message;
1847 if (!details.empty()) { 1847 if (details.empty()) {
1848 message.append(tr(": %1. ").arg(QString::fromStdString(details))); 1848 message =
1849 tr("yuzu was unable to locate a Switch system archive. %1").arg(common_message);
1849 } else { 1850 } else {
1850 message.append(tr(". ")); 1851 message = tr("yuzu was unable to locate a Switch system archive: %1. %2")
1852 .arg(QString::fromStdString(details), common_message);
1851 } 1853 }
1852 message.append(common_message);
1853 1854
1854 answer = QMessageBox::question(this, tr("System Archive Not Found"), message, 1855 answer = QMessageBox::question(this, tr("System Archive Not Found"), message,
1855 QMessageBox::Yes | QMessageBox::No, QMessageBox::No); 1856 QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
@@ -1858,8 +1859,8 @@ void GMainWindow::OnCoreError(Core::System::ResultStatus result, std::string det
1858 } 1859 }
1859 1860
1860 case Core::System::ResultStatus::ErrorSharedFont: { 1861 case Core::System::ResultStatus::ErrorSharedFont: {
1861 QString message = tr("yuzu was unable to locate the Switch shared fonts. "); 1862 const QString message =
1862 message.append(common_message); 1863 tr("yuzu was unable to locate the Switch shared fonts. %1").arg(common_message);
1863 answer = QMessageBox::question(this, tr("Shared Fonts Not Found"), message, 1864 answer = QMessageBox::question(this, tr("Shared Fonts Not Found"), message,
1864 QMessageBox::Yes | QMessageBox::No, QMessageBox::No); 1865 QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
1865 status_message = tr("Shared Font Missing"); 1866 status_message = tr("Shared Font Missing");