Merge pull request #12726 from JosJuice/i18n-2024-04-20

i18n: Add comments and improve source strings
This commit is contained in:
Admiral H. Curtiss 2024-04-20 23:34:32 +02:00 committed by GitHub
commit d3cf35019c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 38 additions and 24 deletions

View File

@ -527,20 +527,20 @@ void EnhancementsWidget::AddDescriptions()
"<br><br><b>Bicubic</b> - [16 samples]" "<br><br><b>Bicubic</b> - [16 samples]"
"<br>Gamma corrected cubic interpolation between pixels." "<br>Gamma corrected cubic interpolation between pixels."
"<br>Good when rescaling between close resolutions. i.e 1080p and 1440p." "<br>Good when rescaling between close resolutions, e.g. 1080p and 1440p."
"<br>Comes in various flavors:" "<br>Comes in various flavors:"
"<br><b>B-Spline</b>: Blurry, but avoids all lobing artifacts" "<br><b>B-Spline</b>: Blurry, but avoids all lobing artifacts"
"<br><b>Mitchell-Netravali</b>: Good middle ground between blurry and lobing" "<br><b>Mitchell-Netravali</b>: Good middle ground between blurry and lobing"
"<br><b>Catmull-Rom</b>: Sharper, but can cause lobing artifacts" "<br><b>Catmull-Rom</b>: Sharper, but can cause lobing artifacts"
"<br><br><b>Sharp Bilinear</b> - [1-4 samples]" "<br><br><b>Sharp Bilinear</b> - [1-4 samples]"
"<br>Similarly to \"Nearest Neighbor\", it maintains a sharp look," "<br>Similar to \"Nearest Neighbor\", it maintains a sharp look,"
"<br>but also does some blending to avoid shimmering." "<br>but also does some blending to avoid shimmering."
"<br>Works best with 2D games at low resolutions." "<br>Works best with 2D games at low resolutions."
"<br><br><b>Area Sampling</b> - [up to 324 samples]" "<br><br><b>Area Sampling</b> - [up to 324 samples]"
"<br>Weights pixels by the percentage of area they occupy. Gamma corrected." "<br>Weighs pixels by the percentage of area they occupy. Gamma corrected."
"<br>Best for down scaling by more than 2x." "<br>Best for downscaling by more than 2x."
"<br><br><dolphin_emphasis>If unsure, select 'Default'.</dolphin_emphasis>"); "<br><br><dolphin_emphasis>If unsure, select 'Default'.</dolphin_emphasis>");
static const char TR_COLOR_CORRECTION_DESCRIPTION[] = static const char TR_COLOR_CORRECTION_DESCRIPTION[] =

View File

@ -729,9 +729,7 @@ void AssemblerWidget::NewEditor(const QString& path)
if (!path.isEmpty() && !new_editor->LoadFromPath()) if (!path.isEmpty() && !new_editor->LoadFromPath())
{ {
ModalMessageBox::warning(this, tr("Failed to open file"), ModalMessageBox::warning(this, tr("Failed to open file"),
tr("Failed to read the contents of file\n\n" tr("Failed to read the contents of file:\n%1").arg(path));
"\"%1\"")
.arg(path));
delete new_editor; delete new_editor;
return; return;
} }

View File

@ -757,6 +757,8 @@ void BranchWatchDialog::OnToggleAutoSave(bool checked)
return; return;
const QString filepath = DolphinFileDialog::getSaveFileName( 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)"), this, tr("Select Branch Watch snapshot auto-save file (for user folder location, cancel)"),
QString::fromStdString(File::GetUserPath(D_DUMPDEBUG_BRANCHWATCH_IDX)), QString::fromStdString(File::GetUserPath(D_DUMPDEBUG_BRANCHWATCH_IDX)),
tr("Text file (*.txt);;All Files (*)")); tr("Text file (*.txt);;All Files (*)"));

View File

@ -200,6 +200,7 @@ void MemoryWidget::CreateWidgets()
m_display_combo->addItem(tr("Double"), int(Type::Double)); m_display_combo->addItem(tr("Double"), int(Type::Double));
m_align_combo = new QComboBox; 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("Fixed Alignment"));
m_align_combo->addItem(tr("Type-based Alignment"), 0); m_align_combo->addItem(tr("Type-based Alignment"), 0);
m_align_combo->addItem(tr("No Alignment"), 1); m_align_combo->addItem(tr("No Alignment"), 1);

