From 83b280d9032289d7e385d35a263ccbbe0ed29a98 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 20 Apr 2024 16:26:53 +0200 Subject: [PATCH] i18n: Add comments and improve source strings --- .../Config/Graphics/EnhancementsWidget.cpp | 8 +++---- .../DolphinQt/Debugger/AssemblerWidget.cpp | 4 +--- .../DolphinQt/Debugger/BranchWatchDialog.cpp | 2 ++ .../Core/DolphinQt/Debugger/MemoryWidget.cpp | 1 + .../InfinityBase/InfinityBaseWindow.cpp | 13 +++++++----- .../SkylanderPortal/SkylanderModifyDialog.cpp | 13 +++++++++--- .../SkylanderPortal/SkylanderPortalWindow.cpp | 21 +++++++++++-------- 7 files changed, 38 insertions(+), 24 deletions(-) diff --git a/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp index cefe86fdfb..2b21fcfe13 100644 --- a/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp @@ -527,20 +527,20 @@ void EnhancementsWidget::AddDescriptions() "

Bicubic - [16 samples]" "
Gamma corrected cubic interpolation between pixels." - "
Good when rescaling between close resolutions. i.e 1080p and 1440p." + "
Good when rescaling between close resolutions, e.g. 1080p and 1440p." "
Comes in various flavors:" "
B-Spline: Blurry, but avoids all lobing artifacts" "
Mitchell-Netravali: Good middle ground between blurry and lobing" "
Catmull-Rom: Sharper, but can cause lobing artifacts" "

Sharp Bilinear - [1-4 samples]" - "
Similarly to \"Nearest Neighbor\", it maintains a sharp look," + "
Similar to \"Nearest Neighbor\", it maintains a sharp look," "
but also does some blending to avoid shimmering." "
Works best with 2D games at low resolutions." "

Area Sampling - [up to 324 samples]" - "
Weights pixels by the percentage of area they occupy. Gamma corrected." - "
Best for down scaling by more than 2x." + "
Weighs pixels by the percentage of area they occupy. Gamma corrected." + "
Best for downscaling by more than 2x." "

