From 296dcccd81454b7de023c6d7e27cb14f53145715 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Wed, 19 Jul 2023 23:48:54 +1000 Subject: [PATCH] Misc: Fix a bunch of issues preventing C++20 compilation --- common/Error.cpp | 4 ++-- .../Translations/update_en_translation.bat | 2 +- pcsx2-qt/Translations/update_en_translation.sh | 2 +- pcsx2/Achievements.cpp | 8 ++++---- pcsx2/CDVD/CDVDcommon.cpp | 2 +- pcsx2/CDVD/OutputIsoFile.cpp | 2 +- pcsx2/DEV9/flash.cpp | 2 +- pcsx2/GS/GS.cpp | 8 ++++---- pcsx2/GS/Renderers/Common/GSRenderer.cpp | 10 +++++----- pcsx2/GS/Renderers/HW/GSRendererHW.cpp | 2 +- pcsx2/GameDatabase.cpp | 2 +- pcsx2/Host.h | 1 + pcsx2/Hotkeys.cpp | 10 +++++----- pcsx2/MemoryCardFile.cpp | 2 +- pcsx2/MemoryCardFolder.cpp | 2 +- pcsx2/Patch.cpp | 12 ++++++------ pcsx2/SPU2/SndOut_Cubeb.cpp | 2 +- pcsx2/USB/usb-mic/usb-mic-singstar.cpp | 2 +- pcsx2/USB/usb-msd/usb-msd.cpp | 2 +- pcsx2/USB/usb-printer/usb-printer.cpp | 4 ++-- pcsx2/VMManager.cpp | 18 +++++++++--------- 21 files changed, 50 insertions(+), 49 deletions(-) diff --git a/common/Error.cpp b/common/Error.cpp index 4747e233bc..2a88102a20 100644 --- a/common/Error.cpp +++ b/common/Error.cpp @@ -88,7 +88,7 @@ void Error::SetWin32(unsigned long err) if (r > 0) m_description = fmt::format("Win32 Error {}: {}", err, std::string_view(buf, r)); else - m_description = fmt::format("Win32 Error {}: "); + m_description = fmt::format("Win32 Error {}: ", err); } void Error::SetWin32(Error* errptr, unsigned long err) @@ -106,7 +106,7 @@ void Error::SetHResult(long err) if (r > 0) m_description = fmt::format("HRESULT {:08X}: {}", err, std::string_view(buf, r)); else - m_description = fmt::format("HRESULT {:08X}: "); + m_description = fmt::format("HRESULT {:08X}: ", err); } void Error::SetHResult(Error* errptr, long err) diff --git a/pcsx2-qt/Translations/update_en_translation.bat b/pcsx2-qt/Translations/update_en_translation.bat index 1ac4a76fb5..f5908feb5d 100644 --- a/pcsx2-qt/Translations/update_en_translation.bat +++ b/pcsx2-qt/Translations/update_en_translation.bat @@ -3,7 +3,7 @@ set QTBIN=..\..\3rdparty\qt\6.5.0\msvc2022_64\bin set SRCDIRS=../ ../../pcsx2/ -set OPTS=-tr-function-alias QT_TRANSLATE_NOOP+=TRANSLATE,QT_TRANSLATE_NOOP+=TRANSLATE_SV,QT_TRANSLATE_NOOP+=TRANSLATE_STR,QT_TRANSLATE_N_NOOP3+=TRANSLATE_FMT,QT_TRANSLATE_NOOP+=TRANSLATE_NOOP +set OPTS=-tr-function-alias QT_TRANSLATE_NOOP+=TRANSLATE,QT_TRANSLATE_NOOP+=TRANSLATE_SV,QT_TRANSLATE_NOOP+=TRANSLATE_STR,QT_TRANSLATE_NOOP+=TRANSLATE_FS,QT_TRANSLATE_N_NOOP3+=TRANSLATE_FMT,QT_TRANSLATE_NOOP+=TRANSLATE_NOOP "%QTBIN%\lupdate.exe" %SRCDIRS% %OPTS% -no-obsolete -source-language en -ts pcsx2-qt_en.ts diff --git a/pcsx2-qt/Translations/update_en_translation.sh b/pcsx2-qt/Translations/update_en_translation.sh index a425b9bed4..7395b0f225 100755 --- a/pcsx2-qt/Translations/update_en_translation.sh +++ b/pcsx2-qt/Translations/update_en_translation.sh @@ -2,7 +2,7 @@ SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}") -OPTS="-tr-function-alias QT_TRANSLATE_NOOP+=TRANSLATE,QT_TRANSLATE_NOOP+=TRANSLATE_SV,QT_TRANSLATE_NOOP+=TRANSLATE_STR,QT_TRANSLATE_N_NOOP3+=TRANSLATE_FMT,QT_TRANSLATE_NOOP+=TRANSLATE_NOOP" +OPTS="-tr-function-alias QT_TRANSLATE_NOOP+=TRANSLATE,QT_TRANSLATE_NOOP+=TRANSLATE_SV,QT_TRANSLATE_NOOP+=TRANSLATE_STR,QT_TRANSLATE_NOOP+=TRANSLATE_FS,QT_TRANSLATE_N_NOOP3+=TRANSLATE_FMT,QT_TRANSLATE_NOOP+=TRANSLATE_NOOP" SRCDIRS=$(realpath "$SCRIPTDIR/..")/\ $(realpath "$SCRIPTDIR/../../pcsx2")/ OUTDIR=$(realpath "$SCRIPTDIR") diff --git a/pcsx2/Achievements.cpp b/pcsx2/Achievements.cpp index e936db50d3..f8731ff2b6 100644 --- a/pcsx2/Achievements.cpp +++ b/pcsx2/Achievements.cpp @@ -1058,7 +1058,7 @@ void Achievements::DisplayAchievementSummary() std::string summary; if (GetAchievementCount() > 0) { - summary = fmt::format(TRANSLATE_SV("Achievements", "You have earned {0} of {1} achievements, and {2} of {3} points."), + summary = fmt::format(TRANSLATE_FS("Achievements", "You have earned {0} of {1} achievements, and {2} of {3} points."), GetUnlockedAchiementCount(), GetAchievementCount(), GetCurrentPointsForGame(), GetMaximumPointsForGame()); } else @@ -1758,7 +1758,7 @@ void Achievements::DeactivateAchievement(Achievement* achievement) if (achievement->primed) { achievement->primed = false; - s_primed_achievement_count.fetch_sub(std::memory_order_acq_rel); + s_primed_achievement_count.fetch_sub(1, std::memory_order_acq_rel); } DevCon.WriteLn("Deactivated achievement %s (%u)", achievement->title.c_str(), achievement->id); @@ -1891,7 +1891,7 @@ void Achievements::AchievementPrimed(u32 achievement_id) return; achievement->primed = true; - s_primed_achievement_count.fetch_add(std::memory_order_acq_rel); + s_primed_achievement_count.fetch_add(1, std::memory_order_acq_rel); } void Achievements::AchievementUnprimed(u32 achievement_id) @@ -1902,7 +1902,7 @@ void Achievements::AchievementUnprimed(u32 achievement_id) return; achievement->primed = false; - s_primed_achievement_count.fetch_sub(std::memory_order_acq_rel); + s_primed_achievement_count.fetch_sub(1, std::memory_order_acq_rel); } void Achievements::SubmitLeaderboard(u32 leaderboard_id, int value) diff --git a/pcsx2/CDVD/CDVDcommon.cpp b/pcsx2/CDVD/CDVDcommon.cpp index 602c3efc1e..f345d12c2d 100644 --- a/pcsx2/CDVD/CDVDcommon.cpp +++ b/pcsx2/CDVD/CDVDcommon.cpp @@ -395,7 +395,7 @@ bool DoCDVDopen() CDVD->getTD(0, &td); Host::AddKeyedOSDMessage("BlockDumpCreate", - fmt::format(TRANSLATE_SV("CDVD", "Saving CDVD block dump to '{}'."), temp), Host::OSD_INFO_DURATION); + fmt::format(TRANSLATE_FS("CDVD", "Saving CDVD block dump to '{}'."), temp), Host::OSD_INFO_DURATION); if (blockDumpFile.Create(std::move(temp), 2)) { diff --git a/pcsx2/CDVD/OutputIsoFile.cpp b/pcsx2/CDVD/OutputIsoFile.cpp index 71be260cfc..08ff0b8fa0 100644 --- a/pcsx2/CDVD/OutputIsoFile.cpp +++ b/pcsx2/CDVD/OutputIsoFile.cpp @@ -125,7 +125,7 @@ void OutputIsoFile::WriteBuffer(const void* src, size_t size) { if (std::fwrite(src, size, 1, m_outstream) != 1) { - Host::ReportErrorAsync("Write Error", fmt::format("errno {} when trying to write {} bytes to block dump file.\n\nClosing file.")); + Host::ReportErrorAsync("Write Error", fmt::format("errno {} when trying to write {} bytes to block dump file.\n\nClosing file.", errno, size)); Close(); } } diff --git a/pcsx2/DEV9/flash.cpp b/pcsx2/DEV9/flash.cpp index 7df4e795e4..706b07cd56 100644 --- a/pcsx2/DEV9/flash.cpp +++ b/pcsx2/DEV9/flash.cpp @@ -30,7 +30,7 @@ #define CARD_SIZE_ECC (1024 * BLOCK_SIZE_ECC) -static volatile u32 ctrl, cmd = (u32)-1, address, id, counter, addrbyte; +static u32 ctrl, cmd = (u32)-1, address, id, counter, addrbyte; static u8 data[PAGE_SIZE_ECC], file[CARD_SIZE_ECC]; static void xfromman_call20_calculateXors(unsigned char buffer[128], unsigned char blah[4]); diff --git a/pcsx2/GS/GS.cpp b/pcsx2/GS/GS.cpp index 62a40f99e6..ca31c31bcb 100644 --- a/pcsx2/GS/GS.cpp +++ b/pcsx2/GS/GS.cpp @@ -989,7 +989,7 @@ static void HotkeyAdjustUpscaleMultiplier(s32 delta) { const u32 new_multiplier = static_cast(std::clamp(static_cast(EmuConfig.GS.UpscaleMultiplier) + delta, 1, 8)); Host::AddKeyedOSDMessage("UpscaleMultiplierChanged", - fmt::format(TRANSLATE_SV("GS", "Upscale multiplier set to {}x."), new_multiplier), Host::OSD_QUICK_DURATION); + fmt::format(TRANSLATE_FS("GS", "Upscale multiplier set to {}x."), new_multiplier), Host::OSD_QUICK_DURATION); EmuConfig.GS.UpscaleMultiplier = new_multiplier; // this is pretty slow. we only really need to flush the TC and recompile shaders. @@ -1068,7 +1068,7 @@ BEGIN_HOTKEY_LIST(g_gs_hotkeys){"Screenshot", TRANSLATE_NOOP("Hotkeys", "Graphic EmuConfig.CurrentAspectRatio = static_cast( (static_cast(EmuConfig.CurrentAspectRatio) + 1) % static_cast(AspectRatioType::MaxCount)); Host::AddKeyedOSDMessage("CycleAspectRatio", - fmt::format(TRANSLATE_SV("Hotkeys", "Aspect ratio set to '{}'."), + fmt::format(TRANSLATE_FS("Hotkeys", "Aspect ratio set to '{}'."), Pcsx2Config::GSOptions::AspectRatioNames[static_cast(EmuConfig.CurrentAspectRatio)]), Host::OSD_QUICK_DURATION); }}, @@ -1084,7 +1084,7 @@ BEGIN_HOTKEY_LIST(g_gs_hotkeys){"Screenshot", TRANSLATE_NOOP("Hotkeys", "Graphic const HWMipmapLevel new_level = static_cast(((static_cast(EmuConfig.GS.HWMipmap) + 2) % CYCLE_COUNT) - 1); Host::AddKeyedOSDMessage("CycleMipmapMode", - fmt::format(TRANSLATE_SV("Hotkeys", "Hardware mipmapping set to '{}'."), + fmt::format(TRANSLATE_FS("Hotkeys", "Hardware mipmapping set to '{}'."), option_names[static_cast(new_level) + 1]), Host::OSD_QUICK_DURATION); EmuConfig.GS.HWMipmap = new_level; @@ -1117,7 +1117,7 @@ BEGIN_HOTKEY_LIST(g_gs_hotkeys){"Screenshot", TRANSLATE_NOOP("Hotkeys", "Graphic (static_cast(EmuConfig.GS.InterlaceMode) + 1) % static_cast(GSInterlaceMode::Count)); Host::AddKeyedOSDMessage("CycleInterlaceMode", fmt::format( - TRANSLATE_SV("Hotkeys", "Deinterlace mode set to '{}'."), option_names[static_cast(new_mode)]), + TRANSLATE_FS("Hotkeys", "Deinterlace mode set to '{}'."), option_names[static_cast(new_mode)]), Host::OSD_QUICK_DURATION); EmuConfig.GS.InterlaceMode = new_mode; diff --git a/pcsx2/GS/Renderers/Common/GSRenderer.cpp b/pcsx2/GS/Renderers/Common/GSRenderer.cpp index 0f01ff068a..b5d342017b 100644 --- a/pcsx2/GS/Renderers/Common/GSRenderer.cpp +++ b/pcsx2/GS/Renderers/Common/GSRenderer.cpp @@ -432,7 +432,7 @@ static void CompressAndWriteScreenshot(std::string filename, u32 width, u32 heig if (!GSDumpReplayer::IsRunner()) { Host::AddIconOSDMessage(key, ICON_FA_CAMERA, - fmt::format(TRANSLATE_SV("GS", "Saving screenshot to '{}'."), Path::GetFileName(filename)), 60.0f); + fmt::format(TRANSLATE_FS("GS", "Saving screenshot to '{}'."), Path::GetFileName(filename)), 60.0f); } // maybe std::async would be better here.. but it's definitely worth threading, large screenshots take a while to compress. @@ -444,14 +444,14 @@ static void CompressAndWriteScreenshot(std::string filename, u32 width, u32 heig if (!GSDumpReplayer::IsRunner()) { Host::AddIconOSDMessage(std::move(key), ICON_FA_CAMERA, - fmt::format(TRANSLATE_SV("GS", "Saved screenshot to '{}'."), Path::GetFileName(filename)), + fmt::format(TRANSLATE_FS("GS", "Saved screenshot to '{}'."), Path::GetFileName(filename)), Host::OSD_INFO_DURATION); } } else { Host::AddIconOSDMessage(std::move(key), ICON_FA_CAMERA, - fmt::format(TRANSLATE_SV("GS", "Failed to save screenshot to '{}'."), Path::GetFileName(filename), + fmt::format(TRANSLATE_FS("GS", "Failed to save screenshot to '{}'."), Path::GetFileName(filename), Host::OSD_ERROR_DURATION)); } @@ -699,7 +699,7 @@ void GSRenderer::VSync(u32 field, bool registers_written, bool idle_frame) delete[] fd.data; Host::AddKeyedOSDMessage("GSDump", - fmt::format(TRANSLATE_SV("GS", "Saving {0} GS dump {1} to '{2}'"), + fmt::format(TRANSLATE_FS("GS", "Saving {0} GS dump {1} to '{2}'"), (m_dump_frames == 1) ? "single frame" : "multi-frame", compression_str, Path::GetFileName(m_dump->GetPath())), Host::OSD_INFO_DURATION); @@ -731,7 +731,7 @@ void GSRenderer::VSync(u32 field, bool registers_written, bool idle_frame) if (m_dump->VSync(field, last, m_regs)) { Host::AddKeyedOSDMessage("GSDump", - fmt::format(TRANSLATE_SV("GS", "Saved GS dump to '{}'."), Path::GetFileName(m_dump->GetPath())), + fmt::format(TRANSLATE_FS("GS", "Saved GS dump to '{}'."), Path::GetFileName(m_dump->GetPath())), Host::OSD_INFO_DURATION); m_dump.reset(); } diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp index 1bffb78da6..7a67169ec9 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -171,7 +171,7 @@ void GSRendererHW::VSync(u32 field, bool registers_written, bool idle_frame) if (g_texture_cache->GetHashCacheMemoryUsage() > 1024 * 1024 * 1024) { Host::AddKeyedOSDMessage("HashCacheOverflow", - fmt::format(TRANSLATE_SV("GS", "Hash cache has used {:.2f} MB of VRAM, disabling."), + fmt::format(TRANSLATE_FS("GS", "Hash cache has used {:.2f} MB of VRAM, disabling."), static_cast(g_texture_cache->GetHashCacheMemoryUsage()) / 1048576.0f), Host::OSD_ERROR_DURATION); g_texture_cache->RemoveAll(); diff --git a/pcsx2/GameDatabase.cpp b/pcsx2/GameDatabase.cpp index 6a82f9892a..744b542d8a 100644 --- a/pcsx2/GameDatabase.cpp +++ b/pcsx2/GameDatabase.cpp @@ -857,7 +857,7 @@ void GameDatabaseSchema::GameEntry::applyGSHardwareFixes(Pcsx2Config::GSOptions& if (value >= 0 && value <= static_cast(AccBlendLevel::Maximum) && static_cast(EmuConfig.GS.AccurateBlendingUnit) < value) { Host::AddKeyedOSDMessage("HWBlendingWarning", - fmt::format(TRANSLATE_SV("GameDatabase", + fmt::format(TRANSLATE_FS("GameDatabase", "{0} Current Blending Accuracy is {1}.\n" "Recommended Blending Accuracy for this game is {2}.\n" "You can adjust the blending level in Game Properties to improve\n" diff --git a/pcsx2/Host.h b/pcsx2/Host.h index f522864b74..1aedaf21cf 100644 --- a/pcsx2/Host.h +++ b/pcsx2/Host.h @@ -181,6 +181,7 @@ namespace Host #define TRANSLATE(context, msg) Host::TranslateToCString(context, msg) #define TRANSLATE_SV(context, msg) Host::TranslateToStringView(context, msg) #define TRANSLATE_STR(context, msg) Host::TranslateToString(context, msg) +#define TRANSLATE_FS(context, msg) fmt::runtime(Host::TranslateToStringView(context, msg)) // Does not translate the string at runtime, but allows the UI to in its own way. #define TRANSLATE_NOOP(context, msg) msg diff --git a/pcsx2/Hotkeys.cpp b/pcsx2/Hotkeys.cpp index 06a8c9eae7..7f2f996bde 100644 --- a/pcsx2/Hotkeys.cpp +++ b/pcsx2/Hotkeys.cpp @@ -45,7 +45,7 @@ static void HotkeyAdjustTargetSpeed(double delta) EmuConfig.LimiterMode = LimiterModeType::Unlimited; // force update VMManager::SetLimiterMode(LimiterModeType::Nominal); Host::AddIconOSDMessage("SpeedChanged", ICON_FA_CLOCK, - fmt::format(TRANSLATE_SV("Hotkeys", "Target speed set to {:.0f}%."), + fmt::format(TRANSLATE_FS("Hotkeys", "Target speed set to {:.0f}%."), std::round(EmuConfig.Framerate.NominalScalar * 100.0)), Host::OSD_QUICK_DURATION); } @@ -68,7 +68,7 @@ static void HotkeyAdjustVolume(s32 fixed, s32 delta) else { Host::AddIconOSDMessage("VolumeChanged", (current_vol < new_volume) ? ICON_FA_VOLUME_UP : ICON_FA_VOLUME_DOWN, - fmt::format(TRANSLATE_SV("Hotkeys", "Volume: {}%"), new_volume)); + fmt::format(TRANSLATE_FS("Hotkeys", "Volume: {}%"), new_volume)); } } @@ -103,13 +103,13 @@ static void HotkeyCycleSaveSlot(s32 delta) Host::AddIconOSDMessage("CycleSaveSlot", ICON_FA_SEARCH, fmt::format( - TRANSLATE_SV("Hotkeys", "Save slot {} selected (last save: {})."), s_current_save_slot, date_buf), + TRANSLATE_FS("Hotkeys", "Save slot {} selected (last save: {})."), s_current_save_slot, date_buf), Host::OSD_QUICK_DURATION); } else { Host::AddIconOSDMessage("CycleSaveSlot", ICON_FA_SEARCH, - fmt::format(TRANSLATE_SV("Hotkeys", "Save slot {} selected (no save yet)."), s_current_save_slot), + fmt::format(TRANSLATE_FS("Hotkeys", "Save slot {} selected (no save yet)."), s_current_save_slot), Host::OSD_QUICK_DURATION); } } @@ -121,7 +121,7 @@ static void HotkeyLoadStateSlot(s32 slot) if (!VMManager::HasSaveStateInSlot(VMManager::GetDiscSerial().c_str(), VMManager::GetDiscCRC(), slot)) { Host::AddIconOSDMessage("LoadStateFromSlot", ICON_FA_EXCLAMATION_TRIANGLE, - fmt::format(TRANSLATE_SV("Hotkeys", "No save state found in slot {}."), slot), Host::OSD_INFO_DURATION); + fmt::format(TRANSLATE_FS("Hotkeys", "No save state found in slot {}."), slot), Host::OSD_INFO_DURATION); return; } diff --git a/pcsx2/MemoryCardFile.cpp b/pcsx2/MemoryCardFile.cpp index deb359934c..a8666b3510 100644 --- a/pcsx2/MemoryCardFile.cpp +++ b/pcsx2/MemoryCardFile.cpp @@ -536,7 +536,7 @@ s32 FileMemoryCard::Save(uint slot, const u8* src, u32 adr, int size) if (elapsed > std::chrono::seconds(5)) { Host::AddIconOSDMessage(fmt::format("MemoryCardSave{}", slot), ICON_FA_SD_CARD, - fmt::format(TRANSLATE_SV("MemoryCard", "Memory Card '{}' was saved to storage."), + fmt::format(TRANSLATE_FS("MemoryCard", "Memory Card '{}' was saved to storage."), Path::GetFileName(m_filenames[slot])), Host::OSD_INFO_DURATION); last = std::chrono::system_clock::now(); diff --git a/pcsx2/MemoryCardFolder.cpp b/pcsx2/MemoryCardFolder.cpp index c0dff3e2d5..2f6d421f56 100644 --- a/pcsx2/MemoryCardFolder.cpp +++ b/pcsx2/MemoryCardFolder.cpp @@ -2353,7 +2353,7 @@ s32 FolderMemoryCardAggregator::Save(uint slot, const u8* src, u32 adr, int size { const std::string_view filename = Path::GetFileName(m_cards[slot].GetFolderName()); Host::AddIconOSDMessage(fmt::format("MemoryCardSave{}", slot), ICON_FA_SD_CARD, - fmt::format(TRANSLATE_SV("MemoryCard", "Memory Card '{}' was saved to storage."), filename), + fmt::format(TRANSLATE_FS("MemoryCard", "Memory Card '{}' was saved to storage."), filename), Host::OSD_INFO_DURATION); last = std::chrono::system_clock::now(); diff --git a/pcsx2/Patch.cpp b/pcsx2/Patch.cpp index f25b683839..e2d2dd3c80 100644 --- a/pcsx2/Patch.cpp +++ b/pcsx2/Patch.cpp @@ -298,7 +298,7 @@ bool Patch::OpenPatchesZip() if (!warning_shown) { Host::AddIconOSDMessage("PatchesZipOpenWarning", ICON_FA_MICROCHIP, - fmt::format(TRANSLATE_SV("Patch", "Failed to open {}. Built-in game patches are not available."), + fmt::format(TRANSLATE_FS("Patch", "Failed to open {}. Built-in game patches are not available."), PATCHES_ZIP_NAME), Host::OSD_ERROR_DURATION); warning_shown = true; @@ -592,20 +592,20 @@ void Patch::UpdateActivePatches(bool reload_enabled_list, bool verbose, bool ver { gp_count = EnablePatches(s_gamedb_patches, EnablePatchList()); if (gp_count > 0) - fmt::format_to(std::back_inserter(message), TRANSLATE_SV("Patch", "{} GameDB patches"), gp_count); + fmt::format_to(std::back_inserter(message), TRANSLATE_FS("Patch", "{} GameDB patches"), gp_count); } const u32 p_count = EnablePatches(s_game_patches, s_enabled_patches); if (p_count > 0) { - fmt::format_to(std::back_inserter(message), TRANSLATE_SV("Patch", "{}{} game patches"), + fmt::format_to(std::back_inserter(message), TRANSLATE_FS("Patch", "{}{} game patches"), message.empty() ? "" : ", ", p_count); } const u32 c_count = EmuConfig.EnableCheats ? EnablePatches(s_cheat_patches, s_enabled_cheats) : 0; if (c_count > 0) { - fmt::format_to(std::back_inserter(message), TRANSLATE_SV("Patch", "{}{} cheat patches"), + fmt::format_to(std::back_inserter(message), TRANSLATE_FS("Patch", "{}{} cheat patches"), message.empty() ? "" : ", ", c_count); } @@ -617,12 +617,12 @@ void Patch::UpdateActivePatches(bool reload_enabled_list, bool verbose, bool ver if (!message.empty()) { Host::AddIconOSDMessage("LoadPatches", ICON_FA_FILE_CODE, - fmt::format(TRANSLATE_SV("Patch", "{} are active."), message), Host::OSD_INFO_DURATION); + fmt::format(TRANSLATE_FS("Patch", "{} are active."), message), Host::OSD_INFO_DURATION); } else { Host::AddIconOSDMessage("LoadPatches", ICON_FA_FILE_CODE, - TRANSLATE_STR( + TRANSLATE_SV( "Patch", "No cheats or patches (widescreen, compatibility or others) are found / enabled."), Host::OSD_INFO_DURATION); } diff --git a/pcsx2/SPU2/SndOut_Cubeb.cpp b/pcsx2/SPU2/SndOut_Cubeb.cpp index 48e6ec9be2..6a13ba1794 100644 --- a/pcsx2/SPU2/SndOut_Cubeb.cpp +++ b/pcsx2/SPU2/SndOut_Cubeb.cpp @@ -292,7 +292,7 @@ public: { Host::AddIconOSDMessage("CubebDeviceNotFound", ICON_FA_VOLUME_MUTE, fmt::format( - TRANSLATE_SV("SPU2", "Requested audio output device '{}' not found, using default."), + TRANSLATE_FS("SPU2", "Requested audio output device '{}' not found, using default."), selected_device_name), Host::OSD_WARNING_DURATION); } diff --git a/pcsx2/USB/usb-mic/usb-mic-singstar.cpp b/pcsx2/USB/usb-mic/usb-mic-singstar.cpp index 94dd3c7e55..5b6d451b62 100644 --- a/pcsx2/USB/usb-mic/usb-mic-singstar.cpp +++ b/pcsx2/USB/usb-mic/usb-mic-singstar.cpp @@ -765,7 +765,7 @@ namespace usb_mic if (!s->audsrc[i]->Start()) { Host::AddOSDMessage( - fmt::format(TRANSLATE_SV("USB", "USB-Mic: Failed to start player {} audio stream."), i + 1), + fmt::format(TRANSLATE_FS("USB", "USB-Mic: Failed to start player {} audio stream."), i + 1), Host::OSD_ERROR_DURATION); goto fail; } diff --git a/pcsx2/USB/usb-msd/usb-msd.cpp b/pcsx2/USB/usb-msd/usb-msd.cpp index d9ac30f722..7a003412b9 100644 --- a/pcsx2/USB/usb-msd/usb-msd.cpp +++ b/pcsx2/USB/usb-msd/usb-msd.cpp @@ -971,7 +971,7 @@ namespace usb_msd std::string path(USB::GetConfigString(si, port, TypeName(), "ImagePath")); if (path.empty() || !(s->file = FileSystem::OpenCFile(path.c_str(), "r+b"))) { - Host::AddOSDMessage(fmt::format(TRANSLATE_SV("USB", "usb-msd: Could not open image file '{}'"), path), + Host::AddOSDMessage(fmt::format(TRANSLATE_FS("USB", "usb-msd: Could not open image file '{}'"), path), Host::OSD_ERROR_DURATION); goto fail; } diff --git a/pcsx2/USB/usb-printer/usb-printer.cpp b/pcsx2/USB/usb-printer/usb-printer.cpp index 4b8a50659a..b045b42eb5 100644 --- a/pcsx2/USB/usb-printer/usb-printer.cpp +++ b/pcsx2/USB/usb-printer/usb-printer.cpp @@ -101,13 +101,13 @@ namespace usb_printer if (!s->print_file) { Host::AddIconOSDMessage("USBPrinterOpen", ICON_FA_EXCLAMATION_TRIANGLE, - fmt::format(TRANSLATE_SV("USB", "Failed to open '{}' for printing."), s->print_filename), + fmt::format(TRANSLATE_FS("USB", "Failed to open '{}' for printing."), s->print_filename), Host::OSD_ERROR_DURATION); return; } Host::AddIconOSDMessage("USBPrinterOpen", ICON_FA_SAVE, - fmt::format(TRANSLATE_SV("USB", "Printer saving to '{}'..."), Path::GetFileName(s->print_filename)), + fmt::format(TRANSLATE_FS("USB", "Printer saving to '{}'..."), Path::GetFileName(s->print_filename)), Host::OSD_INFO_DURATION); BMPHeader header = {0}; diff --git a/pcsx2/VMManager.cpp b/pcsx2/VMManager.cpp index cb812a99fb..b8f16eb8d7 100644 --- a/pcsx2/VMManager.cpp +++ b/pcsx2/VMManager.cpp @@ -1538,7 +1538,7 @@ bool VMManager::DoSaveState(const char* filename, s32 slot_for_message, bool zip if (!elist) { Host::AddIconOSDMessage(std::move(osd_key), ICON_FA_EXCLAMATION_TRIANGLE, - fmt::format(TRANSLATE_SV("VMManager", "Failed to save save state: {}."), error.GetDescription()), + fmt::format(TRANSLATE_FS("VMManager", "Failed to save save state: {}."), error.GetDescription()), Host::OSD_ERROR_DURATION); return false; } @@ -1553,7 +1553,7 @@ bool VMManager::DoSaveState(const char* filename, s32 slot_for_message, bool zip { Host::AddIconOSDMessage(std::move(osd_key), ICON_FA_EXCLAMATION_TRIANGLE, fmt::format( - TRANSLATE_SV("VMManager", "Failed to back up old save state {}."), Path::GetFileName(filename)), + TRANSLATE_FS("VMManager", "Failed to back up old save state {}."), Path::GetFileName(filename)), Host::OSD_ERROR_DURATION); } } @@ -1585,14 +1585,14 @@ void VMManager::ZipSaveState(std::unique_ptr elist, if (slot_for_message >= 0 && VMManager::HasValidVM()) { Host::AddIconOSDMessage(std::move(osd_key), ICON_FA_SAVE, - fmt::format(TRANSLATE_SV("VMManager", "State saved to slot {}."), slot_for_message), + fmt::format(TRANSLATE_FS("VMManager", "State saved to slot {}."), slot_for_message), Host::OSD_QUICK_DURATION); } } else { Host::AddIconOSDMessage(std::move(osd_key), ICON_FA_EXCLAMATION_TRIANGLE, - fmt::format(TRANSLATE_SV("VMManager", "Failed to save save state to slot {}."), slot_for_message, + fmt::format(TRANSLATE_FS("VMManager", "Failed to save save state to slot {}."), slot_for_message, Host::OSD_ERROR_DURATION)); } @@ -1679,7 +1679,7 @@ bool VMManager::LoadStateFromSlot(s32 slot) if (filename.empty()) { Host::AddIconOSDMessage("LoadStateFromSlot", ICON_FA_EXCLAMATION_TRIANGLE, - fmt::format(TRANSLATE_SV("VMManager", "There is no save state in slot {}."), slot), + fmt::format(TRANSLATE_FS("VMManager", "There is no save state in slot {}."), slot), Host::OSD_QUICK_DURATION); return false; } @@ -1692,7 +1692,7 @@ bool VMManager::LoadStateFromSlot(s32 slot) #endif Host::AddIconOSDMessage("LoadStateFromSlot", ICON_FA_FOLDER_OPEN, - fmt::format(TRANSLATE_SV("VMManager", "Loading state from slot {}..."), slot), Host::OSD_QUICK_DURATION); + fmt::format(TRANSLATE_FS("VMManager", "Loading state from slot {}..."), slot), Host::OSD_QUICK_DURATION); return DoLoadState(filename.c_str()); } @@ -1709,7 +1709,7 @@ bool VMManager::SaveStateToSlot(s32 slot, bool zip_on_thread) // if it takes more than a minute.. well.. wtf. Host::AddIconOSDMessage(fmt::format("SaveStateSlot{}", slot), ICON_FA_SAVE, - fmt::format(TRANSLATE_SV("VMManager", "Saving state to slot {}..."), slot), 60.0f); + fmt::format(TRANSLATE_FS("VMManager", "Saving state to slot {}..."), slot), 60.0f); return DoSaveState(filename.c_str(), slot, zip_on_thread, EmuConfig.BackupSavestate); } @@ -1777,14 +1777,14 @@ bool VMManager::ChangeDisc(CDVD_SourceType source, std::string path) else { Host::AddIconOSDMessage("ChangeDisc", ICON_FA_COMPACT_DISC, - fmt::format(TRANSLATE_SV("VMManager", "Disc changed to '{}'."), display_name), Host::OSD_INFO_DURATION); + fmt::format(TRANSLATE_FS("VMManager", "Disc changed to '{}'."), display_name), Host::OSD_INFO_DURATION); } } else { Host::AddIconOSDMessage("ChangeDisc", ICON_FA_COMPACT_DISC, fmt::format( - TRANSLATE_SV("VMManager", "Failed to open new disc image '{}'. Reverting to old image."), display_name), + TRANSLATE_FS("VMManager", "Failed to open new disc image '{}'. Reverting to old image."), display_name), Host::OSD_ERROR_DURATION); CDVDsys_ChangeSource(old_type); if (!old_path.empty())