View File

@ -35,6 +35,7 @@ static QString s_last_figure_path;
InfinityBaseWindow::InfinityBaseWindow(QWidget* parent) : QWidget(parent) InfinityBaseWindow::InfinityBaseWindow(QWidget* parent) : QWidget(parent)
{ {
// i18n: Window for managing Disney Infinity figures
setWindowTitle(tr("Infinity Manager")); setWindowTitle(tr("Infinity Manager"));
setObjectName(QStringLiteral("infinity_manager")); setObjectName(QStringLiteral("infinity_manager"));
setMinimumSize(QSize(700, 200)); setMinimumSize(QSize(700, 200));
@ -164,7 +165,7 @@ void InfinityBaseWindow::LoadFigurePath(u8 slot, const QString& path)
{ {
QMessageBox::warning( QMessageBox::warning(
this, tr("Failed to open the Infinity file!"), 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), .arg(path),
QMessageBox::Ok); QMessageBox::Ok);
return; return;
@ -172,9 +173,10 @@ void InfinityBaseWindow::LoadFigurePath(u8 slot, const QString& path)
std::array<u8, IOS::HLE::USB::INFINITY_NUM_BLOCKS * IOS::HLE::USB::INFINITY_BLOCK_SIZE> file_data; std::array<u8, IOS::HLE::USB::INFINITY_NUM_BLOCKS * IOS::HLE::USB::INFINITY_BLOCK_SIZE> file_data;
if (!inf_file.ReadBytes(file_data.data(), file_data.size())) if (!inf_file.ReadBytes(file_data.data(), file_data.size()))
{ {
QMessageBox::warning(this, tr("Failed to read the Infinity file!"), QMessageBox::warning(
tr("Failed to read the Infinity file(%1)!\nFile was too small.").arg(path), this, tr("Failed to read the Infinity file!"),
QMessageBox::Ok); tr("Failed to read the Infinity file(%1):\n%1\n\nThe file was too small.").arg(path),
QMessageBox::Ok);
return; return;
} }
@ -274,6 +276,7 @@ CreateFigureDialog::CreateFigureDialog(QWidget* parent, u8 slot) : QDialog(paren
} }
else else
{ {
// i18n: This is used to create a file name. The string must end in ".bin".
QString str = tr("Unknown(%1).bin"); QString str = tr("Unknown(%1).bin");
predef_name += str.arg(char_number); predef_name += str.arg(char_number);
} }
@ -289,7 +292,7 @@ CreateFigureDialog::CreateFigureDialog(QWidget* parent, u8 slot) : QDialog(paren
{ {
QMessageBox::warning( QMessageBox::warning(
this, tr("Failed to create Infinity file"), 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), .arg(m_file_path),
QMessageBox::Ok); QMessageBox::Ok);
return; return;

View File

@ -53,10 +53,12 @@ SkylanderModifyDialog::SkylanderModifyDialog(QWidget* parent, u8 slot)
{ {
// Should never be able to happen. Still good to have // Should never be able to happen. Still good to have
name = 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); 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)); auto* label_name = new QLabel(tr("Modifying Skylander: %1").arg(name));
hbox_name->addWidget(label_name); hbox_name->addWidget(label_name);
@ -136,11 +138,13 @@ void SkylanderModifyDialog::PopulateSkylanderOptions(QVBoxLayout* layout)
reinterpret_cast<char16_t*>(m_figure_data.skylander_data.nickname.data()))); reinterpret_cast<char16_t*>(m_figure_data.skylander_data.nickname.data())));
auto* hbox_playtime = new QHBoxLayout(); 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* label_playtime = new QLabel(tr("Playtime:"));
auto* edit_playtime = auto* edit_playtime =
new QLineEdit(QStringLiteral("%1").arg(m_figure_data.skylander_data.playtime)); new QLineEdit(QStringLiteral("%1").arg(m_figure_data.skylander_data.playtime));
auto* hbox_last_reset = new QHBoxLayout(); 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* label_last_reset = new QLabel(tr("Last reset:"));
auto* edit_last_reset = auto* edit_last_reset =
new QDateTimeEdit(QDateTime(QDate(m_figure_data.skylander_data.last_reset.year, 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))); m_figure_data.skylander_data.last_reset.minute)));
auto* hbox_last_placed = new QHBoxLayout(); 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* label_last_placed = new QLabel(tr("Last placed:"));
auto* edit_last_placed = auto* edit_last_placed =
new QDateTimeEdit(QDateTime(QDate(m_figure_data.skylander_data.last_placed.year, 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_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_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_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 " edit_hero->setToolTip(tr("The hero level of this Skylander. Only seen in Skylanders: Spyro's "
"Adventures. Between 0 and 100")); "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( edit_playtime->setToolTip(
tr("The total time this figure has been used inside a game in seconds")); 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 " 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] = new QCheckBox();
edit_villains[i]->setChecked(static_cast<bool>(m_figure_data.trophy_data.unlocked_villains & edit_villains[i]->setChecked(static_cast<bool>(m_figure_data.trophy_data.unlocked_villains &
(0b1 << shift_distances[i]))); (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 label = new QLabel(tr("Captured villain %1:").arg(i + 1));
auto* const hbox = new QHBoxLayout(); auto* const hbox = new QHBoxLayout();
hbox->addWidget(label); hbox->addWidget(label);

View File

@ -546,6 +546,7 @@ void SkylanderPortalWindow::LoadSelected()
} }
else else
{ {
// i18n: This is used to create a file name. The string must end in ".sky".
const QString str = tr("Unknown(%1 %2).sky"); const QString str = tr("Unknown(%1 %2).sky");
predef_name += str.arg(m_sky_id, m_sky_var); predef_name += str.arg(m_sky_id, m_sky_var);
} }
@ -629,6 +630,7 @@ void SkylanderPortalWindow::CreateSkylanderAdvanced()
} }
else else
{ {
// i18n: This is used to create a file name. The string must end in ".sky".
QString str = tr("Unknown(%1 %2).sky"); QString str = tr("Unknown(%1 %2).sky");
predef_name += str.arg(m_sky_id, m_sky_var); 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)) if (!system.GetSkylanderPortal().RemoveSkylander(slot_infos->portal_slot))
{ {
QMessageBox::warning(this, tr("Failed to clear Skylander!"), 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); QMessageBox::Ok);
return; return;
} }
@ -795,7 +797,7 @@ void SkylanderPortalWindow::CreateSkyfile(const QString& path, bool load_after)
{ {
QMessageBox::warning( QMessageBox::warning(
this, tr("Failed to create Skylander file!"), 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), .arg(path),
QMessageBox::Ok); QMessageBox::Ok);
return; return;
@ -813,11 +815,11 @@ void SkylanderPortalWindow::LoadSkyfilePath(u8 slot, const QString& path)
File::IOFile sky_file(path.toStdString(), "r+b"); File::IOFile sky_file(path.toStdString(), "r+b");
if (!sky_file) if (!sky_file)
{ {
QMessageBox::warning( QMessageBox::warning(this, tr("Failed to open the Skylander file!"),
this, tr("Failed to open the Skylander file!"), tr("Failed to open the Skylander file:\n%1\n\nThe file may already be in "
tr("Failed to open the Skylander file(%1)!\nFile may already be in use on the portal.") "use on the portal.")
.arg(path), .arg(path),
QMessageBox::Ok); QMessageBox::Ok);
return; return;
} }
std::array<u8, 0x40 * 0x10> file_data; std::array<u8, 0x40 * 0x10> file_data;
@ -825,7 +827,7 @@ void SkylanderPortalWindow::LoadSkyfilePath(u8 slot, const QString& path)
{ {
QMessageBox::warning( QMessageBox::warning(
this, tr("Failed to read the Skylander file!"), 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); QMessageBox::Ok);
return; return;
} }
@ -839,7 +841,7 @@ void SkylanderPortalWindow::LoadSkyfilePath(u8 slot, const QString& path)
if (portal_slot == 0xFF) if (portal_slot == 0xFF)
{ {
QMessageBox::warning(this, tr("Failed to load the Skylander file!"), 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; return;
} }
m_sky_slots[slot] = {portal_slot, id_var.first, id_var.second}; m_sky_slots[slot] = {portal_slot, id_var.first, id_var.second};
@ -862,6 +864,7 @@ void SkylanderPortalWindow::UpdateSlotNames()
} }
else 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); display_string = tr("Unknown (Id:%1 Var:%2)").arg(sd->m_sky_id).arg(sd->m_sky_var);
} }
} }