From 01876ec4aabe204dc6283f0b28da311d1b09a3d1 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Thu, 15 Feb 2024 22:14:46 +0900 Subject: [PATCH] Qt: Fix a couple of game summary translation issues --- src/duckstation-qt/gamesummarywidget.cpp | 10 +++++++--- src/util/cd_image_hasher.cpp | 7 +++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/duckstation-qt/gamesummarywidget.cpp b/src/duckstation-qt/gamesummarywidget.cpp index 7c2ec7130..c1c0de251 100644 --- a/src/duckstation-qt/gamesummarywidget.cpp +++ b/src/duckstation-qt/gamesummarywidget.cpp @@ -255,7 +255,7 @@ void GameSummaryWidget::onComputeHashClicked() std::string found_serial; m_redump_search_keyword = CDImageHasher::HashToString(track_hashes.front()); - progress_callback.SetStatusText("Verifying hashes..."); + progress_callback.SetStatusText(TRANSLATE("GameSummaryWidget", "Verifying hashes...")); progress_callback.SetProgressValue(image->GetTrackCount()); // Verification strategy used: @@ -318,8 +318,12 @@ void GameSummaryWidget::onComputeHashClicked() if (found_serial != m_ui.serial->text().toStdString()) { - text = - tr("Serial Mismatch: %1 vs %2%3").arg(QString::fromStdString(found_serial)).arg(m_ui.serial->text()).arg(text); + const QString mismatch_str = + tr("Serial Mismatch: %1 vs %2").arg(QString::fromStdString(found_serial)).arg(m_ui.serial->text()); + if (!text.isEmpty()) + text = QStringLiteral("%1 | %2").arg(mismatch_str).arg(text); + else + text = mismatch_str; } if (!text.isEmpty()) diff --git a/src/util/cd_image_hasher.cpp b/src/util/cd_image_hasher.cpp index 3abe5edea..fdf5f9ade 100644 --- a/src/util/cd_image_hasher.cpp +++ b/src/util/cd_image_hasher.cpp @@ -1,9 +1,11 @@ -// SPDX-FileCopyrightText: 2019-2023 Connor McLaughlin +// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin // SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0) #include "cd_image_hasher.h" #include "cd_image.h" +#include "util/host.h" + #include "common/md5_digest.h" #include "common/string_util.h" @@ -21,7 +23,8 @@ bool CDImageHasher::ReadIndex(CDImage* image, u8 track, u8 index, MD5Digest* dig const u32 index_length = image->GetTrackIndexLength(track, index); const u32 update_interval = std::max(index_length / 100u, 1u); - progress_callback->SetFormattedStatusText("Computing hash for track %u/index %u...", track, index); + progress_callback->SetStatusText( + fmt::format(TRANSLATE_FS("CDImageHasher", "Computing hash for Track {}/Index {}..."), track, index).c_str()); progress_callback->SetProgressRange(index_length); if (!image->Seek(index_start))