If unsure, select 'Default'."); static const char TR_COLOR_CORRECTION_DESCRIPTION[] = diff --git a/Source/Core/DolphinQt/Debugger/AssemblerWidget.cpp b/Source/Core/DolphinQt/Debugger/AssemblerWidget.cpp index f8cb60deb6..8dba286c01 100644 --- a/Source/Core/DolphinQt/Debugger/AssemblerWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/AssemblerWidget.cpp @@ -729,9 +729,7 @@ void AssemblerWidget::NewEditor(const QString& path) if (!path.isEmpty() && !new_editor->LoadFromPath()) { ModalMessageBox::warning(this, tr("Failed to open file"), - tr("Failed to read the contents of file\n\n" - "\"%1\"") - .arg(path)); + tr("Failed to read the contents of file:\n%1").arg(path)); delete new_editor; return; } diff --git a/Source/Core/DolphinQt/Debugger/BranchWatchDialog.cpp b/Source/Core/DolphinQt/Debugger/BranchWatchDialog.cpp index 9574a985b7..a9081c244f 100644 --- a/Source/Core/DolphinQt/Debugger/BranchWatchDialog.cpp +++ b/Source/Core/DolphinQt/Debugger/BranchWatchDialog.cpp @@ -757,6 +757,8 @@ void BranchWatchDialog::OnToggleAutoSave(bool checked) return; const QString filepath = DolphinFileDialog::getSaveFileName( + // i18n: If the user selects a file, Branch Watch will save to that file. + // If the user presses Cancel, Branch Watch will save to a file in the user folder. this, tr("Select Branch Watch snapshot auto-save file (for user folder location, cancel)"), QString::fromStdString(File::GetUserPath(D_DUMPDEBUG_BRANCHWATCH_IDX)), tr("Text file (*.txt);;All Files (*)")); diff --git a/Source/Core/DolphinQt/Debugger/MemoryWidget.cpp b/Source/Core/DolphinQt/Debugger/MemoryWidget.cpp index 9b2fba6d29..4a89ce4316 100644 --- a/Source/Core/DolphinQt/Debugger/MemoryWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/MemoryWidget.cpp @@ -200,6 +200,7 @@ void MemoryWidget::CreateWidgets() m_display_combo->addItem(tr("Double"), int(Type::Double)); m_align_combo = new QComboBox; + // i18n: "Fixed" here means that the alignment is always the same m_align_combo->addItem(tr("Fixed Alignment")); m_align_combo->addItem(tr("Type-based Alignment"), 0); m_align_combo->addItem(tr("No Alignment"), 1); diff --git a/Source/Core/DolphinQt/InfinityBase/InfinityBaseWindow.cpp b/Source/Core/DolphinQt/InfinityBase/InfinityBaseWindow.cpp index a22c540e2e..e4c428684f 100644 --- a/Source/Core/DolphinQt/InfinityBase/InfinityBaseWindow.cpp +++ b/Source/Core/DolphinQt/InfinityBase/InfinityBaseWindow.cpp @@ -35,6 +35,7 @@ static QString s_last_figure_path; InfinityBaseWindow::InfinityBaseWindow(QWidget* parent) : QWidget(parent) { + // i18n: Window for managing Disney Infinity figures setWindowTitle(tr("Infinity Manager")); setObjectName(QStringLiteral("infinity_manager")); setMinimumSize(QSize(700, 200)); @@ -164,7 +165,7 @@ void InfinityBaseWindow::LoadFigurePath(u8 slot, const QString& path) { QMessageBox::warning( this, tr("Failed to open the Infinity file!"), - tr("Failed to open the Infinity file(%1)!\nFile may already be in use on the base.") + tr("Failed to open the Infinity file:\n%1\n\nThe file may already be in use on the base.") .arg(path), QMessageBox::Ok); return; @@ -172,9 +173,10 @@ void InfinityBaseWindow::LoadFigurePath(u8 slot, const QString& path) std::array file_data; if (!inf_file.ReadBytes(file_data.data(), file_data.size())) { - QMessageBox::warning(this, tr("Failed to read the Infinity file!"), - tr("Failed to read the Infinity file(%1)!\nFile was too small.").arg(path), - QMessageBox::Ok); + QMessageBox::warning( + this, tr("Failed to read the Infinity file!"), + tr("Failed to read the Infinity file(%1):\n%1\n\nThe file was too small.").arg(path), + QMessageBox::Ok); return; } @@ -274,6 +276,7 @@ CreateFigureDialog::CreateFigureDialog(QWidget* parent, u8 slot) : QDialog(paren } else { + // i18n: This is used to create a file name. The string must end in ".bin". QString str = tr("Unknown(%1).bin"); predef_name += str.arg(char_number); } @@ -289,7 +292,7 @@ CreateFigureDialog::CreateFigureDialog(QWidget* parent, u8 slot) : QDialog(paren { QMessageBox::warning( this, tr("Failed to create Infinity file"), - tr("Blank figure creation failed at:\n%1, try again with a different character") + tr("Blank figure creation failed at:\n%1\n\nTry again with a different character.") .arg(m_file_path), QMessageBox::Ok); return; diff --git a/Source/Core/DolphinQt/SkylanderPortal/SkylanderModifyDialog.cpp b/Source/Core/DolphinQt/SkylanderPortal/SkylanderModifyDialog.cpp index 983c4a3150..387ee69386 100644 --- a/Source/Core/DolphinQt/SkylanderPortal/SkylanderModifyDialog.cpp +++ b/Source/Core/DolphinQt/SkylanderPortal/SkylanderModifyDialog.cpp @@ -53,10 +53,12 @@ SkylanderModifyDialog::SkylanderModifyDialog(QWidget* parent, u8 slot) { // Should never be able to happen. Still good to have name = + // i18n: "Var" is short for "variant" tr("Unknown (Id:%1 Var:%2)").arg(m_figure_data.figure_id).arg(m_figure_data.variant_id); } } + // i18n: %1 is a name auto* label_name = new QLabel(tr("Modifying Skylander: %1").arg(name)); hbox_name->addWidget(label_name); @@ -136,11 +138,13 @@ void SkylanderModifyDialog::PopulateSkylanderOptions(QVBoxLayout* layout) reinterpret_cast(m_figure_data.skylander_data.nickname.data()))); auto* hbox_playtime = new QHBoxLayout(); + // i18n: The total amount of time the Skylander has been used for auto* label_playtime = new QLabel(tr("Playtime:")); auto* edit_playtime = new QLineEdit(QStringLiteral("%1").arg(m_figure_data.skylander_data.playtime)); auto* hbox_last_reset = new QHBoxLayout(); + // i18n: A timestamp for when the Skylander was most recently reset auto* label_last_reset = new QLabel(tr("Last reset:")); auto* edit_last_reset = new QDateTimeEdit(QDateTime(QDate(m_figure_data.skylander_data.last_reset.year, @@ -150,6 +154,7 @@ void SkylanderModifyDialog::PopulateSkylanderOptions(QVBoxLayout* layout) m_figure_data.skylander_data.last_reset.minute))); auto* hbox_last_placed = new QHBoxLayout(); + // i18n: A timestamp for when the Skylander was most recently used auto* label_last_placed = new QLabel(tr("Last placed:")); auto* edit_last_placed = new QDateTimeEdit(QDateTime(QDate(m_figure_data.skylander_data.last_placed.year, @@ -167,10 +172,10 @@ void SkylanderModifyDialog::PopulateSkylanderOptions(QVBoxLayout* layout) edit_last_placed->setDisplayFormat(QStringLiteral("dd/MM/yyyy hh:mm")); edit_toy_code->setToolTip(tr("The toy code for this figure. Only available for real figures.")); - edit_money->setToolTip(tr("The amount of money this skylander should have. Between 0 and 65000")); - edit_hero->setToolTip(tr("The hero level of this skylander. Only seen in Skylanders: Spyro's " + edit_money->setToolTip(tr("The amount of money this Skylander has. Between 0 and 65000")); + edit_hero->setToolTip(tr("The hero level of this Skylander. Only seen in Skylanders: Spyro's " "Adventures. Between 0 and 100")); - edit_nick->setToolTip(tr("The nickname for this skylander. Limited to 15 characters")); + edit_nick->setToolTip(tr("The nickname for this Skylander. Limited to 15 characters")); edit_playtime->setToolTip( tr("The total time this figure has been used inside a game in seconds")); edit_last_reset->setToolTip(tr("The last time the figure has been reset. If the figure has never " @@ -309,6 +314,8 @@ bool SkylanderModifyDialog::PopulateTrophyOptions(QVBoxLayout* layout) edit_villains[i] = new QCheckBox(); edit_villains[i]->setChecked(static_cast(m_figure_data.trophy_data.unlocked_villains & (0b1 << shift_distances[i]))); + // i18n: "Captured" is a participle here. This string is used when listing villains, not when a + // villain was just captured auto* const label = new QLabel(tr("Captured villain %1:").arg(i + 1)); auto* const hbox = new QHBoxLayout(); hbox->addWidget(label); diff --git a/Source/Core/DolphinQt/SkylanderPortal/SkylanderPortalWindow.cpp b/Source/Core/DolphinQt/SkylanderPortal/SkylanderPortalWindow.cpp index f1bd605c48..9af7ef8b42 100644 --- a/Source/Core/DolphinQt/SkylanderPortal/SkylanderPortalWindow.cpp +++ b/Source/Core/DolphinQt/SkylanderPortal/SkylanderPortalWindow.cpp @@ -546,6 +546,7 @@ void SkylanderPortalWindow::LoadSelected() } else { + // i18n: This is used to create a file name. The string must end in ".sky". const QString str = tr("Unknown(%1 %2).sky"); predef_name += str.arg(m_sky_id, m_sky_var); } @@ -629,6 +630,7 @@ void SkylanderPortalWindow::CreateSkylanderAdvanced() } else { + // i18n: This is used to create a file name. The string must end in ".sky". QString str = tr("Unknown(%1 %2).sky"); predef_name += str.arg(m_sky_id, m_sky_var); } @@ -673,7 +675,7 @@ void SkylanderPortalWindow::ClearSlot(u8 slot) if (!system.GetSkylanderPortal().RemoveSkylander(slot_infos->portal_slot)) { QMessageBox::warning(this, tr("Failed to clear Skylander!"), - tr("Failed to clear the Skylander from slot(%1)!").arg(slot), + tr("Failed to clear the Skylander from slot %1!").arg(slot), QMessageBox::Ok); return; } @@ -795,7 +797,7 @@ void SkylanderPortalWindow::CreateSkyfile(const QString& path, bool load_after) { QMessageBox::warning( this, tr("Failed to create Skylander file!"), - tr("Failed to create Skylander file:\n%1\n(Skylander may already be on the portal)") + tr("Failed to create Skylander file:\n%1\n\nThe Skylander may already be on the portal.") .arg(path), QMessageBox::Ok); return; @@ -813,11 +815,11 @@ void SkylanderPortalWindow::LoadSkyfilePath(u8 slot, const QString& path) File::IOFile sky_file(path.toStdString(), "r+b"); if (!sky_file) { - QMessageBox::warning( - this, tr("Failed to open the Skylander file!"), - tr("Failed to open the Skylander file(%1)!\nFile may already be in use on the portal.") - .arg(path), - QMessageBox::Ok); + QMessageBox::warning(this, tr("Failed to open the Skylander file!"), + tr("Failed to open the Skylander file:\n%1\n\nThe file may already be in " + "use on the portal.") + .arg(path), + QMessageBox::Ok); return; } std::array file_data; @@ -825,7 +827,7 @@ void SkylanderPortalWindow::LoadSkyfilePath(u8 slot, const QString& path) { QMessageBox::warning( this, tr("Failed to read the Skylander file!"), - tr("Failed to read the Skylander file(%1)!\nFile was too small.").arg(path), + tr("Failed to read the Skylander file:\n%1\n\nThe file was too small.").arg(path), QMessageBox::Ok); return; } @@ -839,7 +841,7 @@ void SkylanderPortalWindow::LoadSkyfilePath(u8 slot, const QString& path) if (portal_slot == 0xFF) { QMessageBox::warning(this, tr("Failed to load the Skylander file!"), - tr("Failed to load the Skylander file(%1)!\n").arg(path), QMessageBox::Ok); + tr("Failed to load the Skylander file:\n%1").arg(path), QMessageBox::Ok); return; } m_sky_slots[slot] = {portal_slot, id_var.first, id_var.second}; @@ -862,6 +864,7 @@ void SkylanderPortalWindow::UpdateSlotNames() } else { + // i18n: "Var" is short for "variant" display_string = tr("Unknown (Id:%1 Var:%2)").arg(sd->m_sky_id).arg(sd->m_sky_var); } }