From c06bc16b22920a33c1a48789478d4f6bc258b743 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Mon, 19 Jun 2023 20:27:34 +1000 Subject: [PATCH] Misc: Mark core strings for translation --- pcsx2/Achievements.cpp | 11 +- pcsx2/CDVD/CDVDcommon.cpp | 8 +- pcsx2/GS/GS.cpp | 292 +++++++++-------- pcsx2/GS/Renderers/Common/GSRenderer.cpp | 41 ++- pcsx2/GS/Renderers/HW/GSRendererHW.cpp | 6 +- .../GS/Renderers/HW/GSTextureReplacements.cpp | 9 +- pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp | 5 +- pcsx2/GameDatabase.cpp | 18 +- pcsx2/Hotkeys.cpp | 303 ++++++++++-------- pcsx2/MemoryCardFile.cpp | 3 +- pcsx2/MemoryCardFolder.cpp | 3 +- pcsx2/PAD/Host/PAD.cpp | 130 ++++---- pcsx2/Patch.cpp | 25 +- pcsx2/SPU2/SndOut_Cubeb.cpp | 4 +- pcsx2/Sio.cpp | 23 +- pcsx2/USB/USB.cpp | 6 +- pcsx2/USB/usb-eyetoy/usb-eyetoy-webcam.cpp | 13 +- pcsx2/USB/usb-hid/usb-hid.cpp | 17 +- pcsx2/USB/usb-lightgun/guncon2.cpp | 58 ++-- pcsx2/USB/usb-mic/usb-headset.cpp | 23 +- pcsx2/USB/usb-mic/usb-mic-singstar.cpp | 32 +- pcsx2/USB/usb-msd/usb-msd.cpp | 11 +- pcsx2/USB/usb-pad/usb-pad.cpp | 237 +++++++------- pcsx2/USB/usb-pad/usb-seamic.cpp | 49 +-- pcsx2/USB/usb-printer/usb-printer.cpp | 8 +- pcsx2/VMManager.cpp | 192 ++++++++--- 26 files changed, 875 insertions(+), 652 deletions(-) diff --git a/pcsx2/Achievements.cpp b/pcsx2/Achievements.cpp index c7b274282d..443f7c28e3 100644 --- a/pcsx2/Achievements.cpp +++ b/pcsx2/Achievements.cpp @@ -1053,23 +1053,23 @@ void Achievements::DisplayAchievementSummary() { std::string title = s_game_title; if (ChallengeModeActive()) - title += " (Hardcore Mode)"; + title += TRANSLATE_SV("Achievements", " (Hardcore Mode)"); std::string summary; if (GetAchievementCount() > 0) { - summary = StringUtil::StdStringFromFormat("You have earned %u of %u achievements, and %u of %u points.", + summary = fmt::format(TRANSLATE_SV("Achievements", "You have earned {0} of {1} achievements, and {2} of {3} points."), GetUnlockedAchiementCount(), GetAchievementCount(), GetCurrentPointsForGame(), GetMaximumPointsForGame()); } else { - summary = "This game has no achievements."; + summary = TRANSLATE_SV("Achievements", "This game has no achievements."); } if (GetLeaderboardCount() > 0) { summary.push_back('\n'); if (LeaderboardsActive()) - summary.append("Leaderboard submission is enabled."); + summary.append(TRANSLATE_SV("Achievements", "Leaderboard submission is enabled.")); } GetMTGS().RunOnGSThread([title = std::move(title), summary = std::move(summary), icon = s_game_icon]() { @@ -1505,7 +1505,8 @@ void Achievements::GameChanged(u32 disc_crc, u32 crc) // when we're booting the bios, or shutting down, this will fail if (disc_crc != 0) { - Host::AddKeyedOSDMessage("retroachievements_disc_read_failed", "Failed to read executable from disc. Achievements disabled.", + Host::AddKeyedOSDMessage("retroachievements_disc_read_failed", + TRANSLATE_STR("Achievements", "Failed to read executable from disc. Achievements disabled."), Host::OSD_CRITICAL_ERROR_DURATION); } diff --git a/pcsx2/CDVD/CDVDcommon.cpp b/pcsx2/CDVD/CDVDcommon.cpp index 25a97be80a..d73ac4fb33 100644 --- a/pcsx2/CDVD/CDVDcommon.cpp +++ b/pcsx2/CDVD/CDVDcommon.cpp @@ -314,7 +314,10 @@ void CDVDsys_SetFile(CDVD_SourceType srctype, std::string newfile) const auto driveType = GetDriveType(StringUtil::UTF8StringToWideString(root).c_str()); if (driveType == DRIVE_REMOVABLE) { - Host::AddIconOSDMessage("RemovableDriveWarning", ICON_FA_EXCLAMATION_TRIANGLE, "Game disc location is on a removable drive, performance issues such as jittering and freezing may occur.", Host::OSD_WARNING_DURATION); + Host::AddIconOSDMessage("RemovableDriveWarning", ICON_FA_EXCLAMATION_TRIANGLE, + TRANSLATE_SV("CDVD", "Game disc location is on a removable drive, performance issues such as jittering " + "and freezing may occur."), + Host::OSD_WARNING_DURATION); } } #endif @@ -421,7 +424,8 @@ bool DoCDVDopen() cdvdTD td; CDVD->getTD(0, &td); - Host::AddKeyedOSDMessage("BlockDumpCreate", fmt::format("Saving CDVD block dump to '{}'.", temp), Host::OSD_INFO_DURATION); + Host::AddKeyedOSDMessage("BlockDumpCreate", + fmt::format(TRANSLATE_SV("CDVD", "Saving CDVD block dump to '{}'."), temp), Host::OSD_INFO_DURATION); if (blockDumpFile.Create(std::move(temp), 2)) { diff --git a/pcsx2/GS/GS.cpp b/pcsx2/GS/GS.cpp index 77e3f203c1..b8ec6898b6 100644 --- a/pcsx2/GS/GS.cpp +++ b/pcsx2/GS/GS.cpp @@ -265,8 +265,9 @@ bool GSreopen(bool recreate_device, bool recreate_renderer, const Pcsx2Config::G if (!OpenGSDevice(GSConfig.Renderer, false, recreate_window) || (recreate_renderer && !OpenGSRenderer(GSConfig.Renderer, basemem))) { - Host::AddKeyedOSDMessage( - "GSReopenFailed", "Failed to reopen, restoring old configuration.", Host::OSD_CRITICAL_ERROR_DURATION); + Host::AddKeyedOSDMessage("GSReopenFailed", + TRANSLATE_STR("GS", "Failed to reopen, restoring old configuration."), + Host::OSD_CRITICAL_ERROR_DURATION); CloseGSDevice(false); @@ -965,7 +966,8 @@ void GSFreeWrappedMemory(void* ptr, size_t size, size_t repeat) static void HotkeyAdjustUpscaleMultiplier(s32 delta) { const u32 new_multiplier = static_cast(std::clamp(static_cast(EmuConfig.GS.UpscaleMultiplier) + delta, 1, 8)); - Host::AddKeyedFormattedOSDMessage("UpscaleMultiplierChanged", Host::OSD_QUICK_DURATION, "Upscale multiplier set to %ux.", new_multiplier); + Host::AddKeyedOSDMessage("UpscaleMultiplierChanged", + fmt::format(TRANSLATE_SV("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. @@ -973,144 +975,174 @@ static void HotkeyAdjustUpscaleMultiplier(s32 delta) GetMTGS().ApplySettings(); } -BEGIN_HOTKEY_LIST(g_gs_hotkeys) - {"Screenshot", "Graphics", "Save Screenshot", [](s32 pressed) { +BEGIN_HOTKEY_LIST(g_gs_hotkeys){"Screenshot", TRANSLATE_NOOP("Hotkeys", "Graphics"), + TRANSLATE_NOOP("Hotkeys", "Save Screenshot"), + [](s32 pressed) { if (!pressed) { - GetMTGS().RunOnGSThread([]() { - GSQueueSnapshot(std::string(), 0); - }); + GetMTGS().RunOnGSThread([]() { GSQueueSnapshot(std::string(), 0); }); } }}, - {"ToggleVideoCapture", "Graphics", "Toggle Video Capture", [](s32 pressed) { - if (!pressed) - { - if (GSCapture::IsCapturing()) - { - GetMTGS().RunOnGSThread([]() { g_gs_renderer->EndCapture(); }); - GetMTGS().WaitGS(false, false, false); - return; - } + {"ToggleVideoCapture", TRANSLATE_NOOP("Hotkeys", "Graphics"), TRANSLATE_NOOP("Hotkeys", "Toggle Video Capture"), + [](s32 pressed) { + if (!pressed) + { + if (GSCapture::IsCapturing()) + { + GetMTGS().RunOnGSThread([]() { g_gs_renderer->EndCapture(); }); + GetMTGS().WaitGS(false, false, false); + return; + } - GetMTGS().RunOnGSThread([]() { - std::string filename(fmt::format("{}.{}", GSGetBaseVideoFilename(), GSConfig.CaptureContainer)); - g_gs_renderer->BeginCapture(std::move(filename)); - }); + GetMTGS().RunOnGSThread([]() { + std::string filename(fmt::format("{}.{}", GSGetBaseVideoFilename(), GSConfig.CaptureContainer)); + g_gs_renderer->BeginCapture(std::move(filename)); + }); - // Sync GS thread. We want to start adding audio at the same time as video. - GetMTGS().WaitGS(false, false, false); - } - }}, - {"GSDumpSingleFrame", "Graphics", "Save Single Frame GS Dump", [](s32 pressed) { - if (!pressed) - { - GetMTGS().RunOnGSThread([]() { - GSQueueSnapshot(std::string(), 1); + // Sync GS thread. We want to start adding audio at the same time as video. + GetMTGS().WaitGS(false, false, false); + } + }}, + {"GSDumpSingleFrame", TRANSLATE_NOOP("Hotkeys", "Graphics"), TRANSLATE_NOOP("Hotkeys", "Save Single Frame GS Dump"), + [](s32 pressed) { + if (!pressed) + { + GetMTGS().RunOnGSThread([]() { GSQueueSnapshot(std::string(), 1); }); + } + }}, + {"GSDumpMultiFrame", TRANSLATE_NOOP("Hotkeys", "Graphics"), TRANSLATE_NOOP("Hotkeys", "Save Multi Frame GS Dump"), + [](s32 pressed) { + GetMTGS().RunOnGSThread([pressed]() { + if (pressed > 0) + GSQueueSnapshot(std::string(), std::numeric_limits::max()); + else + GSStopGSDump(); }); - } - }}, - {"GSDumpMultiFrame", "Graphics", "Save Multi Frame GS Dump", [](s32 pressed) { - GetMTGS().RunOnGSThread([pressed]() { - if (pressed > 0) - GSQueueSnapshot(std::string(), std::numeric_limits::max()); - else - GSStopGSDump(); - }); - }}, - {"ToggleSoftwareRendering", "Graphics", "Toggle Software Rendering", [](s32 pressed) { - if (!pressed) - GetMTGS().ToggleSoftwareRendering(); - }}, - {"IncreaseUpscaleMultiplier", "Graphics", "Increase Upscale Multiplier", [](s32 pressed) { - if (!pressed) - HotkeyAdjustUpscaleMultiplier(1); - }}, - {"DecreaseUpscaleMultiplier", "Graphics", "Decrease Upscale Multiplier", [](s32 pressed) { - if (!pressed) - HotkeyAdjustUpscaleMultiplier(-1); - }}, - {"CycleAspectRatio", "Graphics", "Cycle Aspect Ratio", [](s32 pressed) { - if (pressed) - return; + }}, + {"ToggleSoftwareRendering", TRANSLATE_NOOP("Hotkeys", "Graphics"), + TRANSLATE_NOOP("Hotkeys", "Toggle Software Rendering"), + [](s32 pressed) { + if (!pressed) + GetMTGS().ToggleSoftwareRendering(); + }}, + {"IncreaseUpscaleMultiplier", TRANSLATE_NOOP("Hotkeys", "Graphics"), + TRANSLATE_NOOP("Hotkeys", "Increase Upscale Multiplier"), + [](s32 pressed) { + if (!pressed) + HotkeyAdjustUpscaleMultiplier(1); + }}, + {"DecreaseUpscaleMultiplier", TRANSLATE_NOOP("Hotkeys", "Graphics"), + TRANSLATE_NOOP("Hotkeys", "Decrease Upscale Multiplier"), + [](s32 pressed) { + if (!pressed) + HotkeyAdjustUpscaleMultiplier(-1); + }}, + {"CycleAspectRatio", TRANSLATE_NOOP("Hotkeys", "Graphics"), TRANSLATE_NOOP("Hotkeys", "Cycle Aspect Ratio"), + [](s32 pressed) { + if (pressed) + return; - // technically this races, but the worst that'll happen is one frame uses the old AR. - EmuConfig.CurrentAspectRatio = static_cast((static_cast(EmuConfig.CurrentAspectRatio) + 1) % static_cast(AspectRatioType::MaxCount)); - Host::AddKeyedFormattedOSDMessage("CycleAspectRatio", Host::OSD_QUICK_DURATION, "Aspect ratio set to '%s'.", Pcsx2Config::GSOptions::AspectRatioNames[static_cast(EmuConfig.CurrentAspectRatio)]); - }}, - {"CycleMipmapMode", "Graphics", "Cycle Hardware Mipmapping", [](s32 pressed) { - if (pressed) - return; + // technically this races, but the worst that'll happen is one frame uses the old AR. + 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 '{}'."), + Pcsx2Config::GSOptions::AspectRatioNames[static_cast(EmuConfig.CurrentAspectRatio)]), + Host::OSD_QUICK_DURATION); + }}, + {"CycleMipmapMode", TRANSLATE_NOOP("Hotkeys", "Graphics"), TRANSLATE_NOOP("Hotkeys", "Cycle Hardware Mipmapping"), + [](s32 pressed) { + if (pressed) + return; - static constexpr s32 CYCLE_COUNT = 4; - static constexpr std::array option_names = {{"Automatic", "Off", "Basic (Generated)", "Full (PS2)"}}; + static constexpr s32 CYCLE_COUNT = 4; + static constexpr std::array option_names = { + {"Automatic", "Off", "Basic (Generated)", "Full (PS2)"}}; - const HWMipmapLevel new_level = static_cast(((static_cast(EmuConfig.GS.HWMipmap) + 2) % CYCLE_COUNT) - 1); - Host::AddKeyedFormattedOSDMessage("CycleMipmapMode", Host::OSD_QUICK_DURATION, "Hardware mipmapping set to '%s'.", option_names[static_cast(new_level) + 1]); - EmuConfig.GS.HWMipmap = new_level; + 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 '{}'."), + option_names[static_cast(new_level) + 1]), + Host::OSD_QUICK_DURATION); + EmuConfig.GS.HWMipmap = new_level; - GetMTGS().RunOnGSThread([new_level]() { - GSConfig.HWMipmap = new_level; - g_gs_renderer->PurgeTextureCache(); - g_gs_renderer->PurgePool(); - }); - }}, - {"CycleInterlaceMode", "Graphics", "Cycle Deinterlace Mode", [](s32 pressed) { - if (pressed) - return; + GetMTGS().RunOnGSThread([new_level]() { + GSConfig.HWMipmap = new_level; + g_gs_renderer->PurgeTextureCache(); + g_gs_renderer->PurgePool(); + }); + }}, + {"CycleInterlaceMode", TRANSLATE_NOOP("Hotkeys", "Graphics"), TRANSLATE_NOOP("Hotkeys", "Cycle Deinterlace Mode"), + [](s32 pressed) { + if (pressed) + return; - static constexpr std::array(GSInterlaceMode::Count)> option_names = {{ - "Automatic", - "Off", - "Weave (Top Field First)", - "Weave (Bottom Field First)", - "Bob (Top Field First)", - "Bob (Bottom Field First)", - "Blend (Top Field First)", - "Blend (Bottom Field First)", - "Adaptive (Top Field First)", - "Adaptive (Bottom Field First)", - }}; + static constexpr std::array(GSInterlaceMode::Count)> option_names = {{ + "Automatic", + "Off", + "Weave (Top Field First)", + "Weave (Bottom Field First)", + "Bob (Top Field First)", + "Bob (Bottom Field First)", + "Blend (Top Field First)", + "Blend (Bottom Field First)", + "Adaptive (Top Field First)", + "Adaptive (Bottom Field First)", + }}; - const GSInterlaceMode new_mode = static_cast((static_cast(EmuConfig.GS.InterlaceMode) + 1) % static_cast(GSInterlaceMode::Count)); - Host::AddKeyedFormattedOSDMessage("CycleInterlaceMode", Host::OSD_QUICK_DURATION, "Deinterlace mode set to '%s'.", option_names[static_cast(new_mode)]); - EmuConfig.GS.InterlaceMode = new_mode; + const GSInterlaceMode new_mode = static_cast( + (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)]), + Host::OSD_QUICK_DURATION); + EmuConfig.GS.InterlaceMode = new_mode; - GetMTGS().RunOnGSThread([new_mode]() { GSConfig.InterlaceMode = new_mode; }); - }}, - {"ToggleTextureDumping", "Graphics", "Toggle Texture Dumping", [](s32 pressed) { - if (!pressed) - { - EmuConfig.GS.DumpReplaceableTextures = !EmuConfig.GS.DumpReplaceableTextures; - Host::AddKeyedOSDMessage("ToggleTextureReplacements", - EmuConfig.GS.DumpReplaceableTextures ? "Texture dumping is now enabled." : "Texture dumping is now disabled.", - Host::OSD_INFO_DURATION); - GetMTGS().ApplySettings(); - } - }}, - {"ToggleTextureReplacements", "Graphics", "Toggle Texture Replacements", [](s32 pressed) { - if (!pressed) - { - EmuConfig.GS.LoadTextureReplacements = !EmuConfig.GS.LoadTextureReplacements; - Host::AddKeyedOSDMessage("ToggleTextureReplacements", - EmuConfig.GS.LoadTextureReplacements ? "Texture replacements are now enabled." : "Texture replacements are now disabled.", - Host::OSD_INFO_DURATION); - GetMTGS().ApplySettings(); - } - }}, - {"ReloadTextureReplacements", "Graphics", "Reload Texture Replacements", [](s32 pressed) { - if (!pressed) - { - if (!EmuConfig.GS.LoadTextureReplacements) - { - Host::AddKeyedOSDMessage("ReloadTextureReplacements", "Texture replacements are not enabled.", Host::OSD_INFO_DURATION); - } - else - { - Host::AddKeyedOSDMessage("ReloadTextureReplacements", "Reloading texture replacements...", Host::OSD_INFO_DURATION); - GetMTGS().RunOnGSThread([]() { - GSTextureReplacements::ReloadReplacementMap(); - }); - } - } - }}, -END_HOTKEY_LIST() + GetMTGS().RunOnGSThread([new_mode]() { GSConfig.InterlaceMode = new_mode; }); + }}, + {"ToggleTextureDumping", TRANSLATE_NOOP("Hotkeys", "Graphics"), TRANSLATE_NOOP("Hotkeys", "Toggle Texture Dumping"), + [](s32 pressed) { + if (!pressed) + { + EmuConfig.GS.DumpReplaceableTextures = !EmuConfig.GS.DumpReplaceableTextures; + Host::AddKeyedOSDMessage("ToggleTextureReplacements", + EmuConfig.GS.DumpReplaceableTextures ? TRANSLATE_STR("Hotkeys", "Texture dumping is now enabled.") : + TRANSLATE_STR("Hotkeys", "Texture dumping is now disabled."), + Host::OSD_INFO_DURATION); + GetMTGS().ApplySettings(); + } + }}, + {"ToggleTextureReplacements", TRANSLATE_NOOP("Hotkeys", "Graphics"), + TRANSLATE_NOOP("Hotkeys", "Toggle Texture Replacements"), + [](s32 pressed) { + if (!pressed) + { + EmuConfig.GS.LoadTextureReplacements = !EmuConfig.GS.LoadTextureReplacements; + Host::AddKeyedOSDMessage("ToggleTextureReplacements", + EmuConfig.GS.LoadTextureReplacements ? + TRANSLATE_STR("Hotkeys", "Texture replacements are now enabled.") : + TRANSLATE_STR("Hotkeys", "Texture replacements are now disabled."), + Host::OSD_INFO_DURATION); + GetMTGS().ApplySettings(); + } + }}, + {"ReloadTextureReplacements", TRANSLATE_NOOP("Hotkeys", "Graphics"), + TRANSLATE_NOOP("Hotkeys", "Reload Texture Replacements"), + [](s32 pressed) { + if (!pressed) + { + if (!EmuConfig.GS.LoadTextureReplacements) + { + Host::AddKeyedOSDMessage("ReloadTextureReplacements", + TRANSLATE_STR("Hotkeys", "Texture replacements are not enabled."), Host::OSD_INFO_DURATION); + } + else + { + Host::AddKeyedOSDMessage("ReloadTextureReplacements", + TRANSLATE_STR("Hotkeys", "Reloading texture replacements..."), Host::OSD_INFO_DURATION); + GetMTGS().RunOnGSThread([]() { GSTextureReplacements::ReloadReplacementMap(); }); + } + } + }}, + END_HOTKEY_LIST() diff --git a/pcsx2/GS/Renderers/Common/GSRenderer.cpp b/pcsx2/GS/Renderers/Common/GSRenderer.cpp index 3c94cb49c6..4927109507 100644 --- a/pcsx2/GS/Renderers/Common/GSRenderer.cpp +++ b/pcsx2/GS/Renderers/Common/GSRenderer.cpp @@ -425,22 +425,30 @@ static void CompressAndWriteScreenshot(std::string filename, u32 width, u32 heig std::string key(fmt::format("GSScreenshot_{}", filename)); - if(!GSDumpReplayer::IsRunner()) - Host::AddIconOSDMessage(key, ICON_FA_CAMERA, fmt::format("Saving screenshot to '{}'.", Path::GetFileName(filename)), 60.0f); + if (!GSDumpReplayer::IsRunner()) + { + Host::AddIconOSDMessage(key, ICON_FA_CAMERA, + fmt::format(TRANSLATE_SV("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. std::unique_lock lock(s_screenshot_threads_mutex); - s_screenshot_threads.emplace_back([key = std::move(key), filename = std::move(filename), image = std::move(image), quality = GSConfig.ScreenshotQuality]() { + s_screenshot_threads.emplace_back([key = std::move(key), filename = std::move(filename), image = std::move(image), + quality = GSConfig.ScreenshotQuality]() { if (image.SaveToFile(filename.c_str(), quality)) { - if(!GSDumpReplayer::IsRunner()) + if (!GSDumpReplayer::IsRunner()) + { Host::AddIconOSDMessage(std::move(key), ICON_FA_CAMERA, - fmt::format("Saved screenshot to '{}'.", Path::GetFileName(filename)), Host::OSD_INFO_DURATION); + fmt::format(TRANSLATE_SV("GS", "Saved screenshot to '{}'."), Path::GetFileName(filename)), + Host::OSD_INFO_DURATION); + } } else { Host::AddIconOSDMessage(std::move(key), ICON_FA_CAMERA, - fmt::format("Failed to save screenshot to '{}'.", Path::GetFileName(filename), Host::OSD_ERROR_DURATION)); + fmt::format(TRANSLATE_SV("GS", "Failed to save screenshot to '{}'."), Path::GetFileName(filename), + Host::OSD_ERROR_DURATION)); } // remove ourselves from the list, if the GS thread is waiting for us, we won't be in there @@ -510,7 +518,7 @@ bool GSRenderer::BeginPresentFrame(bool frame_skip) // First frame after reopening is definitely going to be trash, so skip it. Host::AddIconOSDMessage("GSDeviceLost", ICON_FA_EXCLAMATION_TRIANGLE, - "Host GPU device encountered an error and was recovered. This may have broken rendering.", + TRANSLATE_SV("GS", "Host GPU device encountered an error and was recovered. This may have broken rendering."), Host::OSD_CRITICAL_ERROR_DURATION); return false; } @@ -614,7 +622,9 @@ void GSRenderer::VSync(u32 field, bool registers_written, bool idle_frame) else if (!cas_log_once) { Host::AddIconOSDMessage("CASUnsupported", ICON_FA_EXCLAMATION_TRIANGLE, - "CAS is not available, your graphics driver does not support the required functionality.", 10.0f); + TRANSLATE_SV("GS", + "CAS is not available, your graphics driver does not support the required functionality."), + 10.0f); cas_log_once = true; } } @@ -686,9 +696,11 @@ void GSRenderer::VSync(u32 field, bool registers_written, bool idle_frame) delete[] fd.data; - Host::AddKeyedOSDMessage("GSDump", fmt::format("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); + Host::AddKeyedOSDMessage("GSDump", + fmt::format(TRANSLATE_SV("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); } const bool internal_resolution = (GSConfig.ScreenshotSize >= GSScreenshotSize::InternalResolution); @@ -705,7 +717,8 @@ void GSRenderer::VSync(u32 field, bool registers_written, bool idle_frame) } else { - Host::AddIconOSDMessage("GSScreenshot", ICON_FA_CAMERA, "Failed to render/download screenshot.", Host::OSD_ERROR_DURATION); + Host::AddIconOSDMessage("GSScreenshot", ICON_FA_CAMERA, + TRANSLATE_SV("GS", "Failed to render/download screenshot."), Host::OSD_ERROR_DURATION); } m_snapshot = {}; @@ -715,7 +728,9 @@ void GSRenderer::VSync(u32 field, bool registers_written, bool idle_frame) const bool last = (m_dump_frames == 0); if (m_dump->VSync(field, last, m_regs)) { - Host::AddKeyedOSDMessage("GSDump", fmt::format("Saved GS dump to '{}'.", Path::GetFileName(m_dump->GetPath())), Host::OSD_INFO_DURATION); + Host::AddKeyedOSDMessage("GSDump", + fmt::format(TRANSLATE_SV("GS", "Saved GS dump to '{}'."), Path::GetFileName(m_dump->GetPath())), + Host::OSD_INFO_DURATION); m_dump.reset(); } else if (!last) diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp index 01ab117007..da48363f6a 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -151,8 +151,10 @@ void GSRendererHW::VSync(u32 field, bool registers_written, bool idle_frame) if (g_texture_cache->GetHashCacheMemoryUsage() > 1024 * 1024 * 1024) { - Host::AddKeyedFormattedOSDMessage("HashCacheOverflow", Host::OSD_ERROR_DURATION, "Hash cache has used %.2f MB of VRAM, disabling.", - static_cast(g_texture_cache->GetHashCacheMemoryUsage()) / 1048576.0f); + Host::AddKeyedOSDMessage("HashCacheOverflow", + fmt::format(TRANSLATE_SV("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(); g_gs_device->PurgePool(); GSConfig.TexturePreloading = TexturePreloadingLevel::Partial; diff --git a/pcsx2/GS/Renderers/HW/GSTextureReplacements.cpp b/pcsx2/GS/Renderers/HW/GSTextureReplacements.cpp index 15a3522ed4..7088ffb929 100644 --- a/pcsx2/GS/Renderers/HW/GSTextureReplacements.cpp +++ b/pcsx2/GS/Renderers/HW/GSTextureReplacements.cpp @@ -575,10 +575,11 @@ GSTexture* GSTextureReplacements::CreateReplacementTexture(const ReplacementText static bool log_once = false; if (!log_once) { - static const char* message = - "Disabling autogenerated mipmaps on one or more compressed replacement textures. Please generate mipmaps when compressing your textures."; - Console.Warning(message); - Host::AddIconOSDMessage("DisablingReplacementAutoGeneratedMipmap", ICON_FA_EXCLAMATION_CIRCLE, message, Host::OSD_WARNING_DURATION); + Console.Warning("Disabling autogenerated mipmaps on one or more compressed replacement textures."); + Host::AddIconOSDMessage("DisablingReplacementAutoGeneratedMipmap", ICON_FA_EXCLAMATION_CIRCLE, + TRANSLATE_SV("GS", "Disabling autogenerated mipmaps on one or more compressed replacement textures. " + "Please generate mipmaps when compressing your textures."), + Host::OSD_WARNING_DURATION); log_once = true; } diff --git a/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp b/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp index 2191b5724f..4178062b2e 100644 --- a/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp +++ b/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp @@ -764,7 +764,7 @@ bool GSDeviceVK::CheckFeatures() if (!m_features.texture_barrier && !m_features.stencil_buffer) { Host::AddKeyedOSDMessage("GSDeviceVK_NoTextureBarrierOrStencilBuffer", - "Stencil buffers and texture barriers are both unavailable, this will break some graphical effects.", + TRANSLATE_STR("GS", "Stencil buffers and texture barriers are both unavailable, this will break some graphical effects."), Host::OSD_WARNING_DURATION); } @@ -2939,7 +2939,8 @@ void GSDeviceVK::ExecuteCommandBufferForReadback() { m_warned_slow_spin = true; Host::AddKeyedOSDMessage("GSDeviceVK_NoCalibratedTimestamps", - "Spin GPU During Readbacks is enabled, but calibrated timestamps are unavailable. This might be really slow.", + TRANSLATE_STR("GS", "Spin GPU During Readbacks is enabled, but calibrated timestamps are unavailable. " + "This might be really slow."), Host::OSD_WARNING_DURATION); } } diff --git a/pcsx2/GameDatabase.cpp b/pcsx2/GameDatabase.cpp index 6b940aa2a9..e761dfff4b 100644 --- a/pcsx2/GameDatabase.cpp +++ b/pcsx2/GameDatabase.cpp @@ -868,11 +868,14 @@ u32 GameDatabaseSchema::GameEntry::applyGSHardwareFixes(Pcsx2Config::GSOptions& if (value >= 0 && value <= static_cast(AccBlendLevel::Maximum) && static_cast(EmuConfig.GS.AccurateBlendingUnit) < value) { Host::AddKeyedOSDMessage("HWBlendingWarning", - fmt::format(ICON_FA_PAINT_BRUSH " Current Blending Accuracy is {}.\n" - "Recommended Blending Accuracy for this game is {}.\n" - "You can adjust the blending level in Game Properties to improve\n" - "graphical quality, but this will increase system requirements.", - Pcsx2Config::GSOptions::BlendingLevelNames[static_cast(EmuConfig.GS.AccurateBlendingUnit)], + fmt::format(TRANSLATE_SV("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" + "graphical quality, but this will increase system requirements."), + ICON_FA_PAINT_BRUSH, + Pcsx2Config::GSOptions::BlendingLevelNames[static_cast( + EmuConfig.GS.AccurateBlendingUnit)], Pcsx2Config::GSOptions::BlendingLevelNames[value]), Host::OSD_WARNING_DURATION); } @@ -905,8 +908,9 @@ u32 GameDatabaseSchema::GameEntry::applyGSHardwareFixes(Pcsx2Config::GSOptions& if (!disabled_fixes.empty()) { Host::AddKeyedOSDMessage("HWFixesWarning", - fmt::format(ICON_FA_MAGIC " Manual GS hardware renderer fixes are enabled, automatic fixes were not applied:\n{}", - disabled_fixes), + fmt::format(ICON_FA_MAGIC " {}\n{}", + TRANSLATE_SV("Manual GS hardware renderer fixes are enabled, automatic fixes were not applied:", + disabled_fixes)), Host::OSD_ERROR_DURATION); } else diff --git a/pcsx2/Hotkeys.cpp b/pcsx2/Hotkeys.cpp index 9222a2637a..06a8c9eae7 100644 --- a/pcsx2/Hotkeys.cpp +++ b/pcsx2/Hotkeys.cpp @@ -45,7 +45,9 @@ static void HotkeyAdjustTargetSpeed(double delta) EmuConfig.LimiterMode = LimiterModeType::Unlimited; // force update VMManager::SetLimiterMode(LimiterModeType::Nominal); Host::AddIconOSDMessage("SpeedChanged", ICON_FA_CLOCK, - fmt::format("Target speed set to {:.0f}%.", std::round(EmuConfig.Framerate.NominalScalar * 100.0)), Host::OSD_QUICK_DURATION); + fmt::format(TRANSLATE_SV("Hotkeys", "Target speed set to {:.0f}%."), + std::round(EmuConfig.Framerate.NominalScalar * 100.0)), + Host::OSD_QUICK_DURATION); } static void HotkeyAdjustVolume(s32 fixed, s32 delta) @@ -54,18 +56,19 @@ static void HotkeyAdjustVolume(s32 fixed, s32 delta) return; const s32 current_vol = SPU2::GetOutputVolume(); - const s32 new_volume = std::clamp((fixed >= 0) ? fixed : (current_vol + delta), 0, Pcsx2Config::SPU2Options::MAX_VOLUME); + const s32 new_volume = + std::clamp((fixed >= 0) ? fixed : (current_vol + delta), 0, Pcsx2Config::SPU2Options::MAX_VOLUME); if (current_vol != new_volume) SPU2::SetOutputVolume(new_volume); if (new_volume == 0) { - Host::AddIconOSDMessage("VolumeChanged", ICON_FA_VOLUME_MUTE, "Volume: Muted"); + Host::AddIconOSDMessage("VolumeChanged", ICON_FA_VOLUME_MUTE, TRANSLATE_STR("Hotkeys", "Volume: Muted")); } else { - Host::AddIconOSDMessage( - "VolumeChanged", (current_vol < new_volume) ? ICON_FA_VOLUME_UP : ICON_FA_VOLUME_DOWN, fmt::format("Volume: {}%", new_volume)); + Host::AddIconOSDMessage("VolumeChanged", (current_vol < new_volume) ? ICON_FA_VOLUME_UP : ICON_FA_VOLUME_DOWN, + fmt::format(TRANSLATE_SV("Hotkeys", "Volume: {}%"), new_volume)); } } @@ -99,11 +102,14 @@ static void HotkeyCycleSaveSlot(s32 delta) date_buf[len - 1] = 0; Host::AddIconOSDMessage("CycleSaveSlot", ICON_FA_SEARCH, - fmt::format("Save slot {} selected (last save: {}).", s_current_save_slot, date_buf), Host::OSD_QUICK_DURATION); + fmt::format( + TRANSLATE_SV("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("Save slot {} selected (no save yet).", s_current_save_slot), + Host::AddIconOSDMessage("CycleSaveSlot", ICON_FA_SEARCH, + fmt::format(TRANSLATE_SV("Hotkeys", "Save slot {} selected (no save yet)."), s_current_save_slot), Host::OSD_QUICK_DURATION); } } @@ -114,8 +120,8 @@ static void HotkeyLoadStateSlot(s32 slot) Host::RunOnCPUThread([slot]() { if (!VMManager::HasSaveStateInSlot(VMManager::GetDiscSerial().c_str(), VMManager::GetDiscCRC(), slot)) { - Host::AddIconOSDMessage("LoadStateFromSlot", ICON_FA_EXCLAMATION_TRIANGLE, fmt::format("No save state found in slot {}.", slot), - Host::OSD_INFO_DURATION); + Host::AddIconOSDMessage("LoadStateFromSlot", ICON_FA_EXCLAMATION_TRIANGLE, + fmt::format(TRANSLATE_SV("Hotkeys", "No save state found in slot {}."), slot), Host::OSD_INFO_DURATION); return; } @@ -129,146 +135,171 @@ static void HotkeySaveStateSlot(s32 slot) } BEGIN_HOTKEY_LIST(g_common_hotkeys) -DEFINE_HOTKEY("OpenPauseMenu", "System", "Open Pause Menu", [](s32 pressed) { - if (!pressed && VMManager::HasValidVM()) - FullscreenUI::OpenPauseMenu(); -}) +DEFINE_HOTKEY("OpenPauseMenu", TRANSLATE_NOOP("Hotkeys", "System"), TRANSLATE_NOOP("Hotkeys", "Open Pause Menu"), + [](s32 pressed) { + if (!pressed && VMManager::HasValidVM()) + FullscreenUI::OpenPauseMenu(); + }) #ifdef ENABLE_ACHIEVEMENTS -DEFINE_HOTKEY("OpenAchievementsList", "System", "Open Achievements List", [](s32 pressed) { - if (!pressed) - FullscreenUI::OpenAchievementsWindow(); -}) -DEFINE_HOTKEY("OpenLeaderboardsList", "System", "Open Leaderboards List", [](s32 pressed) { - if (!pressed) - FullscreenUI::OpenLeaderboardsWindow(); -}) +DEFINE_HOTKEY("OpenAchievementsList", TRANSLATE_NOOP("Hotkeys", "System"), + TRANSLATE_NOOP("Hotkeys", "Open Achievements List"), [](s32 pressed) { + if (!pressed) + FullscreenUI::OpenAchievementsWindow(); + }) +DEFINE_HOTKEY("OpenLeaderboardsList", TRANSLATE_NOOP("Hotkeys", "System"), + TRANSLATE_NOOP("Hotkeys", "Open Leaderboards List"), [](s32 pressed) { + if (!pressed) + FullscreenUI::OpenLeaderboardsWindow(); + }) #endif -DEFINE_HOTKEY("TogglePause", "System", "Toggle Pause", [](s32 pressed) { - if (!pressed && VMManager::HasValidVM()) - VMManager::SetPaused(VMManager::GetState() != VMState::Paused); -}) -DEFINE_HOTKEY("ToggleFullscreen", "System", "Toggle Fullscreen", [](s32 pressed) { - if (!pressed) - Host::SetFullscreen(!Host::IsFullscreen()); -}) -DEFINE_HOTKEY("ToggleFrameLimit", "System", "Toggle Frame Limit", [](s32 pressed) { - if (!pressed && VMManager::HasValidVM()) - { - VMManager::SetLimiterMode( - (EmuConfig.LimiterMode != LimiterModeType::Unlimited) ? LimiterModeType::Unlimited : LimiterModeType::Nominal); - } -}) -DEFINE_HOTKEY("ToggleTurbo", "System", "Toggle Turbo / Fast Forward", [](s32 pressed) { - if (!pressed && VMManager::HasValidVM()) - { - VMManager::SetLimiterMode((EmuConfig.LimiterMode != LimiterModeType::Turbo) ? LimiterModeType::Turbo : LimiterModeType::Nominal); - } -}) -DEFINE_HOTKEY("ToggleSlowMotion", "System", "Toggle Slow Motion", [](s32 pressed) { - if (!pressed && VMManager::HasValidVM()) - { - VMManager::SetLimiterMode((EmuConfig.LimiterMode != LimiterModeType::Slomo) ? LimiterModeType::Slomo : LimiterModeType::Nominal); - } -}) -DEFINE_HOTKEY("HoldTurbo", "System", "Turbo / Fast Forward (Hold)", [](s32 pressed) { - if (!VMManager::HasValidVM()) - return; - if (pressed > 0 && !s_limiter_mode_prior_to_hold_interaction.has_value()) - { - s_limiter_mode_prior_to_hold_interaction = VMManager::GetLimiterMode(); - VMManager::SetLimiterMode((s_limiter_mode_prior_to_hold_interaction.value() != LimiterModeType::Turbo) ? LimiterModeType::Turbo : - LimiterModeType::Nominal); - } - else if (pressed >= 0 && s_limiter_mode_prior_to_hold_interaction.has_value()) - { - VMManager::SetLimiterMode(s_limiter_mode_prior_to_hold_interaction.value()); - s_limiter_mode_prior_to_hold_interaction.reset(); - } -}) -DEFINE_HOTKEY("IncreaseSpeed", "System", "Increase Target Speed", [](s32 pressed) { - if (!pressed && VMManager::HasValidVM()) - HotkeyAdjustTargetSpeed(0.1); -}) -DEFINE_HOTKEY("DecreaseSpeed", "System", "Decrease Target Speed", [](s32 pressed) { - if (!pressed && VMManager::HasValidVM()) - HotkeyAdjustTargetSpeed(-0.1); -}) -DEFINE_HOTKEY("IncreaseVolume", "System", "Increase Volume", [](s32 pressed) { - if (!pressed && VMManager::HasValidVM()) - HotkeyAdjustVolume(-1, 5); -}) -DEFINE_HOTKEY("DecreaseVolume", "System", "Decrease Volume", [](s32 pressed) { - if (!pressed && VMManager::HasValidVM()) - HotkeyAdjustVolume(-1, -5); -}) -DEFINE_HOTKEY("Mute", "System", "Toggle Mute", [](s32 pressed) { +DEFINE_HOTKEY( + "TogglePause", TRANSLATE_NOOP("Hotkeys", "System"), TRANSLATE_NOOP("Hotkeys", "Toggle Pause"), [](s32 pressed) { + if (!pressed && VMManager::HasValidVM()) + VMManager::SetPaused(VMManager::GetState() != VMState::Paused); + }) +DEFINE_HOTKEY("ToggleFullscreen", TRANSLATE_NOOP("Hotkeys", "System"), TRANSLATE_NOOP("Hotkeys", "Toggle Fullscreen"), + [](s32 pressed) { + if (!pressed) + Host::SetFullscreen(!Host::IsFullscreen()); + }) +DEFINE_HOTKEY("ToggleFrameLimit", TRANSLATE_NOOP("Hotkeys", "System"), TRANSLATE_NOOP("Hotkeys", "Toggle Frame Limit"), + [](s32 pressed) { + if (!pressed && VMManager::HasValidVM()) + { + VMManager::SetLimiterMode((EmuConfig.LimiterMode != LimiterModeType::Unlimited) ? + LimiterModeType::Unlimited : + LimiterModeType::Nominal); + } + }) +DEFINE_HOTKEY("ToggleTurbo", TRANSLATE_NOOP("Hotkeys", "System"), + TRANSLATE_NOOP("Hotkeys", "Toggle Turbo / Fast Forward"), [](s32 pressed) { + if (!pressed && VMManager::HasValidVM()) + { + VMManager::SetLimiterMode( + (EmuConfig.LimiterMode != LimiterModeType::Turbo) ? LimiterModeType::Turbo : LimiterModeType::Nominal); + } + }) +DEFINE_HOTKEY("ToggleSlowMotion", TRANSLATE_NOOP("Hotkeys", "System"), TRANSLATE_NOOP("Hotkeys", "Toggle Slow Motion"), + [](s32 pressed) { + if (!pressed && VMManager::HasValidVM()) + { + VMManager::SetLimiterMode( + (EmuConfig.LimiterMode != LimiterModeType::Slomo) ? LimiterModeType::Slomo : LimiterModeType::Nominal); + } + }) +DEFINE_HOTKEY("HoldTurbo", TRANSLATE_NOOP("Hotkeys", "System"), + TRANSLATE_NOOP("Hotkeys", "Turbo / Fast Forward (Hold)"), [](s32 pressed) { + if (!VMManager::HasValidVM()) + return; + if (pressed > 0 && !s_limiter_mode_prior_to_hold_interaction.has_value()) + { + s_limiter_mode_prior_to_hold_interaction = VMManager::GetLimiterMode(); + VMManager::SetLimiterMode((s_limiter_mode_prior_to_hold_interaction.value() != LimiterModeType::Turbo) ? + LimiterModeType::Turbo : + LimiterModeType::Nominal); + } + else if (pressed >= 0 && s_limiter_mode_prior_to_hold_interaction.has_value()) + { + VMManager::SetLimiterMode(s_limiter_mode_prior_to_hold_interaction.value()); + s_limiter_mode_prior_to_hold_interaction.reset(); + } + }) +DEFINE_HOTKEY("IncreaseSpeed", TRANSLATE_NOOP("Hotkeys", "System"), TRANSLATE_NOOP("Hotkeys", "Increase Target Speed"), + [](s32 pressed) { + if (!pressed && VMManager::HasValidVM()) + HotkeyAdjustTargetSpeed(0.1); + }) +DEFINE_HOTKEY("DecreaseSpeed", TRANSLATE_NOOP("Hotkeys", "System"), TRANSLATE_NOOP("Hotkeys", "Decrease Target Speed"), + [](s32 pressed) { + if (!pressed && VMManager::HasValidVM()) + HotkeyAdjustTargetSpeed(-0.1); + }) +DEFINE_HOTKEY("IncreaseVolume", TRANSLATE_NOOP("Hotkeys", "System"), TRANSLATE_NOOP("Hotkeys", "Increase Volume"), + [](s32 pressed) { + if (!pressed && VMManager::HasValidVM()) + HotkeyAdjustVolume(-1, 5); + }) +DEFINE_HOTKEY("DecreaseVolume", TRANSLATE_NOOP("Hotkeys", "System"), TRANSLATE_NOOP("Hotkeys", "Decrease Volume"), + [](s32 pressed) { + if (!pressed && VMManager::HasValidVM()) + HotkeyAdjustVolume(-1, -5); + }) +DEFINE_HOTKEY("Mute", TRANSLATE_NOOP("Hotkeys", "System"), TRANSLATE_NOOP("Hotkeys", "Toggle Mute"), [](s32 pressed) { if (!pressed && VMManager::HasValidVM()) HotkeyAdjustVolume((SPU2::GetOutputVolume() == 0) ? EmuConfig.SPU2.FinalVolume : 0, 0); }) -DEFINE_HOTKEY("FrameAdvance", "System", "Frame Advance", [](s32 pressed) { - if (!pressed && VMManager::HasValidVM()) - VMManager::FrameAdvance(1); -}) -DEFINE_HOTKEY("ShutdownVM", "System", "Shut Down Virtual Machine", [](s32 pressed) { - if (!pressed && VMManager::HasValidVM()) - Host::RequestVMShutdown(true, true, EmuConfig.SaveStateOnShutdown); -}) -DEFINE_HOTKEY("ResetVM", "System", "Reset Virtual Machine", [](s32 pressed) { - if (!pressed && VMManager::HasValidVM()) - VMManager::Reset(); -}) -DEFINE_HOTKEY("InputRecToggleMode", "System", "Toggle Input Recording Mode", [](s32 pressed) { - if (!pressed && VMManager::HasValidVM()) - g_InputRecording.getControls().toggleRecordMode(); -}) +DEFINE_HOTKEY( + "FrameAdvance", TRANSLATE_NOOP("Hotkeys", "System"), TRANSLATE_NOOP("Hotkeys", "Frame Advance"), [](s32 pressed) { + if (!pressed && VMManager::HasValidVM()) + VMManager::FrameAdvance(1); + }) +DEFINE_HOTKEY("ShutdownVM", TRANSLATE_NOOP("Hotkeys", "System"), TRANSLATE_NOOP("Hotkeys", "Shut Down Virtual Machine"), + [](s32 pressed) { + if (!pressed && VMManager::HasValidVM()) + Host::RequestVMShutdown(true, true, EmuConfig.SaveStateOnShutdown); + }) +DEFINE_HOTKEY("ResetVM", TRANSLATE_NOOP("Hotkeys", "System"), TRANSLATE_NOOP("Hotkeys", "Reset Virtual Machine"), + [](s32 pressed) { + if (!pressed && VMManager::HasValidVM()) + VMManager::Reset(); + }) +DEFINE_HOTKEY("InputRecToggleMode", TRANSLATE_NOOP("Hotkeys", "System"), + TRANSLATE_NOOP("Hotkeys", "Toggle Input Recording Mode"), [](s32 pressed) { + if (!pressed && VMManager::HasValidVM()) + g_InputRecording.getControls().toggleRecordMode(); + }) -DEFINE_HOTKEY("PreviousSaveStateSlot", "Save States", "Select Previous Save Slot", [](s32 pressed) { - if (!pressed && VMManager::HasValidVM()) - HotkeyCycleSaveSlot(-1); -}) -DEFINE_HOTKEY("NextSaveStateSlot", "Save States", "Select Next Save Slot", [](s32 pressed) { - if (!pressed && VMManager::HasValidVM()) - HotkeyCycleSaveSlot(1); -}) -DEFINE_HOTKEY("SaveStateToSlot", "Save States", "Save State To Selected Slot", [](s32 pressed) { - if (!pressed && VMManager::HasValidVM()) - VMManager::SaveStateToSlot(s_current_save_slot); -}) -DEFINE_HOTKEY("LoadStateFromSlot", "Save States", "Load State From Selected Slot", [](s32 pressed) { - if (!pressed && VMManager::HasValidVM()) - HotkeyLoadStateSlot(s_current_save_slot); -}) +DEFINE_HOTKEY("PreviousSaveStateSlot", TRANSLATE_NOOP("Hotkeys", "Save States"), + TRANSLATE_NOOP("Hotkeys", "Select Previous Save Slot"), [](s32 pressed) { + if (!pressed && VMManager::HasValidVM()) + HotkeyCycleSaveSlot(-1); + }) +DEFINE_HOTKEY("NextSaveStateSlot", TRANSLATE_NOOP("Hotkeys", "Save States"), + TRANSLATE_NOOP("Hotkeys", "Select Next Save Slot"), [](s32 pressed) { + if (!pressed && VMManager::HasValidVM()) + HotkeyCycleSaveSlot(1); + }) +DEFINE_HOTKEY("SaveStateToSlot", TRANSLATE_NOOP("Hotkeys", "Save States"), + TRANSLATE_NOOP("Hotkeys", "Save State To Selected Slot"), [](s32 pressed) { + if (!pressed && VMManager::HasValidVM()) + VMManager::SaveStateToSlot(s_current_save_slot); + }) +DEFINE_HOTKEY("LoadStateFromSlot", TRANSLATE_NOOP("Hotkeys", "Save States"), + TRANSLATE_NOOP("Hotkeys", "Load State From Selected Slot"), [](s32 pressed) { + if (!pressed && VMManager::HasValidVM()) + HotkeyLoadStateSlot(s_current_save_slot); + }) -#define DEFINE_HOTKEY_SAVESTATE_X(slotnum) \ - DEFINE_HOTKEY("SaveStateToSlot" #slotnum, "Save States", "Save State To Slot " #slotnum, [](s32 pressed) { \ +#define DEFINE_HOTKEY_SAVESTATE_X(slotnum, title) \ + DEFINE_HOTKEY("SaveStateToSlot" #slotnum, "Save States", title, [](s32 pressed) { \ if (!pressed) \ HotkeySaveStateSlot(slotnum); \ }) -#define DEFINE_HOTKEY_LOADSTATE_X(slotnum) \ - DEFINE_HOTKEY("LoadStateFromSlot" #slotnum, "Save States", "Load State From Slot " #slotnum, [](s32 pressed) { \ +#define DEFINE_HOTKEY_LOADSTATE_X(slotnum, title) \ + DEFINE_HOTKEY("LoadStateFromSlot" #slotnum, "Save States", title, [](s32 pressed) { \ if (!pressed) \ HotkeyLoadStateSlot(slotnum); \ }) -DEFINE_HOTKEY_SAVESTATE_X(1) -DEFINE_HOTKEY_LOADSTATE_X(1) -DEFINE_HOTKEY_SAVESTATE_X(2) -DEFINE_HOTKEY_LOADSTATE_X(2) -DEFINE_HOTKEY_SAVESTATE_X(3) -DEFINE_HOTKEY_LOADSTATE_X(3) -DEFINE_HOTKEY_SAVESTATE_X(4) -DEFINE_HOTKEY_LOADSTATE_X(4) -DEFINE_HOTKEY_SAVESTATE_X(5) -DEFINE_HOTKEY_LOADSTATE_X(5) -DEFINE_HOTKEY_SAVESTATE_X(6) -DEFINE_HOTKEY_LOADSTATE_X(6) -DEFINE_HOTKEY_SAVESTATE_X(7) -DEFINE_HOTKEY_LOADSTATE_X(7) -DEFINE_HOTKEY_SAVESTATE_X(8) -DEFINE_HOTKEY_LOADSTATE_X(8) -DEFINE_HOTKEY_SAVESTATE_X(9) -DEFINE_HOTKEY_LOADSTATE_X(9) -DEFINE_HOTKEY_SAVESTATE_X(10) -DEFINE_HOTKEY_LOADSTATE_X(10) +DEFINE_HOTKEY_SAVESTATE_X(1, TRANSLATE_NOOP("Hotkeys", "Save State To Slot 1")) +DEFINE_HOTKEY_LOADSTATE_X(1, TRANSLATE_NOOP("Hotkeys", "Load State From Slot 1")) +DEFINE_HOTKEY_SAVESTATE_X(2, TRANSLATE_NOOP("Hotkeys", "Save State To Slot 2")) +DEFINE_HOTKEY_LOADSTATE_X(2, TRANSLATE_NOOP("Hotkeys", "Load State From Slot 2")) +DEFINE_HOTKEY_SAVESTATE_X(3, TRANSLATE_NOOP("Hotkeys", "Save State To Slot 3")) +DEFINE_HOTKEY_LOADSTATE_X(3, TRANSLATE_NOOP("Hotkeys", "Load State From Slot 3")) +DEFINE_HOTKEY_SAVESTATE_X(4, TRANSLATE_NOOP("Hotkeys", "Save State To Slot 4")) +DEFINE_HOTKEY_LOADSTATE_X(4, TRANSLATE_NOOP("Hotkeys", "Load State From Slot 4")) +DEFINE_HOTKEY_SAVESTATE_X(5, TRANSLATE_NOOP("Hotkeys", "Save State To Slot 5")) +DEFINE_HOTKEY_LOADSTATE_X(5, TRANSLATE_NOOP("Hotkeys", "Load State From Slot 5")) +DEFINE_HOTKEY_SAVESTATE_X(6, TRANSLATE_NOOP("Hotkeys", "Save State To Slot 6")) +DEFINE_HOTKEY_LOADSTATE_X(6, TRANSLATE_NOOP("Hotkeys", "Load State From Slot 6")) +DEFINE_HOTKEY_SAVESTATE_X(7, TRANSLATE_NOOP("Hotkeys", "Save State To Slot 7")) +DEFINE_HOTKEY_LOADSTATE_X(7, TRANSLATE_NOOP("Hotkeys", "Load State From Slot 7")) +DEFINE_HOTKEY_SAVESTATE_X(8, TRANSLATE_NOOP("Hotkeys", "Save State To Slot 8")) +DEFINE_HOTKEY_LOADSTATE_X(8, TRANSLATE_NOOP("Hotkeys", "Load State From Slot 8")) +DEFINE_HOTKEY_SAVESTATE_X(9, TRANSLATE_NOOP("Hotkeys", "Save State To Slot 9")) +DEFINE_HOTKEY_LOADSTATE_X(9, TRANSLATE_NOOP("Hotkeys", "Load State From Slot 9")) +DEFINE_HOTKEY_SAVESTATE_X(10, TRANSLATE_NOOP("Hotkeys", "Save State To Slot 10")) +DEFINE_HOTKEY_LOADSTATE_X(10, TRANSLATE_NOOP("Hotkeys", "Load State From Slot 10")) #undef DEFINE_HOTKEY_SAVESTATE_X #undef DEFINE_HOTKEY_LOADSTATE_X END_HOTKEY_LIST() diff --git a/pcsx2/MemoryCardFile.cpp b/pcsx2/MemoryCardFile.cpp index 23a679ec0f..2d3df915a3 100644 --- a/pcsx2/MemoryCardFile.cpp +++ b/pcsx2/MemoryCardFile.cpp @@ -535,7 +535,8 @@ 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("Memory card '{}' was saved to storage.", Path::GetFileName(m_filenames[slot])), + fmt::format(TRANSLATE_SV("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 4fef9220b7..6300787c13 100644 --- a/pcsx2/MemoryCardFolder.cpp +++ b/pcsx2/MemoryCardFolder.cpp @@ -2359,7 +2359,8 @@ 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("Memory card '{}' was saved to storage.", filename), Host::OSD_INFO_DURATION); + fmt::format(TRANSLATE_SV("MemoryCard", "Memory card '{}' was saved to storage."), filename), + Host::OSD_INFO_DURATION); last = std::chrono::system_clock::now(); } diff --git a/pcsx2/PAD/Host/PAD.cpp b/pcsx2/PAD/Host/PAD.cpp index f1e50fc5a7..ef94c620e4 100644 --- a/pcsx2/PAD/Host/PAD.cpp +++ b/pcsx2/PAD/Host/PAD.cpp @@ -351,88 +351,86 @@ void PAD::Update() } static const InputBindingInfo s_dualshock2_binds[] = { - {"Up", "D-Pad Up", InputBindingInfo::Type::Button, PAD_UP, GenericInputBinding::DPadUp}, - {"Right", "D-Pad Right", InputBindingInfo::Type::Button, PAD_RIGHT, GenericInputBinding::DPadRight}, - {"Down", "D-Pad Down", InputBindingInfo::Type::Button, PAD_DOWN, GenericInputBinding::DPadDown}, - {"Left", "D-Pad Left", InputBindingInfo::Type::Button, PAD_LEFT, GenericInputBinding::DPadLeft}, - {"Triangle", "Triangle", InputBindingInfo::Type::Button, PAD_TRIANGLE, GenericInputBinding::Triangle}, - {"Circle", "Circle", InputBindingInfo::Type::Button, PAD_CIRCLE, GenericInputBinding::Circle}, - {"Cross", "Cross", InputBindingInfo::Type::Button, PAD_CROSS, GenericInputBinding::Cross}, - {"Square", "Square", InputBindingInfo::Type::Button, PAD_SQUARE, GenericInputBinding::Square}, - {"Select", "Select", InputBindingInfo::Type::Button, PAD_SELECT, GenericInputBinding::Select}, - {"Start", "Start", InputBindingInfo::Type::Button, PAD_START, GenericInputBinding::Start}, - {"L1", "L1 (Left Bumper)", InputBindingInfo::Type::Button, PAD_L1, GenericInputBinding::L1}, - {"L2", "L2 (Left Trigger)", InputBindingInfo::Type::HalfAxis, PAD_L2, GenericInputBinding::L2}, - {"R1", "R1 (Right Bumper)", InputBindingInfo::Type::Button, PAD_R1, GenericInputBinding::R1}, - {"R2", "R2 (Right Trigger)", InputBindingInfo::Type::HalfAxis, PAD_R2, GenericInputBinding::R2}, - {"L3", "L3 (Left Stick Button)", InputBindingInfo::Type::Button, PAD_L3, GenericInputBinding::L3}, - {"R3", "R3 (Right Stick Button)", InputBindingInfo::Type::Button, PAD_R3, GenericInputBinding::R3}, - {"Analog", "Analog Toggle", InputBindingInfo::Type::Button, PAD_ANALOG, GenericInputBinding::System}, - {"Pressure", "Apply Pressure", InputBindingInfo::Type::Button, PAD_PRESSURE, GenericInputBinding::Unknown}, - {"LUp", "Left Stick Up", InputBindingInfo::Type::HalfAxis, PAD_L_UP, GenericInputBinding::LeftStickUp}, - {"LRight", "Left Stick Right", InputBindingInfo::Type::HalfAxis, PAD_L_RIGHT, GenericInputBinding::LeftStickRight}, - {"LDown", "Left Stick Down", InputBindingInfo::Type::HalfAxis, PAD_L_DOWN, GenericInputBinding::LeftStickDown}, - {"LLeft", "Left Stick Left", InputBindingInfo::Type::HalfAxis, PAD_L_LEFT, GenericInputBinding::LeftStickLeft}, - {"RUp", "Right Stick Up", InputBindingInfo::Type::HalfAxis, PAD_R_UP, GenericInputBinding::RightStickUp}, - {"RRight", "Right Stick Right", InputBindingInfo::Type::HalfAxis, PAD_R_RIGHT, GenericInputBinding::RightStickRight}, - {"RDown", "Right Stick Down", InputBindingInfo::Type::HalfAxis, PAD_R_DOWN, GenericInputBinding::RightStickDown}, - {"RLeft", "Right Stick Left", InputBindingInfo::Type::HalfAxis, PAD_R_LEFT, GenericInputBinding::RightStickLeft}, - {"LargeMotor", "Large (Low Frequency) Motor", InputBindingInfo::Type::Motor, 0, GenericInputBinding::LargeMotor}, - {"SmallMotor", "Small (High Frequency) Motor", InputBindingInfo::Type::Motor, 0, GenericInputBinding::SmallMotor}, + {"Up", TRANSLATE_NOOP("Pad", "D-Pad Up"), InputBindingInfo::Type::Button, PAD_UP, GenericInputBinding::DPadUp}, + {"Right", TRANSLATE_NOOP("Pad", "D-Pad Right"), InputBindingInfo::Type::Button, PAD_RIGHT, GenericInputBinding::DPadRight}, + {"Down", TRANSLATE_NOOP("Pad", "D-Pad Down"), InputBindingInfo::Type::Button, PAD_DOWN, GenericInputBinding::DPadDown}, + {"Left", TRANSLATE_NOOP("Pad", "D-Pad Left"), InputBindingInfo::Type::Button, PAD_LEFT, GenericInputBinding::DPadLeft}, + {"Triangle", TRANSLATE_NOOP("Pad", "Triangle"), InputBindingInfo::Type::Button, PAD_TRIANGLE, GenericInputBinding::Triangle}, + {"Circle", TRANSLATE_NOOP("Pad", "Circle"), InputBindingInfo::Type::Button, PAD_CIRCLE, GenericInputBinding::Circle}, + {"Cross", TRANSLATE_NOOP("Pad", "Cross"), InputBindingInfo::Type::Button, PAD_CROSS, GenericInputBinding::Cross}, + {"Square", TRANSLATE_NOOP("Pad", "Square"), InputBindingInfo::Type::Button, PAD_SQUARE, GenericInputBinding::Square}, + {"Select", TRANSLATE_NOOP("Pad", "Select"), InputBindingInfo::Type::Button, PAD_SELECT, GenericInputBinding::Select}, + {"Start", TRANSLATE_NOOP("Pad", "Start"), InputBindingInfo::Type::Button, PAD_START, GenericInputBinding::Start}, + {"L1", TRANSLATE_NOOP("Pad", "L1 (Left Bumper)"), InputBindingInfo::Type::Button, PAD_L1, GenericInputBinding::L1}, + {"L2", TRANSLATE_NOOP("Pad", "L2 (Left Trigger)"), InputBindingInfo::Type::HalfAxis, PAD_L2, GenericInputBinding::L2}, + {"R1", TRANSLATE_NOOP("Pad", "R1 (Right Bumper)"), InputBindingInfo::Type::Button, PAD_R1, GenericInputBinding::R1}, + {"R2", TRANSLATE_NOOP("Pad", "R2 (Right Trigger)"), InputBindingInfo::Type::HalfAxis, PAD_R2, GenericInputBinding::R2}, + {"L3", TRANSLATE_NOOP("Pad", "L3 (Left Stick Button)"), InputBindingInfo::Type::Button, PAD_L3, GenericInputBinding::L3}, + {"R3", TRANSLATE_NOOP("Pad", "R3 (Right Stick Button)"), InputBindingInfo::Type::Button, PAD_R3, GenericInputBinding::R3}, + {"Analog", TRANSLATE_NOOP("Pad", "Analog Toggle"), InputBindingInfo::Type::Button, PAD_ANALOG, GenericInputBinding::System}, + {"Pressure", TRANSLATE_NOOP("Pad", "Apply Pressure"), InputBindingInfo::Type::Button, PAD_PRESSURE, GenericInputBinding::Unknown}, + {"LUp", TRANSLATE_NOOP("Pad", "Left Stick Up"), InputBindingInfo::Type::HalfAxis, PAD_L_UP, GenericInputBinding::LeftStickUp}, + {"LRight", TRANSLATE_NOOP("Pad", "Left Stick Right"), InputBindingInfo::Type::HalfAxis, PAD_L_RIGHT, GenericInputBinding::LeftStickRight}, + {"LDown", TRANSLATE_NOOP("Pad", "Left Stick Down"), InputBindingInfo::Type::HalfAxis, PAD_L_DOWN, GenericInputBinding::LeftStickDown}, + {"LLeft", TRANSLATE_NOOP("Pad", "Left Stick Left"), InputBindingInfo::Type::HalfAxis, PAD_L_LEFT, GenericInputBinding::LeftStickLeft}, + {"RUp", TRANSLATE_NOOP("Pad", "Right Stick Up"), InputBindingInfo::Type::HalfAxis, PAD_R_UP, GenericInputBinding::RightStickUp}, + {"RRight", TRANSLATE_NOOP("Pad", "Right Stick Right"), InputBindingInfo::Type::HalfAxis, PAD_R_RIGHT, GenericInputBinding::RightStickRight}, + {"RDown", TRANSLATE_NOOP("Pad", "Right Stick Down"), InputBindingInfo::Type::HalfAxis, PAD_R_DOWN, GenericInputBinding::RightStickDown}, + {"RLeft", TRANSLATE_NOOP("Pad", "Right Stick Left"), InputBindingInfo::Type::HalfAxis, PAD_R_LEFT, GenericInputBinding::RightStickLeft}, + {"LargeMotor", TRANSLATE_NOOP("Pad", "Large (Low Frequency) Motor"), InputBindingInfo::Type::Motor, 0, GenericInputBinding::LargeMotor}, + {"SmallMotor", TRANSLATE_NOOP("Pad", "Small (High Frequency) Motor"), InputBindingInfo::Type::Motor, 0, GenericInputBinding::SmallMotor}, }; static const char* s_dualshock2_invert_entries[] = { - "Not Inverted", - "Invert Left/Right", - "Invert Up/Down", - "Invert Left/Right + Up/Down", + TRANSLATE_NOOP("Pad", "Not Inverted"), + TRANSLATE_NOOP("Pad", "Invert Left/Right"), + TRANSLATE_NOOP("Pad", "Invert Up/Down"), + TRANSLATE_NOOP("Pad", "Invert Left/Right + Up/Down"), nullptr}; static const SettingInfo s_dualshock2_settings[] = { - {SettingInfo::Type::IntegerList, "InvertL", "Invert Left Stick", - "Inverts the direction of the left analog stick.", - "0", "0", "3", nullptr, nullptr, s_dualshock2_invert_entries, nullptr, 0.0f}, - {SettingInfo::Type::IntegerList, "InvertR", "Invert Right Stick", - "Inverts the direction of the right analog stick.", - "0", "0", "3", nullptr, nullptr, s_dualshock2_invert_entries, nullptr, 0.0f}, - {SettingInfo::Type::Float, "Deadzone", "Analog Deadzone", - "Sets the analog stick deadzone, i.e. the fraction of the analog stick movement which will be ignored.", + {SettingInfo::Type::IntegerList, "InvertL", TRANSLATE_NOOP("Pad", "Invert Left Stick"), + TRANSLATE_NOOP("Pad", "Inverts the direction of the left analog stick."), "0", "0", "3", nullptr, nullptr, + s_dualshock2_invert_entries, nullptr, 0.0f}, + {SettingInfo::Type::IntegerList, "InvertR", TRANSLATE_NOOP("Pad", "Invert Right Stick"), + TRANSLATE_NOOP("Pad", "Inverts the direction of the right analog stick."), "0", "0", "3", nullptr, nullptr, + s_dualshock2_invert_entries, nullptr, 0.0f}, + {SettingInfo::Type::Float, "Deadzone", TRANSLATE_NOOP("Pad", "Analog Deadzone"), + TRANSLATE_NOOP("Pad", + "Sets the analog stick deadzone, i.e. the fraction of the analog stick movement which will be ignored."), "0.00", "0.00", "1.00", "0.01", "%.0f%%", nullptr, nullptr, 100.0f}, - {SettingInfo::Type::Float, "AxisScale", "Analog Sensitivity", - "Sets the analog stick axis scaling factor. A value between 130% and 140% is recommended when using recent " - "controllers, e.g. DualShock 4, Xbox One Controller.", + {SettingInfo::Type::Float, "AxisScale", TRANSLATE_NOOP("Pad", "Analog Sensitivity"), + TRANSLATE_NOOP("Pad", + "Sets the analog stick axis scaling factor. A value between 130% and 140% is recommended when using recent " + "controllers, e.g. DualShock 4, Xbox One Controller."), "1.33", "0.01", "2.00", "0.01", "%.0f%%", nullptr, nullptr, 100.0f}, - {SettingInfo::Type::Float, "TriggerDeadzone", "Trigger Deadzone", - "Sets the deadzone for activating triggers, i.e. the fraction of the trigger press which will be ignored.", + {SettingInfo::Type::Float, "TriggerDeadzone", TRANSLATE_NOOP("Pad", "Trigger Deadzone"), + TRANSLATE_NOOP("Pad", + "Sets the deadzone for activating triggers, i.e. the fraction of the trigger press which will be ignored."), "0.00", "0.00", "1.00", "0.01", "%.0f%%", nullptr, nullptr, 100.0f}, - {SettingInfo::Type::Float, "TriggerScale", "Trigger Sensitivity", - "Sets the trigger scaling factor.", - "1.00", "0.01", "2.00", "0.01", "%.0f%%", nullptr, nullptr, 100.0f}, - {SettingInfo::Type::Float, "LargeMotorScale", "Large Motor Vibration Scale", - "Increases or decreases the intensity of low frequency vibration sent by the game.", + {SettingInfo::Type::Float, "TriggerScale", TRANSLATE_NOOP("Pad", "Trigger Sensitivity"), + TRANSLATE_NOOP("Pad", "Sets the trigger scaling factor."), "1.00", "0.01", "2.00", "0.01", "%.0f%%", nullptr, + nullptr, 100.0f}, + {SettingInfo::Type::Float, "LargeMotorScale", TRANSLATE_NOOP("Pad", "Large Motor Vibration Scale"), + TRANSLATE_NOOP("Pad", "Increases or decreases the intensity of low frequency vibration sent by the game."), "1.00", "0.00", "2.00", "0.01", "%.0f%%", nullptr, nullptr, 100.0f}, - {SettingInfo::Type::Float, "SmallMotorScale", "Small Motor Vibration Scale", - "Increases or decreases the intensity of high frequency vibration sent by the game.", + {SettingInfo::Type::Float, "SmallMotorScale", TRANSLATE_NOOP("Pad", "Small Motor Vibration Scale"), + TRANSLATE_NOOP("Pad", "Increases or decreases the intensity of high frequency vibration sent by the game."), "1.00", "0.00", "2.00", "0.01", "%.0f%%", nullptr, nullptr, 100.0f}, - {SettingInfo::Type::Float, "ButtonDeadzone", "Button Deadzone", - "Sets the deadzone for activating buttons, i.e. the fraction of the button press which will be ignored.", + {SettingInfo::Type::Float, "ButtonDeadzone", TRANSLATE_NOOP("Pad", "Button Deadzone"), + TRANSLATE_NOOP("Pad", + "Sets the deadzone for activating buttons, i.e. the fraction of the button press which will be ignored."), "0.00", "0.00", "1.00", "0.01", "%.0f%%", nullptr, nullptr, 100.0f}, - /*{SettingInfo::Type::Float, "InitialPressure", "Initial Pressure", - "Sets the pressure when the modifier button isn't held.", - "1.00", "0.01", "1.00", "0.01", "%.0f%%", nullptr, nullptr, 100.0f},*/ - {SettingInfo::Type::Float, "PressureModifier", "Modifier Pressure", - "Sets the pressure when the modifier button is held.", - "0.50", "0.01", "1.00", "0.01", "%.0f%%", nullptr, nullptr, 100.0f}, + {SettingInfo::Type::Float, "PressureModifier", TRANSLATE_NOOP("Pad", "Modifier Pressure"), + TRANSLATE_NOOP("Pad", "Sets the pressure when the modifier button is held."), "0.50", "0.01", "1.00", "0.01", + "%.0f%%", nullptr, nullptr, 100.0f}, }; static const PAD::ControllerInfo s_controller_info[] = { - {PAD::ControllerType::NotConnected, "None", "Not Connected", - nullptr, 0, - nullptr, 0, + {PAD::ControllerType::NotConnected, "None", TRANSLATE_NOOP("Pad", "Not Connected"), nullptr, 0, nullptr, 0, PAD::VibrationCapabilities::NoVibration}, - {PAD::ControllerType::DualShock2, "DualShock2", "DualShock 2", - s_dualshock2_binds, std::size(s_dualshock2_binds), - s_dualshock2_settings, std::size(s_dualshock2_settings), + {PAD::ControllerType::DualShock2, "DualShock2", TRANSLATE_NOOP("Pad", "DualShock 2"), s_dualshock2_binds, + std::size(s_dualshock2_binds), s_dualshock2_settings, std::size(s_dualshock2_settings), PAD::VibrationCapabilities::LargeSmallMotors}, }; diff --git a/pcsx2/Patch.cpp b/pcsx2/Patch.cpp index 7d25e474cd..4e3002950e 100644 --- a/pcsx2/Patch.cpp +++ b/pcsx2/Patch.cpp @@ -297,7 +297,8 @@ bool Patch::OpenPatchesZip() if (!warning_shown) { Host::AddIconOSDMessage("PatchesZipOpenWarning", ICON_FA_MICROCHIP, - fmt::format("Failed to open {}. Built-in game patches are not available.", PATCHES_ZIP_NAME), + fmt::format(TRANSLATE_SV("Patch", "Failed to open {}. Built-in game patches are not available."), + PATCHES_ZIP_NAME), Host::OSD_ERROR_DURATION); warning_shown = true; } @@ -519,7 +520,8 @@ u32 Patch::EnablePatches(const PatchList& patches, const EnablePatchList& enable return count; } -void Patch::ReloadPatches(const std::string& serial, u32 crc, bool reload_files, bool reload_enabled_list, bool verbose, bool verbose_if_changed) +void Patch::ReloadPatches(const std::string& serial, u32 crc, bool reload_files, bool reload_enabled_list, bool verbose, + bool verbose_if_changed) { reload_files |= (s_patches_crc != crc); s_patches_crc = crc; @@ -578,16 +580,22 @@ 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), "{} GameDB patches", gp_count); + fmt::format_to(std::back_inserter(message), TRANSLATE_SV("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), "{}{} game patches", message.empty() ? "" : ", ", p_count); + { + fmt::format_to(std::back_inserter(message), TRANSLATE_SV("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), "{}{} cheat patches", message.empty() ? "" : ", ", c_count); + { + fmt::format_to(std::back_inserter(message), TRANSLATE_SV("Patch", "{}{} cheat patches"), + message.empty() ? "" : ", ", c_count); + } // Display message on first boot when we load patches. // Except when it's just GameDB. @@ -596,13 +604,14 @@ void Patch::UpdateActivePatches(bool reload_enabled_list, bool verbose, bool ver { if (!message.empty()) { - fmt::format_to(std::back_inserter(message), " are active."); - Host::AddIconOSDMessage("LoadPatches", ICON_FA_FILE_CODE, std::move(message), Host::OSD_INFO_DURATION); + Host::AddIconOSDMessage("LoadPatches", ICON_FA_FILE_CODE, + fmt::format(TRANSLATE_SV("{} are active.", message)), Host::OSD_INFO_DURATION); } else { Host::AddIconOSDMessage("LoadPatches", ICON_FA_FILE_CODE, - "No cheats or patches (widescreen, compatibility or others) are found / enabled.", + TRANSLATE_STR( + "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 8e946ba2f6..e7f6a2a536 100644 --- a/pcsx2/SPU2/SndOut_Cubeb.cpp +++ b/pcsx2/SPU2/SndOut_Cubeb.cpp @@ -292,7 +292,9 @@ public: if (!selected_device) { Host::AddIconOSDMessage("CubebDeviceNotFound", ICON_FA_VOLUME_MUTE, - fmt::format("Requested audio output device '{}' not found, using default.", selected_device_name), + fmt::format( + TRANSLATE_SV("SPU2", "Requested audio output device '{}' not found, using default."), + selected_device_name), Host::OSD_WARNING_DURATION); } } diff --git a/pcsx2/Sio.cpp b/pcsx2/Sio.cpp index 44cecc9be6..1bfdba6fa8 100644 --- a/pcsx2/Sio.cpp +++ b/pcsx2/Sio.cpp @@ -208,12 +208,10 @@ void Sio0::SetTxData(u8 value) if (mcd->autoEjectTicks == 0) { - Host::AddKeyedFormattedOSDMessage( - StringUtil::StdStringFromFormat("AutoEjectSlotClear%u%u", port, slot), - 10.0f, - "Memory card in port %d / slot %d reinserted", - port + 1, - slot + 1); + Host::AddKeyedOSDMessage(fmt::format("AutoEjectSlotClear{}{}", port, slot), + fmt::format(TRANSLATE_SV("MemoryCard", "Memory card in port %d / slot %d reinserted"), + port + 1, slot + 1), + Host::OSD_INFO_DURATION); } return; @@ -591,12 +589,10 @@ void Sio2::Memcard() if (mcd->autoEjectTicks == 0) { - Host::AddKeyedFormattedOSDMessage( - StringUtil::StdStringFromFormat("AutoEjectSlotClear%u%u", port, slot), - 10.0f, - "Memory card in port %d / slot %d reinserted", - port + 1, - slot + 1); + Host::AddKeyedOSDMessage(fmt::format("AutoEjectSlotClear{}{}", port, slot), + fmt::format( + TRANSLATE_SV("MemoryCard", "Memory card in port {} / slot {} reinserted."), port + 1, slot + 1), + Host::OSD_INFO_DURATION); } return; @@ -934,7 +930,8 @@ void AutoEject::Clear(size_t port, size_t slot) void AutoEject::SetAll() { - Host::AddIconOSDMessage("AutoEjectAllSet", ICON_FA_SD_CARD, "Force ejecting all memory cards.", Host::OSD_INFO_DURATION); + Host::AddIconOSDMessage("AutoEjectAllSet", ICON_FA_SD_CARD, + TRANSLATE_SV("MemoryCard", "Force ejecting all memory cards."), Host::OSD_INFO_DURATION); for (size_t port = 0; port < SIO::PORTS; port++) { diff --git a/pcsx2/USB/USB.cpp b/pcsx2/USB/USB.cpp index e4bef77b5b..2a162dfc53 100644 --- a/pcsx2/USB/USB.cpp +++ b/pcsx2/USB/USB.cpp @@ -550,7 +550,7 @@ const char* USB::DeviceTypeIndexToName(s32 device) { RegisterDevice& rd = RegisterDevice::instance(); const DeviceProxy* proxy = (device != DEVTYPE_NONE) ? rd.Device(device) : nullptr; - return proxy ? proxy->TypeName() : "None"; + return proxy ? proxy->TypeName() : TRANSLATE("USB", "None"); } std::vector> USB::GetDeviceTypes() @@ -558,7 +558,7 @@ std::vector> USB::GetDeviceTypes() RegisterDevice& rd = RegisterDevice::instance(); std::vector> ret; ret.reserve(rd.Map().size() + 1); - ret.emplace_back("None", "Not Connected"); + ret.emplace_back("None", TRANSLATE("USB", "Not Connected")); for (const auto& it : rd.Map()) ret.emplace_back(it.second->TypeName(), it.second->Name()); return ret; @@ -567,7 +567,7 @@ std::vector> USB::GetDeviceTypes() const char* USB::GetDeviceName(const std::string_view& device) { const DeviceProxy* dev = RegisterDevice::instance().Device(device); - return dev ? dev->Name() : "Not Connected"; + return dev ? dev->Name() : TRANSLATE("USB", "Not Connected"); } const char* USB::GetDeviceSubtypeName(const std::string_view& device, u32 subtype) diff --git a/pcsx2/USB/usb-eyetoy/usb-eyetoy-webcam.cpp b/pcsx2/USB/usb-eyetoy/usb-eyetoy-webcam.cpp index 1435877f38..480bdd9942 100644 --- a/pcsx2/USB/usb-eyetoy/usb-eyetoy-webcam.cpp +++ b/pcsx2/USB/usb-eyetoy/usb-eyetoy-webcam.cpp @@ -1,5 +1,5 @@ /* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2020 PCSX2 Dev Team + * Copyright (C) 2002-2023 PCSX2 Dev Team * * PCSX2 is free software: you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Found- @@ -14,6 +14,7 @@ */ #include "PrecompiledHeader.h" +#include "Host.h" #include "videodev.h" #include "usb-eyetoy-webcam.h" #include "ov519.h" @@ -485,7 +486,7 @@ namespace usb_eyetoy const char* EyeToyWebCamDevice::Name() const { - return "Webcam (EyeToy)"; + return TRANSLATE_NOOP("USB", "Webcam (EyeToy)"); } const char* EyeToyWebCamDevice::TypeName() const @@ -515,15 +516,17 @@ namespace usb_eyetoy gsl::span EyeToyWebCamDevice::SubTypes() const { - static const char* subtypes[] = {"Sony EyeToy", "Konami Capture Eye"}; + static const char* subtypes[] = { + TRANSLATE_NOOP("USB", "Sony EyeToy"), TRANSLATE_NOOP("USB", "Konami Capture Eye")}; return subtypes; } gsl::span EyeToyWebCamDevice::Settings(u32 subtype) const { static constexpr const SettingInfo info[] = { - {SettingInfo::Type::StringList, "device_name", "Device Name", "Selects the device to capture images from.", "", nullptr, - nullptr, nullptr, nullptr, nullptr, &VideoDevice::GetDeviceList}, + {SettingInfo::Type::StringList, "device_name", TRANSLATE_NOOP("USB", "Device Name"), + TRANSLATE_NOOP("USB", "Selects the device to capture images from."), "", nullptr, nullptr, nullptr, + nullptr, nullptr, &VideoDevice::GetDeviceList}, }; return info; } diff --git a/pcsx2/USB/usb-hid/usb-hid.cpp b/pcsx2/USB/usb-hid/usb-hid.cpp index 6bae8467ec..7d29fde079 100644 --- a/pcsx2/USB/usb-hid/usb-hid.cpp +++ b/pcsx2/USB/usb-hid/usb-hid.cpp @@ -25,6 +25,7 @@ #include "PrecompiledHeader.h" +#include "Host.h" #include "Input/InputManager.h" #include "StateWrapper.h" #include "USB/USB.h" @@ -939,7 +940,7 @@ namespace usb_hid const char* HIDKbdDevice::Name() const { - return "HID Keyboard"; + return TRANSLATE_NOOP("USB", "HID Keyboard"); } const char* HIDKbdDevice::TypeName() const @@ -950,7 +951,7 @@ namespace usb_hid gsl::span HIDKbdDevice::Bindings(u32 subtype) const { static constexpr const InputBindingInfo info[] = { - {"Keyboard", "Keyboard", InputBindingInfo::Type::Keyboard, 0, GenericInputBinding::Unknown}, + {"Keyboard", TRANSLATE_NOOP("USB", "Keyboard"), InputBindingInfo::Type::Keyboard, 0, GenericInputBinding::Unknown}, }; return info; } @@ -1013,7 +1014,7 @@ namespace usb_hid const char* HIDMouseDevice::Name() const { - return "HID Mouse"; + return TRANSLATE_NOOP("USB", "HID Mouse"); } const char* HIDMouseDevice::TypeName() const @@ -1043,10 +1044,10 @@ namespace usb_hid gsl::span HIDMouseDevice::Bindings(u32 subtype) const { static constexpr const InputBindingInfo info[] = { - {"Pointer", "Pointer", InputBindingInfo::Type::Pointer, INPUT_BUTTON__MAX, GenericInputBinding::Unknown}, - {"LeftButton", "Left Button", InputBindingInfo::Type::Button, INPUT_BUTTON_LEFT, GenericInputBinding::Unknown}, - {"RightButton", "Right Button", InputBindingInfo::Type::Button, INPUT_BUTTON_RIGHT, GenericInputBinding::Unknown}, - {"MiddleButton", "Middle Button", InputBindingInfo::Type::Button, INPUT_BUTTON_MIDDLE, GenericInputBinding::Unknown}, + {"Pointer", TRANSLATE_NOOP("USB", "Pointer"), InputBindingInfo::Type::Pointer, INPUT_BUTTON__MAX, GenericInputBinding::Unknown}, + {"LeftButton", TRANSLATE_NOOP("USB", "Left Button"), InputBindingInfo::Type::Button, INPUT_BUTTON_LEFT, GenericInputBinding::Unknown}, + {"RightButton", TRANSLATE_NOOP("USB", "Right Button"), InputBindingInfo::Type::Button, INPUT_BUTTON_RIGHT, GenericInputBinding::Unknown}, + {"MiddleButton", TRANSLATE_NOOP("USB", "Middle Button"), InputBindingInfo::Type::Button, INPUT_BUTTON_MIDDLE, GenericInputBinding::Unknown}, }; return info; } @@ -1124,7 +1125,7 @@ namespace usb_hid const char* BeatManiaDevice::Name() const { - return "BeatMania Da Da Da!! Keyboard"; + return TRANSLATE_NOOP("USB", "BeatMania Da Da Da!! Keyboard"); } const char* BeatManiaDevice::TypeName() const diff --git a/pcsx2/USB/usb-lightgun/guncon2.cpp b/pcsx2/USB/usb-lightgun/guncon2.cpp index c32328048a..3666084b57 100644 --- a/pcsx2/USB/usb-lightgun/guncon2.cpp +++ b/pcsx2/USB/usb-lightgun/guncon2.cpp @@ -1,5 +1,5 @@ /* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2022 PCSX2 Dev Team + * Copyright (C) 2002-2023 PCSX2 Dev Team * * PCSX2 is free software: you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Found- @@ -16,6 +16,7 @@ #include "PrecompiledHeader.h" #include "GS/GS.h" +#include "Host.h" #include "Input/InputManager.h" #include "StateWrapper.h" #include "USB/USB.h" @@ -404,7 +405,7 @@ namespace usb_lightgun const char* GunCon2Device::Name() const { - return "GunCon 2"; + return TRANSLATE_NOOP("USB", "GunCon 2"); } const char* GunCon2Device::TypeName() const @@ -481,21 +482,21 @@ namespace usb_lightgun { static constexpr const InputBindingInfo bindings[] = { //{"pointer", "Pointer/Aiming", InputBindingInfo::Type::Pointer, BID_POINTER_X, GenericInputBinding::Unknown}, - {"Up", "D-Pad Up", InputBindingInfo::Type::Button, BID_DPAD_UP, GenericInputBinding::DPadUp}, - {"Down", "D-Pad Down", InputBindingInfo::Type::Button, BID_DPAD_DOWN, GenericInputBinding::DPadDown}, - {"Left", "D-Pad Left", InputBindingInfo::Type::Button, BID_DPAD_LEFT, GenericInputBinding::DPadLeft}, - {"Right", "D-Pad Right", InputBindingInfo::Type::Button, BID_DPAD_RIGHT, + {"Up", TRANSLATE_NOOP("USB", "D-Pad Up"), InputBindingInfo::Type::Button, BID_DPAD_UP, GenericInputBinding::DPadUp}, + {"Down", TRANSLATE_NOOP("USB", "D-Pad Down"), InputBindingInfo::Type::Button, BID_DPAD_DOWN, GenericInputBinding::DPadDown}, + {"Left", TRANSLATE_NOOP("USB", "D-Pad Left"), InputBindingInfo::Type::Button, BID_DPAD_LEFT, GenericInputBinding::DPadLeft}, + {"Right", TRANSLATE_NOOP("USB", "D-Pad Right"), InputBindingInfo::Type::Button, BID_DPAD_RIGHT, GenericInputBinding::DPadRight}, - {"Trigger", "Trigger", InputBindingInfo::Type::Button, BID_TRIGGER, GenericInputBinding::R2}, - {"ShootOffscreen", "Shoot Offscreen", InputBindingInfo::Type::Button, BID_SHOOT_OFFSCREEN, + {"Trigger", TRANSLATE_NOOP("USB", "Trigger"), InputBindingInfo::Type::Button, BID_TRIGGER, GenericInputBinding::R2}, + {"ShootOffscreen", TRANSLATE_NOOP("USB", "Shoot Offscreen"), InputBindingInfo::Type::Button, BID_SHOOT_OFFSCREEN, GenericInputBinding::R1}, - {"Recalibrate", "Calibration Shot", InputBindingInfo::Type::Button, BID_RECALIBRATE, + {"Recalibrate", TRANSLATE_NOOP("USB", "Calibration Shot"), InputBindingInfo::Type::Button, BID_RECALIBRATE, GenericInputBinding::Unknown}, - {"A", "A", InputBindingInfo::Type::Button, BID_A, GenericInputBinding::Cross}, - {"B", "B", InputBindingInfo::Type::Button, BID_B, GenericInputBinding::Circle}, - {"C", "C", InputBindingInfo::Type::Button, BID_C, GenericInputBinding::Triangle}, - {"Select", "Select", InputBindingInfo::Type::Button, BID_SELECT, GenericInputBinding::Select}, - {"Start", "Start", InputBindingInfo::Type::Button, BID_START, GenericInputBinding::Start}, + {"A", TRANSLATE_NOOP("USB", "A"), InputBindingInfo::Type::Button, BID_A, GenericInputBinding::Cross}, + {"B", TRANSLATE_NOOP("USB", "B"), InputBindingInfo::Type::Button, BID_B, GenericInputBinding::Circle}, + {"C", TRANSLATE_NOOP("USB", "C"), InputBindingInfo::Type::Button, BID_C, GenericInputBinding::Triangle}, + {"Select", TRANSLATE_NOOP("USB", "Select"), InputBindingInfo::Type::Button, BID_SELECT, GenericInputBinding::Select}, + {"Start", TRANSLATE_NOOP("USB", "Start"), InputBindingInfo::Type::Button, BID_START, GenericInputBinding::Start}, }; return bindings; @@ -504,23 +505,28 @@ namespace usb_lightgun gsl::span GunCon2Device::Settings(u32 subtype) const { static constexpr const SettingInfo info[] = { - {SettingInfo::Type::Boolean, "custom_config", "Manual Screen Configuration", - "Forces the use of the screen parameters below, instead of automatic parameters if available.", + {SettingInfo::Type::Boolean, "custom_config", TRANSLATE_NOOP("USB", "Manual Screen Configuration"), + TRANSLATE_NOOP("USB", + "Forces the use of the screen parameters below, instead of automatic parameters if available."), "false"}, - {SettingInfo::Type::Float, "scale_x", "X Scale (Sensitivity)", + {SettingInfo::Type::Float, "scale_x", TRANSLATE_NOOP("USB", "X Scale (Sensitivity)"), "Scales the position to simulate CRT curvature.", "100", "0", "200", "0.1", "%.2f%%", nullptr, nullptr, 1.0f}, - {SettingInfo::Type::Float, "scale_y", "Y Scale (Sensitivity)", + {SettingInfo::Type::Float, "scale_y", TRANSLATE_NOOP("USB", "Y Scale (Sensitivity)"), "Scales the position to simulate CRT curvature.", "100", "0", "200", "0.1", "%.2f%%", nullptr, nullptr, 1.0f}, - {SettingInfo::Type::Float, "center_x", "Center X", "Sets the horizontal center position of the simulated screen.", - "320", "0", "1024", "1", "%.0fpx", nullptr, nullptr, 1.0f}, - {SettingInfo::Type::Float, "center_y", "Center Y", "Sets the vertical center position of the simulated screen.", - "120", "0", "1024", "1", "%.0fpx", nullptr, nullptr, 1.0f}, - {SettingInfo::Type::Integer, "screen_width", "Screen Width", "Sets the width of the simulated screen.", - "640", "1", "1024", "1", "%dpx", nullptr, nullptr, 1.0f}, - {SettingInfo::Type::Integer, "screen_height", "Screen Height", "Sets the height of the simulated screen.", - "240", "1", "1024", "1", "%dpx", nullptr, nullptr, 1.0f}, + {SettingInfo::Type::Float, "center_x", TRANSLATE_NOOP("USB", "Center X"), + TRANSLATE_NOOP("USB", "Sets the horizontal center position of the simulated screen."), "320", "0", + "1024", "1", "%.0fpx", nullptr, nullptr, 1.0f}, + {SettingInfo::Type::Float, "center_y", TRANSLATE_NOOP("USB", "Center Y"), + TRANSLATE_NOOP("USB", "Sets the vertical center position of the simulated screen."), "120", "0", "1024", + "1", "%.0fpx", nullptr, nullptr, 1.0f}, + {SettingInfo::Type::Integer, "screen_width", TRANSLATE_NOOP("USB", "Screen Width"), + TRANSLATE_NOOP("USB", "Sets the width of the simulated screen."), "640", "1", "1024", "1", "%dpx", + nullptr, nullptr, 1.0f}, + {SettingInfo::Type::Integer, "screen_height", TRANSLATE_NOOP("USB", "Screen Height"), + TRANSLATE_NOOP("USB", "Sets the height of the simulated screen."), "240", "1", "1024", "1", "%dpx", + nullptr, nullptr, 1.0f}, }; return info; } diff --git a/pcsx2/USB/usb-mic/usb-headset.cpp b/pcsx2/USB/usb-mic/usb-headset.cpp index bafc910ce3..af9e2efd5c 100644 --- a/pcsx2/USB/usb-mic/usb-headset.cpp +++ b/pcsx2/USB/usb-mic/usb-headset.cpp @@ -25,6 +25,7 @@ // Most stuff is based on Qemu 1.7 USB soundcard passthrough code. #include "PrecompiledHeader.h" +#include "Host.h" #include "USB/qemu-usb/qusb.h" #include "USB/qemu-usb/desc.h" #include "USB/qemu-usb/USBinternal.h" @@ -957,7 +958,7 @@ namespace usb_mic const char* HeadsetDevice::Name() const { - return "Logitech USB Headset"; + return TRANSLATE_NOOP("USB", "Logitech USB Headset"); } bool HeadsetDevice::Freeze(USBDevice* dev, StateWrapper& sw) const @@ -996,14 +997,18 @@ namespace usb_mic gsl::span HeadsetDevice::Settings(u32 subtype) const { static constexpr const SettingInfo info[] = { - {SettingInfo::Type::StringList, "input_device_name", "Input Device", "Selects the device to read audio from.", "", nullptr, - nullptr, nullptr, nullptr, nullptr, &AudioDevice::GetInputDeviceList}, - {SettingInfo::Type::StringList, "output_device_name", "Output Device", "Selects the device to output audio to.", "", nullptr, - nullptr, nullptr, nullptr, nullptr, &AudioDevice::GetOutputDeviceList}, - {SettingInfo::Type::Integer, "input_latency", "Input Latency", "Specifies the latency to the host input device.", AudioDevice::DEFAULT_LATENCY_STR, "1", - "1000", "1", "%dms", nullptr, nullptr, 1.0f}, - {SettingInfo::Type::Integer, "output_latency", "Output Latency", "Specifies the latency to the host output device.", AudioDevice::DEFAULT_LATENCY_STR, "1", - "1000", "1", "%dms", nullptr, nullptr, 1.0f}, + {SettingInfo::Type::StringList, "input_device_name", TRANSLATE_NOOP("USB", "Input Device"), + TRANSLATE_NOOP("USB", "Selects the device to read audio from."), "", nullptr, nullptr, nullptr, nullptr, + nullptr, &AudioDevice::GetInputDeviceList}, + {SettingInfo::Type::StringList, "output_device_name", TRANSLATE_NOOP("USB", "Output Device"), + TRANSLATE_NOOP("USB", "Selects the device to output audio to."), "", nullptr, nullptr, nullptr, nullptr, + nullptr, &AudioDevice::GetOutputDeviceList}, + {SettingInfo::Type::Integer, "input_latency", TRANSLATE_NOOP("USB", "Input Latency"), + TRANSLATE_NOOP("USB", "Specifies the latency to the host input device."), + AudioDevice::DEFAULT_LATENCY_STR, "1", "1000", "1", "%dms", nullptr, nullptr, 1.0f}, + {SettingInfo::Type::Integer, "output_latency", TRANSLATE_NOOP("USB", "Output Latency"), + TRANSLATE_NOOP("USB", "Specifies the latency to the host output device."), + AudioDevice::DEFAULT_LATENCY_STR, "1", "1000", "1", "%dms", nullptr, nullptr, 1.0f}, }; return info; } diff --git a/pcsx2/USB/usb-mic/usb-mic-singstar.cpp b/pcsx2/USB/usb-mic/usb-mic-singstar.cpp index 66885bd1b3..94dd3c7e55 100644 --- a/pcsx2/USB/usb-mic/usb-mic-singstar.cpp +++ b/pcsx2/USB/usb-mic/usb-mic-singstar.cpp @@ -747,7 +747,8 @@ namespace usb_mic if (!s->audsrc[0] && !s->audsrc[1]) { - Host::AddOSDMessage("USB-Mic: Neither player 1 nor 2 is connected.", Host::OSD_ERROR_DURATION); + Host::AddOSDMessage( + TRANSLATE_STR("USB", "USB-Mic: Neither player 1 nor 2 is connected."), Host::OSD_ERROR_DURATION); goto fail; } @@ -763,7 +764,9 @@ namespace usb_mic s->buffer[i].resize(BUFFER_FRAMES * s->audsrc[i]->GetChannels()); if (!s->audsrc[i]->Start()) { - Host::AddOSDMessage(fmt::format("USB-Mic: Failed to start player {} audio stream.", i + 1), Host::OSD_ERROR_DURATION); + Host::AddOSDMessage( + fmt::format(TRANSLATE_SV("USB", "USB-Mic: Failed to start player {} audio stream."), i + 1), + Host::OSD_ERROR_DURATION); goto fail; } } @@ -805,7 +808,7 @@ namespace usb_mic const char* SingstarDevice::Name() const { - return "Singstar"; + return TRANSLATE_NOOP("USB", "Singstar"); } const char* SingstarDevice::TypeName() const @@ -846,11 +849,14 @@ namespace usb_mic gsl::span SingstarDevice::Settings(u32 subtype) const { static constexpr const SettingInfo info[] = { - {SettingInfo::Type::StringList, "player1_device_name", "Player 1 Device", "Selects the input for the first player.", "", - nullptr, nullptr, nullptr, nullptr, nullptr, &AudioDevice::GetInputDeviceList}, - {SettingInfo::Type::StringList, "player2_device_name", "Player 2 Device", "Selects the input for the second player.", "", - nullptr, nullptr, nullptr, nullptr, nullptr, &AudioDevice::GetInputDeviceList}, - {SettingInfo::Type::Integer, "input_latency", "Input Latency", "Specifies the latency to the host input device.", + {SettingInfo::Type::StringList, "player1_device_name", TRANSLATE_NOOP("USB", "Player 1 Device"), + TRANSLATE_NOOP("USB", "Selects the input for the first player."), "", nullptr, nullptr, nullptr, + nullptr, nullptr, &AudioDevice::GetInputDeviceList}, + {SettingInfo::Type::StringList, "player2_device_name", TRANSLATE_NOOP("USB", "Player 2 Device"), + TRANSLATE_NOOP("USB", "Selects the input for the second player."), "", nullptr, nullptr, nullptr, + nullptr, nullptr, &AudioDevice::GetInputDeviceList}, + {SettingInfo::Type::Integer, "input_latency", TRANSLATE_NOOP("USB", "Input Latency"), + TRANSLATE_NOOP("USB", "Specifies the latency to the host input device."), AudioDevice::DEFAULT_LATENCY_STR, "1", "1000", "1", "%dms", nullptr, nullptr, 1.0f}, }; return info; @@ -863,15 +869,17 @@ namespace usb_mic const char* LogitechMicDevice::Name() const { - return "Logitech USB Mic"; + return TRANSLATE_NOOP("USB", "Logitech USB Mic"); } gsl::span LogitechMicDevice::Settings(u32 subtype) const { static constexpr const SettingInfo info[] = { - {SettingInfo::Type::StringList, "input_device_name", "Input Device", "Selects the device to read audio from.", "", nullptr, - nullptr, nullptr, nullptr, nullptr, &AudioDevice::GetInputDeviceList}, - {SettingInfo::Type::Integer, "input_latency", "Input Latency", "Specifies the latency to the host input device.", + {SettingInfo::Type::StringList, "input_device_name", TRANSLATE_NOOP("USB", "Input Device"), + TRANSLATE_NOOP("USB", "Selects the device to read audio from."), "", nullptr, nullptr, nullptr, nullptr, + nullptr, &AudioDevice::GetInputDeviceList}, + {SettingInfo::Type::Integer, "input_latency", TRANSLATE_NOOP("USB", "Input Latency"), + TRANSLATE_NOOP("USB", "Specifies the latency to the host input device."), AudioDevice::DEFAULT_LATENCY_STR, "1", "1000", "1", "%dms", nullptr, nullptr, 1.0f}, }; return info; diff --git a/pcsx2/USB/usb-msd/usb-msd.cpp b/pcsx2/USB/usb-msd/usb-msd.cpp index 41da0a7aeb..d9ac30f722 100644 --- a/pcsx2/USB/usb-msd/usb-msd.cpp +++ b/pcsx2/USB/usb-msd/usb-msd.cpp @@ -971,7 +971,8 @@ 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("usb-msd: Could not open image file '{}'", path), Host::OSD_ERROR_DURATION); + Host::AddOSDMessage(fmt::format(TRANSLATE_SV("USB", "usb-msd: Could not open image file '{}'"), path), + Host::OSD_ERROR_DURATION); goto fail; } @@ -1018,7 +1019,7 @@ namespace usb_msd const char* MsdDevice::Name() const { - return "Mass Storage Device"; + return TRANSLATE_NOOP("USB", "Mass Storage Device"); } bool MsdDevice::Freeze(USBDevice* dev, StateWrapper& sw) const @@ -1038,7 +1039,8 @@ namespace usb_msd // resetting port to try to avoid possible data corruption if (sw.IsReading() && old_mtime != s->f.mtime) { - Host::AddOSDMessage("Modification time to USB mass storage image changed, reattaching.", + Host::AddOSDMessage( + TRANSLATE_STR("USB", "Modification time to USB mass storage image changed, reattaching."), Host::OSD_ERROR_DURATION); usb_reattach(dev->port); } @@ -1054,7 +1056,8 @@ namespace usb_msd gsl::span MsdDevice::Settings(u32 subtype) const { static constexpr const SettingInfo settings[] = { - {SettingInfo::Type::Path, "ImagePath", "Image Path", "Sets the path to image which will back the virtual mass storage device."}, + {SettingInfo::Type::Path, "ImagePath", TRANSLATE_NOOP("USB", "Image Path"), + TRANSLATE_NOOP("USB", "Sets the path to image which will back the virtual mass storage device.")}, }; return settings; } diff --git a/pcsx2/USB/usb-pad/usb-pad.cpp b/pcsx2/USB/usb-pad/usb-pad.cpp index 1e7d584ffe..606f93e916 100644 --- a/pcsx2/USB/usb-pad/usb-pad.cpp +++ b/pcsx2/USB/usb-pad/usb-pad.cpp @@ -1,5 +1,5 @@ /* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2020 PCSX2 Dev Team + * Copyright (C) 2002-2023 PCSX2 Dev Team * * PCSX2 is free software: you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Found- @@ -17,6 +17,7 @@ #include "usb-pad.h" #include "USB/qemu-usb/USBinternal.h" #include "USB/USB.h" +#include "Host.h" #include "StateWrapper.h" #ifdef SDL_BUILD @@ -88,25 +89,25 @@ namespace usb_pad case WT_GENERIC: { static constexpr const InputBindingInfo bindings[] = { - {"SteeringLeft", "Steering Left", InputBindingInfo::Type::HalfAxis, CID_STEERING_L, GenericInputBinding::LeftStickLeft}, - {"SteeringRight", "Steering Right", InputBindingInfo::Type::HalfAxis, CID_STEERING_R, GenericInputBinding::LeftStickRight}, - {"Throttle", "Throttle", InputBindingInfo::Type::HalfAxis, CID_THROTTLE, GenericInputBinding::R2}, - {"Brake", "Brake", InputBindingInfo::Type::HalfAxis, CID_BRAKE, GenericInputBinding::L2}, - {"DPadUp", "D-Pad Up", InputBindingInfo::Type::Button, CID_DPAD_UP, GenericInputBinding::DPadUp}, - {"DPadDown", "D-Pad Down", InputBindingInfo::Type::Button, CID_DPAD_DOWN, GenericInputBinding::DPadDown}, - {"DPadLeft", "D-Pad Left", InputBindingInfo::Type::Button, CID_DPAD_LEFT, GenericInputBinding::DPadLeft}, - {"DPadRight", "D-Pad Right", InputBindingInfo::Type::Button, CID_DPAD_RIGHT, GenericInputBinding::DPadRight}, - {"Cross", "Cross", InputBindingInfo::Type::Button, CID_BUTTON0, GenericInputBinding::Cross}, - {"Square", "Square", InputBindingInfo::Type::Button, CID_BUTTON1, GenericInputBinding::Square}, - {"Circle", "Circle", InputBindingInfo::Type::Button, CID_BUTTON2, GenericInputBinding::Circle}, - {"Triangle", "Triangle", InputBindingInfo::Type::Button, CID_BUTTON3, GenericInputBinding::Triangle}, - {"L1", "L1", InputBindingInfo::Type::Button, CID_BUTTON5, GenericInputBinding::L1}, - {"R1", "R1", InputBindingInfo::Type::Button, CID_BUTTON4, GenericInputBinding::R1}, - {"L2", "L2", InputBindingInfo::Type::Button, CID_BUTTON7, GenericInputBinding::Unknown}, // used L2 for brake - {"R2", "R2", InputBindingInfo::Type::Button, CID_BUTTON6, GenericInputBinding::Unknown}, // used R2 for throttle - {"Select", "Select", InputBindingInfo::Type::Button, CID_BUTTON8, GenericInputBinding::Select}, - {"Start", "Start", InputBindingInfo::Type::Button, CID_BUTTON9, GenericInputBinding::Start}, - {"FFDevice", "Force Feedback", InputBindingInfo::Type::Device, 0, GenericInputBinding::Unknown}, + {"SteeringLeft", TRANSLATE_NOOP("USB", "Steering Left"), InputBindingInfo::Type::HalfAxis, CID_STEERING_L, GenericInputBinding::LeftStickLeft}, + {"SteeringRight", TRANSLATE_NOOP("USB", "Steering Right"), InputBindingInfo::Type::HalfAxis, CID_STEERING_R, GenericInputBinding::LeftStickRight}, + {"Throttle", TRANSLATE_NOOP("USB", "Throttle"), InputBindingInfo::Type::HalfAxis, CID_THROTTLE, GenericInputBinding::R2}, + {"Brake", TRANSLATE_NOOP("USB", "Brake"), InputBindingInfo::Type::HalfAxis, CID_BRAKE, GenericInputBinding::L2}, + {"DPadUp", TRANSLATE_NOOP("USB", "D-Pad Up"), InputBindingInfo::Type::Button, CID_DPAD_UP, GenericInputBinding::DPadUp}, + {"DPadDown", TRANSLATE_NOOP("USB", "D-Pad Down"), InputBindingInfo::Type::Button, CID_DPAD_DOWN, GenericInputBinding::DPadDown}, + {"DPadLeft", TRANSLATE_NOOP("USB", "D-Pad Left"), InputBindingInfo::Type::Button, CID_DPAD_LEFT, GenericInputBinding::DPadLeft}, + {"DPadRight", TRANSLATE_NOOP("USB", "D-Pad Right"), InputBindingInfo::Type::Button, CID_DPAD_RIGHT, GenericInputBinding::DPadRight}, + {"Cross", TRANSLATE_NOOP("USB", "Cross"), InputBindingInfo::Type::Button, CID_BUTTON0, GenericInputBinding::Cross}, + {"Square", TRANSLATE_NOOP("USB", "Square"), InputBindingInfo::Type::Button, CID_BUTTON1, GenericInputBinding::Square}, + {"Circle", TRANSLATE_NOOP("USB", "Circle"), InputBindingInfo::Type::Button, CID_BUTTON2, GenericInputBinding::Circle}, + {"Triangle", TRANSLATE_NOOP("USB", "Triangle"), InputBindingInfo::Type::Button, CID_BUTTON3, GenericInputBinding::Triangle}, + {"L1", TRANSLATE_NOOP("USB", "L1"), InputBindingInfo::Type::Button, CID_BUTTON5, GenericInputBinding::L1}, + {"R1", TRANSLATE_NOOP("USB", "R1"), InputBindingInfo::Type::Button, CID_BUTTON4, GenericInputBinding::R1}, + {"L2", TRANSLATE_NOOP("USB", "L2"), InputBindingInfo::Type::Button, CID_BUTTON7, GenericInputBinding::Unknown}, // used L2 for brake + {"R2", TRANSLATE_NOOP("USB", "R2"), InputBindingInfo::Type::Button, CID_BUTTON6, GenericInputBinding::Unknown}, // used R2 for throttle + {"Select", TRANSLATE_NOOP("USB", "Select"), InputBindingInfo::Type::Button, CID_BUTTON8, GenericInputBinding::Select}, + {"Start", TRANSLATE_NOOP("USB", "Start"), InputBindingInfo::Type::Button, CID_BUTTON9, GenericInputBinding::Start}, + {"FFDevice", TRANSLATE_NOOP("USB", "Force Feedback"), InputBindingInfo::Type::Device, 0, GenericInputBinding::Unknown}, }; return bindings; @@ -116,26 +117,26 @@ namespace usb_pad case WT_DRIVING_FORCE_PRO_1102: { static constexpr const InputBindingInfo bindings[] = { - {"SteeringLeft", "Steering Left", InputBindingInfo::Type::HalfAxis, CID_STEERING_L, GenericInputBinding::LeftStickLeft}, - {"SteeringRight", "Steering Right", InputBindingInfo::Type::HalfAxis, CID_STEERING_R, GenericInputBinding::LeftStickRight}, - {"Throttle", "Throttle", InputBindingInfo::Type::HalfAxis, CID_THROTTLE, GenericInputBinding::R2}, - {"Brake", "Brake", InputBindingInfo::Type::HalfAxis, CID_BRAKE, GenericInputBinding::L2}, - {"DPadUp", "D-Pad Up", InputBindingInfo::Type::Button, CID_DPAD_UP, GenericInputBinding::DPadUp}, - {"DPadDown", "D-Pad Down", InputBindingInfo::Type::Button, CID_DPAD_DOWN, GenericInputBinding::DPadDown}, - {"DPadLeft", "D-Pad Left", InputBindingInfo::Type::Button, CID_DPAD_LEFT, GenericInputBinding::DPadLeft}, - {"DPadRight", "D-Pad Right", InputBindingInfo::Type::Button, CID_DPAD_RIGHT, GenericInputBinding::DPadRight}, - {"Cross", "Cross", InputBindingInfo::Type::Button, CID_BUTTON0, GenericInputBinding::Cross}, - {"Square", "Square", InputBindingInfo::Type::Button, CID_BUTTON1, GenericInputBinding::Square}, - {"Circle", "Circle", InputBindingInfo::Type::Button, CID_BUTTON2, GenericInputBinding::Circle}, - {"Triangle", "Triangle", InputBindingInfo::Type::Button, CID_BUTTON3, GenericInputBinding::Triangle}, - {"R1", "Shift Up / R1", InputBindingInfo::Type::Button, CID_BUTTON4, GenericInputBinding::R1}, - {"L1", "Shift Down / L1", InputBindingInfo::Type::Button, CID_BUTTON5, GenericInputBinding::L1}, - {"Select", "Select", InputBindingInfo::Type::Button, CID_BUTTON8, GenericInputBinding::Select}, - {"Start", "Start", InputBindingInfo::Type::Button, CID_BUTTON9, GenericInputBinding::Start}, - {"L2", "L2", InputBindingInfo::Type::Button, CID_BUTTON7, GenericInputBinding::Unknown}, // used L2 for brake - {"R2", "R2", InputBindingInfo::Type::Button, CID_BUTTON6, GenericInputBinding::Unknown}, // used R2 for throttle - {"L3", "L3", InputBindingInfo::Type::Button, CID_BUTTON11, GenericInputBinding::L3}, - {"R3", "R3", InputBindingInfo::Type::Button, CID_BUTTON10, GenericInputBinding::R3}, + {"SteeringLeft", TRANSLATE_NOOP("USB", "Steering Left"), InputBindingInfo::Type::HalfAxis, CID_STEERING_L, GenericInputBinding::LeftStickLeft}, + {"SteeringRight", TRANSLATE_NOOP("USB", "Steering Right"), InputBindingInfo::Type::HalfAxis, CID_STEERING_R, GenericInputBinding::LeftStickRight}, + {"Throttle", TRANSLATE_NOOP("USB", "Throttle"), InputBindingInfo::Type::HalfAxis, CID_THROTTLE, GenericInputBinding::R2}, + {"Brake", TRANSLATE_NOOP("USB", "Brake"), InputBindingInfo::Type::HalfAxis, CID_BRAKE, GenericInputBinding::L2}, + {"DPadUp", TRANSLATE_NOOP("USB", "D-Pad Up"), InputBindingInfo::Type::Button, CID_DPAD_UP, GenericInputBinding::DPadUp}, + {"DPadDown", TRANSLATE_NOOP("USB", "D-Pad Down"), InputBindingInfo::Type::Button, CID_DPAD_DOWN, GenericInputBinding::DPadDown}, + {"DPadLeft", TRANSLATE_NOOP("USB", "D-Pad Left"), InputBindingInfo::Type::Button, CID_DPAD_LEFT, GenericInputBinding::DPadLeft}, + {"DPadRight", TRANSLATE_NOOP("USB", "D-Pad Right"), InputBindingInfo::Type::Button, CID_DPAD_RIGHT, GenericInputBinding::DPadRight}, + {"Cross", TRANSLATE_NOOP("USB", "Cross"), InputBindingInfo::Type::Button, CID_BUTTON0, GenericInputBinding::Cross}, + {"Square", TRANSLATE_NOOP("USB", "Square"), InputBindingInfo::Type::Button, CID_BUTTON1, GenericInputBinding::Square}, + {"Circle", TRANSLATE_NOOP("USB", "Circle"), InputBindingInfo::Type::Button, CID_BUTTON2, GenericInputBinding::Circle}, + {"Triangle", TRANSLATE_NOOP("USB", "Triangle"), InputBindingInfo::Type::Button, CID_BUTTON3, GenericInputBinding::Triangle}, + {"R1", TRANSLATE_NOOP("USB", "Shift Up / R1"), InputBindingInfo::Type::Button, CID_BUTTON4, GenericInputBinding::R1}, + {"L1", TRANSLATE_NOOP("USB", "Shift Down / L1"), InputBindingInfo::Type::Button, CID_BUTTON5, GenericInputBinding::L1}, + {"Select", TRANSLATE_NOOP("USB", "Select"), InputBindingInfo::Type::Button, CID_BUTTON8, GenericInputBinding::Select}, + {"Start", TRANSLATE_NOOP("USB", "Start"), InputBindingInfo::Type::Button, CID_BUTTON9, GenericInputBinding::Start}, + {"L2", TRANSLATE_NOOP("USB", "L2"), InputBindingInfo::Type::Button, CID_BUTTON7, GenericInputBinding::Unknown}, // used L2 for brake + {"R2", TRANSLATE_NOOP("USB", "R2"), InputBindingInfo::Type::Button, CID_BUTTON6, GenericInputBinding::Unknown}, // used R2 for throttle + {"L3", TRANSLATE_NOOP("USB", "L3"), InputBindingInfo::Type::Button, CID_BUTTON11, GenericInputBinding::L3}, + {"R3", TRANSLATE_NOOP("USB", "R3"), InputBindingInfo::Type::Button, CID_BUTTON10, GenericInputBinding::R3}, {"FFDevice", "Force Feedback", InputBindingInfo::Type::Device, 0, GenericInputBinding::Unknown}, }; @@ -145,17 +146,17 @@ namespace usb_pad case WT_GT_FORCE: { static constexpr const InputBindingInfo bindings[] = { - {"SteeringLeft", "Steering Left", InputBindingInfo::Type::HalfAxis, CID_STEERING_L, GenericInputBinding::LeftStickLeft}, - {"SteeringRight", "Steering Right", InputBindingInfo::Type::HalfAxis, CID_STEERING_R, GenericInputBinding::LeftStickRight}, - {"Throttle", "Throttle", InputBindingInfo::Type::HalfAxis, CID_THROTTLE, GenericInputBinding::R2}, - {"Brake", "Brake", InputBindingInfo::Type::HalfAxis, CID_BRAKE, GenericInputBinding::L2}, - {"MenuUp", "Menu Up", InputBindingInfo::Type::Button, CID_BUTTON1, GenericInputBinding::DPadUp}, - {"MenuDown", "Menu Down", InputBindingInfo::Type::Button, CID_BUTTON0, GenericInputBinding::DPadDown}, - {"X", "X", InputBindingInfo::Type::Button, CID_BUTTON2, GenericInputBinding::Square}, - {"Y", "Y", InputBindingInfo::Type::Button, CID_BUTTON3, GenericInputBinding::Triangle}, - {"A", "A", InputBindingInfo::Type::Button, CID_BUTTON4, GenericInputBinding::Cross}, - {"B", "B", InputBindingInfo::Type::Button, CID_BUTTON5, GenericInputBinding::Circle}, - {"FFDevice", "Force Feedback", InputBindingInfo::Type::Device, 0, GenericInputBinding::Unknown}, + {"SteeringLeft", TRANSLATE_NOOP("USB", "Steering Left"), InputBindingInfo::Type::HalfAxis, CID_STEERING_L, GenericInputBinding::LeftStickLeft}, + {"SteeringRight", TRANSLATE_NOOP("USB", "Steering Right"), InputBindingInfo::Type::HalfAxis, CID_STEERING_R, GenericInputBinding::LeftStickRight}, + {"Throttle", TRANSLATE_NOOP("USB", "Throttle"), InputBindingInfo::Type::HalfAxis, CID_THROTTLE, GenericInputBinding::R2}, + {"Brake", TRANSLATE_NOOP("USB", "Brake"), InputBindingInfo::Type::HalfAxis, CID_BRAKE, GenericInputBinding::L2}, + {"MenuUp", TRANSLATE_NOOP("USB", "Menu Up"), InputBindingInfo::Type::Button, CID_BUTTON1, GenericInputBinding::DPadUp}, + {"MenuDown", TRANSLATE_NOOP("USB", "Menu Down"), InputBindingInfo::Type::Button, CID_BUTTON0, GenericInputBinding::DPadDown}, + {"X", TRANSLATE_NOOP("USB", "X"), InputBindingInfo::Type::Button, CID_BUTTON2, GenericInputBinding::Square}, + {"Y", TRANSLATE_NOOP("USB", "Y"), InputBindingInfo::Type::Button, CID_BUTTON3, GenericInputBinding::Triangle}, + {"A", TRANSLATE_NOOP("USB", "A"), InputBindingInfo::Type::Button, CID_BUTTON4, GenericInputBinding::Cross}, + {"B", TRANSLATE_NOOP("USB", "B"), InputBindingInfo::Type::Button, CID_BUTTON5, GenericInputBinding::Circle}, + {"FFDevice", TRANSLATE_NOOP("USB", "Force Feedback"), InputBindingInfo::Type::Device, 0, GenericInputBinding::Unknown}, }; return bindings; @@ -174,14 +175,14 @@ namespace usb_pad { static constexpr const char* SteeringCurveExponentOptions[] = {"Off", "Low", "Medium", "High", nullptr}; static constexpr const SettingInfo info[] = { - {SettingInfo::Type::Integer, "SteeringSmoothing", "Steering Smoothing", - "Smooths out changes in steering to the specified percentage per poll. Needed for using keyboards.", + {SettingInfo::Type::Integer, "SteeringSmoothing", TRANSLATE_NOOP("USB", "Steering Smoothing"), + TRANSLATE_NOOP("USB", "Smooths out changes in steering to the specified percentage per poll. Needed for using keyboards."), "0", "0", "100", "1", "%d%%", nullptr, nullptr, 1.0f}, - {SettingInfo::Type::Integer, "SteeringDeadzone", "Steering Deadzone", - "Steering axis deadzone for pads or non self centering wheels.", + {SettingInfo::Type::Integer, "SteeringDeadzone", TRANSLATE_NOOP("USB", "Steering Deadzone"), + TRANSLATE_NOOP("USB", "Steering axis deadzone for pads or non self centering wheels."), "0", "0", "100", "1", "%d%%", nullptr, nullptr, 1.0f}, - {SettingInfo::Type::StringList, "SteeringCurveExponent", "Steering Damping", - "Applies power curve filter to steering axis values. Dampens small inputs.", + {SettingInfo::Type::StringList, "SteeringCurveExponent", TRANSLATE_NOOP("USB", "Steering Damping"), + TRANSLATE_NOOP("USB", "Applies power curve filter to steering axis values. Dampens small inputs."), "Off", nullptr, nullptr, nullptr, nullptr, SteeringCurveExponentOptions} }; @@ -836,7 +837,7 @@ namespace usb_pad const char* PadDevice::Name() const { - return "Wheel Device"; + return TRANSLATE_NOOP("USB", "Wheel Device"); } const char* PadDevice::TypeName() const @@ -875,7 +876,9 @@ namespace usb_pad gsl::span PadDevice::SubTypes() const { - static const char* subtypes[] = {"Driving Force", "Driving Force Pro", "Driving Force Pro (rev11.02)", "GT Force"}; + static const char* subtypes[] = {TRANSLATE_NOOP("USB", "Driving Force"), + TRANSLATE_NOOP("USB", "Driving Force Pro"), TRANSLATE_NOOP("USB", "Driving Force Pro (rev11.02)"), + TRANSLATE_NOOP("USB", "GT Force")}; return subtypes; } @@ -907,7 +910,7 @@ namespace usb_pad const char* RBDrumKitDevice::Name() const { - return "Rock Band Drum Kit"; + return TRANSLATE_NOOP("USB", "Rock Band Drum Kit"); } const char* RBDrumKitDevice::TypeName() const @@ -944,13 +947,13 @@ namespace usb_pad gsl::span RBDrumKitDevice::Bindings(u32 subtype) const { static constexpr const InputBindingInfo bindings[] = { - {"Blue", "Blue", InputBindingInfo::Type::Button, CID_BUTTON0, GenericInputBinding::R1}, - {"Green", "Green", InputBindingInfo::Type::Button, CID_BUTTON1, GenericInputBinding::Triangle}, - {"Red", "Red", InputBindingInfo::Type::Button, CID_BUTTON2, GenericInputBinding::Circle}, - {"Yellow", "Yellow", InputBindingInfo::Type::Button, CID_BUTTON3, GenericInputBinding::Square}, - {"Orange", "Orange", InputBindingInfo::Type::Button, CID_BUTTON4, GenericInputBinding::Cross}, - {"Select", "Select", InputBindingInfo::Type::Button, CID_BUTTON8, GenericInputBinding::Select}, - {"Start", "Start", InputBindingInfo::Type::Button, CID_BUTTON9, GenericInputBinding::Start}, + {"Blue", TRANSLATE_NOOP("USB", "Blue"), InputBindingInfo::Type::Button, CID_BUTTON0, GenericInputBinding::R1}, + {"Green", TRANSLATE_NOOP("USB", "Green"), InputBindingInfo::Type::Button, CID_BUTTON1, GenericInputBinding::Triangle}, + {"Red", TRANSLATE_NOOP("USB", "Red"), InputBindingInfo::Type::Button, CID_BUTTON2, GenericInputBinding::Circle}, + {"Yellow", TRANSLATE_NOOP("USB", "Yellow"), InputBindingInfo::Type::Button, CID_BUTTON3, GenericInputBinding::Square}, + {"Orange", TRANSLATE_NOOP("USB", "Orange"), InputBindingInfo::Type::Button, CID_BUTTON4, GenericInputBinding::Cross}, + {"Select", TRANSLATE_NOOP("USB", "Select"), InputBindingInfo::Type::Button, CID_BUTTON8, GenericInputBinding::Select}, + {"Start", TRANSLATE_NOOP("USB", "Start"), InputBindingInfo::Type::Button, CID_BUTTON9, GenericInputBinding::Start}, }; return bindings; @@ -965,7 +968,7 @@ namespace usb_pad const char* BuzzDevice::Name() const { - return "Buzz Controller"; + return TRANSLATE_NOOP("USB", "Buzz Controller"); } const char* BuzzDevice::TypeName() const @@ -981,29 +984,29 @@ namespace usb_pad gsl::span BuzzDevice::Bindings(u32 subtype) const { static constexpr const InputBindingInfo bindings[] = { - {"Red1", "Player 1 Red", InputBindingInfo::Type::Button, CID_BUTTON0, GenericInputBinding::Circle}, - {"Blue1", "Player 1 Blue", InputBindingInfo::Type::Button, CID_BUTTON4, GenericInputBinding::R1}, - {"Orange1", "Player 1 Orange", InputBindingInfo::Type::Button, CID_BUTTON3, GenericInputBinding::Cross}, - {"Green1", "Player 1 Green", InputBindingInfo::Type::Button, CID_BUTTON2, GenericInputBinding::Triangle}, - {"Yellow1", "Player 1 Yellow", InputBindingInfo::Type::Button, CID_BUTTON1, GenericInputBinding::Square}, + {"Red1", TRANSLATE_NOOP("USB", "Player 1 Red"), InputBindingInfo::Type::Button, CID_BUTTON0, GenericInputBinding::Circle}, + {"Blue1", TRANSLATE_NOOP("USB", "Player 1 Blue"), InputBindingInfo::Type::Button, CID_BUTTON4, GenericInputBinding::R1}, + {"Orange1", TRANSLATE_NOOP("USB", "Player 1 Orange"), InputBindingInfo::Type::Button, CID_BUTTON3, GenericInputBinding::Cross}, + {"Green1", TRANSLATE_NOOP("USB", "Player 1 Green"), InputBindingInfo::Type::Button, CID_BUTTON2, GenericInputBinding::Triangle}, + {"Yellow1", TRANSLATE_NOOP("USB", "Player 1 Yellow"), InputBindingInfo::Type::Button, CID_BUTTON1, GenericInputBinding::Square}, - {"Red2", "Player 2 Red", InputBindingInfo::Type::Button, CID_BUTTON5, GenericInputBinding::Unknown}, - {"Blue2", "Player 2 Blue", InputBindingInfo::Type::Button, CID_BUTTON9, GenericInputBinding::Unknown}, - {"Orange2", "Player 2 Orange", InputBindingInfo::Type::Button, CID_BUTTON8, GenericInputBinding::Unknown}, - {"Green2", "Player 2 Green", InputBindingInfo::Type::Button, CID_BUTTON7, GenericInputBinding::Unknown}, - {"Yellow2", "Player 2 Yellow", InputBindingInfo::Type::Button, CID_BUTTON6, GenericInputBinding::Unknown}, + {"Red2", TRANSLATE_NOOP("USB", "Player 2 Red"), InputBindingInfo::Type::Button, CID_BUTTON5, GenericInputBinding::Unknown}, + {"Blue2", TRANSLATE_NOOP("USB", "Player 2 Blue"), InputBindingInfo::Type::Button, CID_BUTTON9, GenericInputBinding::Unknown}, + {"Orange2", TRANSLATE_NOOP("USB", "Player 2 Orange"), InputBindingInfo::Type::Button, CID_BUTTON8, GenericInputBinding::Unknown}, + {"Green2", TRANSLATE_NOOP("USB", "Player 2 Green"), InputBindingInfo::Type::Button, CID_BUTTON7, GenericInputBinding::Unknown}, + {"Yellow2", TRANSLATE_NOOP("USB", "Player 2 Yellow"), InputBindingInfo::Type::Button, CID_BUTTON6, GenericInputBinding::Unknown}, - {"Red3", "Player 3 Red", InputBindingInfo::Type::Button, CID_BUTTON10, GenericInputBinding::Unknown}, - {"Blue3", "Player 3 Blue", InputBindingInfo::Type::Button, CID_BUTTON14, GenericInputBinding::Unknown}, - {"Orange3", "Player 3 Orange", InputBindingInfo::Type::Button, CID_BUTTON13, GenericInputBinding::Unknown}, - {"Green3", "Player 3 Green", InputBindingInfo::Type::Button, CID_BUTTON12, GenericInputBinding::Unknown}, - {"Yellow3", "Player 3 Yellow", InputBindingInfo::Type::Button, CID_BUTTON11, GenericInputBinding::Unknown}, + {"Red3", TRANSLATE_NOOP("USB", "Player 3 Red"), InputBindingInfo::Type::Button, CID_BUTTON10, GenericInputBinding::Unknown}, + {"Blue3", TRANSLATE_NOOP("USB", "Player 3 Blue"), InputBindingInfo::Type::Button, CID_BUTTON14, GenericInputBinding::Unknown}, + {"Orange3", TRANSLATE_NOOP("USB", "Player 3 Orange"), InputBindingInfo::Type::Button, CID_BUTTON13, GenericInputBinding::Unknown}, + {"Green3", TRANSLATE_NOOP("USB", "Player 3 Green"), InputBindingInfo::Type::Button, CID_BUTTON12, GenericInputBinding::Unknown}, + {"Yellow3", TRANSLATE_NOOP("USB", "Player 3 Yellow"), InputBindingInfo::Type::Button, CID_BUTTON11, GenericInputBinding::Unknown}, - {"Red4", "Player 4 Red", InputBindingInfo::Type::Button, CID_BUTTON15, GenericInputBinding::Unknown}, - {"Blue4", "Player 4 Blue", InputBindingInfo::Type::Button, CID_BUTTON19, GenericInputBinding::Unknown}, - {"Orange4", "Player 4 Orange", InputBindingInfo::Type::Button, CID_BUTTON18, GenericInputBinding::Unknown}, - {"Green4", "Player 4 Green", InputBindingInfo::Type::Button, CID_BUTTON17, GenericInputBinding::Unknown}, - {"Yellow4", "Player 4 Yellow", InputBindingInfo::Type::Button, CID_BUTTON16, GenericInputBinding::Unknown}, + {"Red4", TRANSLATE_NOOP("USB", "Player 4 Red"), InputBindingInfo::Type::Button, CID_BUTTON15, GenericInputBinding::Unknown}, + {"Blue4", TRANSLATE_NOOP("USB", "Player 4 Blue"), InputBindingInfo::Type::Button, CID_BUTTON19, GenericInputBinding::Unknown}, + {"Orange4", TRANSLATE_NOOP("USB", "Player 4 Orange"), InputBindingInfo::Type::Button, CID_BUTTON18, GenericInputBinding::Unknown}, + {"Green4", TRANSLATE_NOOP("USB", "Player 4 Green"), InputBindingInfo::Type::Button, CID_BUTTON17, GenericInputBinding::Unknown}, + {"Yellow4", TRANSLATE_NOOP("USB", "Player 4 Yellow"), InputBindingInfo::Type::Button, CID_BUTTON16, GenericInputBinding::Unknown}, }; return bindings; @@ -1039,7 +1042,7 @@ namespace usb_pad const char* KeyboardmaniaDevice::Name() const { - return "Keyboardmania"; + return TRANSLATE_NOOP("USB", "Keyboardmania"); } const char* KeyboardmaniaDevice::TypeName() const @@ -1055,35 +1058,35 @@ namespace usb_pad gsl::span KeyboardmaniaDevice::Bindings(u32 subtype) const { static constexpr const InputBindingInfo bindings[] = { - {"C1", "C 1", InputBindingInfo::Type::Button, CID_BUTTON0, GenericInputBinding::Unknown}, - {"CSharp1", "C# 1", InputBindingInfo::Type::Button, CID_BUTTON1, GenericInputBinding::Unknown}, - {"D1", "D 1", InputBindingInfo::Type::Button, CID_BUTTON2, GenericInputBinding::Unknown}, - {"DSharp1", "D# 1", InputBindingInfo::Type::Button, CID_BUTTON3, GenericInputBinding::Unknown}, - {"E1", "E 1", InputBindingInfo::Type::Button, CID_BUTTON4, GenericInputBinding::Unknown}, - {"F1", "F 1", InputBindingInfo::Type::Button, CID_BUTTON5, GenericInputBinding::Unknown}, - {"FSharp1", "F# 1", InputBindingInfo::Type::Button, CID_BUTTON6, GenericInputBinding::Unknown}, - {"G1", "G 1", InputBindingInfo::Type::Button, CID_BUTTON8, GenericInputBinding::Unknown}, - {"GSharp1", "G# 1", InputBindingInfo::Type::Button, CID_BUTTON9, GenericInputBinding::Unknown}, - {"A1", "A 1", InputBindingInfo::Type::Button, CID_BUTTON10, GenericInputBinding::Unknown}, - {"ASharp1", "A# 1", InputBindingInfo::Type::Button, CID_BUTTON11, GenericInputBinding::Unknown}, - {"B1", "B 1", InputBindingInfo::Type::Button, CID_BUTTON12, GenericInputBinding::Unknown}, - {"C2", "C 2", InputBindingInfo::Type::Button, CID_BUTTON13, GenericInputBinding::Unknown}, - {"CSharp2", "C# 2", InputBindingInfo::Type::Button, CID_BUTTON16, GenericInputBinding::Unknown}, - {"D2", "D 2", InputBindingInfo::Type::Button, CID_BUTTON17, GenericInputBinding::Unknown}, - {"DSharp2", "D# 2", InputBindingInfo::Type::Button, CID_BUTTON18, GenericInputBinding::Unknown}, - {"E2", "E 2", InputBindingInfo::Type::Button, CID_BUTTON19, GenericInputBinding::Unknown}, - {"F2", "F 2", InputBindingInfo::Type::Button, CID_BUTTON20, GenericInputBinding::Unknown}, - {"FSharp2", "F# 2", InputBindingInfo::Type::Button, CID_BUTTON21, GenericInputBinding::Unknown}, - {"G2", "G 2", InputBindingInfo::Type::Button, CID_BUTTON24, GenericInputBinding::Unknown}, - {"GSharp2", "G# 2", InputBindingInfo::Type::Button, CID_BUTTON25, GenericInputBinding::Unknown}, - {"A2", "A 2", InputBindingInfo::Type::Button, CID_BUTTON26, GenericInputBinding::Unknown}, - {"ASharp2", "A# 2", InputBindingInfo::Type::Button, CID_BUTTON27, GenericInputBinding::Unknown}, - {"B2", "B 2", InputBindingInfo::Type::Button, CID_BUTTON28, GenericInputBinding::Unknown}, + {"C1", TRANSLATE_NOOP("USB", "C 1"), InputBindingInfo::Type::Button, CID_BUTTON0, GenericInputBinding::Unknown}, + {"CSharp1", TRANSLATE_NOOP("USB", "C# 1"), InputBindingInfo::Type::Button, CID_BUTTON1, GenericInputBinding::Unknown}, + {"D1", TRANSLATE_NOOP("USB", "D 1"), InputBindingInfo::Type::Button, CID_BUTTON2, GenericInputBinding::Unknown}, + {"DSharp1", TRANSLATE_NOOP("USB", "D# 1"), InputBindingInfo::Type::Button, CID_BUTTON3, GenericInputBinding::Unknown}, + {"E1", TRANSLATE_NOOP("USB", "E 1"), InputBindingInfo::Type::Button, CID_BUTTON4, GenericInputBinding::Unknown}, + {"F1", TRANSLATE_NOOP("USB", "F 1"), InputBindingInfo::Type::Button, CID_BUTTON5, GenericInputBinding::Unknown}, + {"FSharp1", TRANSLATE_NOOP("USB", "F# 1"), InputBindingInfo::Type::Button, CID_BUTTON6, GenericInputBinding::Unknown}, + {"G1", TRANSLATE_NOOP("USB", "G 1"), InputBindingInfo::Type::Button, CID_BUTTON8, GenericInputBinding::Unknown}, + {"GSharp1", TRANSLATE_NOOP("USB", "G# 1"), InputBindingInfo::Type::Button, CID_BUTTON9, GenericInputBinding::Unknown}, + {"A1", TRANSLATE_NOOP("USB", "A 1"), InputBindingInfo::Type::Button, CID_BUTTON10, GenericInputBinding::Unknown}, + {"ASharp1", TRANSLATE_NOOP("USB", "A# 1"), InputBindingInfo::Type::Button, CID_BUTTON11, GenericInputBinding::Unknown}, + {"B1", TRANSLATE_NOOP("USB", "B 1"), InputBindingInfo::Type::Button, CID_BUTTON12, GenericInputBinding::Unknown}, + {"C2", TRANSLATE_NOOP("USB", "C 2"), InputBindingInfo::Type::Button, CID_BUTTON13, GenericInputBinding::Unknown}, + {"CSharp2", TRANSLATE_NOOP("USB", "C# 2"), InputBindingInfo::Type::Button, CID_BUTTON16, GenericInputBinding::Unknown}, + {"D2", TRANSLATE_NOOP("USB", "D 2"), InputBindingInfo::Type::Button, CID_BUTTON17, GenericInputBinding::Unknown}, + {"DSharp2", TRANSLATE_NOOP("USB", "D# 2"), InputBindingInfo::Type::Button, CID_BUTTON18, GenericInputBinding::Unknown}, + {"E2", TRANSLATE_NOOP("USB", "E 2"), InputBindingInfo::Type::Button, CID_BUTTON19, GenericInputBinding::Unknown}, + {"F2", TRANSLATE_NOOP("USB", "F 2"), InputBindingInfo::Type::Button, CID_BUTTON20, GenericInputBinding::Unknown}, + {"FSharp2", TRANSLATE_NOOP("USB", "F# 2"), InputBindingInfo::Type::Button, CID_BUTTON21, GenericInputBinding::Unknown}, + {"G2", TRANSLATE_NOOP("USB", "G 2"), InputBindingInfo::Type::Button, CID_BUTTON24, GenericInputBinding::Unknown}, + {"GSharp2", TRANSLATE_NOOP("USB", "G# 2"), InputBindingInfo::Type::Button, CID_BUTTON25, GenericInputBinding::Unknown}, + {"A2", TRANSLATE_NOOP("USB", "A 2"), InputBindingInfo::Type::Button, CID_BUTTON26, GenericInputBinding::Unknown}, + {"ASharp2", TRANSLATE_NOOP("USB", "A# 2"), InputBindingInfo::Type::Button, CID_BUTTON27, GenericInputBinding::Unknown}, + {"B2", TRANSLATE_NOOP("USB", "B 2"), InputBindingInfo::Type::Button, CID_BUTTON28, GenericInputBinding::Unknown}, - {"Start", "Start", InputBindingInfo::Type::Button, CID_BUTTON22, GenericInputBinding::Unknown}, - {"Select", "Select", InputBindingInfo::Type::Button, CID_BUTTON14, GenericInputBinding::Unknown}, - {"WheelUp", "Wheel Up", InputBindingInfo::Type::Button, CID_BUTTON29, GenericInputBinding::Unknown}, - {"WheelDown", "Wheel Down", InputBindingInfo::Type::Button, CID_BUTTON30, GenericInputBinding::Unknown}, + {"Start", TRANSLATE_NOOP("USB", "Start"), InputBindingInfo::Type::Button, CID_BUTTON22, GenericInputBinding::Unknown}, + {"Select", TRANSLATE_NOOP("USB", "Select"), InputBindingInfo::Type::Button, CID_BUTTON14, GenericInputBinding::Unknown}, + {"WheelUp", TRANSLATE_NOOP("USB", "Wheel Up"), InputBindingInfo::Type::Button, CID_BUTTON29, GenericInputBinding::Unknown}, + {"WheelDown", TRANSLATE_NOOP("USB", "Wheel Down"), InputBindingInfo::Type::Button, CID_BUTTON30, GenericInputBinding::Unknown}, }; return bindings; diff --git a/pcsx2/USB/usb-pad/usb-seamic.cpp b/pcsx2/USB/usb-pad/usb-seamic.cpp index c686612fc5..79f13b4886 100644 --- a/pcsx2/USB/usb-pad/usb-seamic.cpp +++ b/pcsx2/USB/usb-pad/usb-seamic.cpp @@ -1,5 +1,5 @@ /* PCSX2 - PS2 Emulator for PCs - * Copyright (C) 2002-2020 PCSX2 Dev Team + * Copyright (C) 2002-2023 PCSX2 Dev Team * * PCSX2 is free software: you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Found- @@ -14,6 +14,7 @@ */ #include "PrecompiledHeader.h" +#include "Host.h" #include "USB/usb-pad/usb-pad.h" #include "USB/qemu-usb/desc.h" #include "USB/usb-mic/usb-mic-singstar.h" @@ -344,7 +345,7 @@ namespace usb_pad const char* SeamicDevice::Name() const { - return "Sega Seamic"; + return TRANSLATE_NOOP("USB", "Sega Seamic"); } const char* SeamicDevice::TypeName() const @@ -361,24 +362,24 @@ namespace usb_pad { // TODO: This is likely wrong. Someone who cares can fix it. static constexpr const InputBindingInfo bindings[] = { - {"StickLeft", "Stick Left", InputBindingInfo::Type::HalfAxis, CID_STEERING_L, GenericInputBinding::LeftStickLeft}, - {"StickRight", "Stick Right", InputBindingInfo::Type::HalfAxis, CID_STEERING_R, GenericInputBinding::LeftStickRight}, - {"StickUp", "Stick Up", InputBindingInfo::Type::HalfAxis, CID_THROTTLE, GenericInputBinding::LeftStickUp}, - {"StickDown", "Stick Down", InputBindingInfo::Type::HalfAxis, CID_BRAKE, GenericInputBinding::LeftStickDown}, - {"A", "A", InputBindingInfo::Type::Button, CID_BUTTON0, GenericInputBinding::Cross}, - {"B", "B", InputBindingInfo::Type::Button, CID_BUTTON1, GenericInputBinding::Circle}, - {"C", "C", InputBindingInfo::Type::Button, CID_BUTTON2, GenericInputBinding::R2}, - {"X", "X", InputBindingInfo::Type::Button, CID_BUTTON3, GenericInputBinding::Square}, - {"Y", "Y", InputBindingInfo::Type::Button, CID_BUTTON4, GenericInputBinding::Triangle}, - {"Z", "Z", InputBindingInfo::Type::Button, CID_BUTTON5, GenericInputBinding::L2}, - {"L", "L", InputBindingInfo::Type::Button, CID_BUTTON6, GenericInputBinding::L1}, - {"R", "R", InputBindingInfo::Type::Button, CID_BUTTON7, GenericInputBinding::R1}, - {"Select", "Select", InputBindingInfo::Type::Button, CID_BUTTON8, GenericInputBinding::Select}, - {"Start", "Start", InputBindingInfo::Type::Button, CID_BUTTON9, GenericInputBinding::Start}, - {"DPadUp", "D-Pad Up", InputBindingInfo::Type::Button, CID_DPAD_UP, GenericInputBinding::DPadUp}, - {"DPadDown", "D-Pad Down", InputBindingInfo::Type::Button, CID_DPAD_DOWN, GenericInputBinding::DPadDown}, - {"DPadLeft", "D-Pad Left", InputBindingInfo::Type::Button, CID_DPAD_LEFT, GenericInputBinding::DPadLeft}, - {"DPadRight", "D-Pad Right", InputBindingInfo::Type::Button, CID_DPAD_RIGHT, GenericInputBinding::DPadRight}, + {"StickLeft", TRANSLATE_NOOP("USB", "Stick Left"), InputBindingInfo::Type::HalfAxis, CID_STEERING_L, GenericInputBinding::LeftStickLeft}, + {"StickRight", TRANSLATE_NOOP("USB", "Stick Right"), InputBindingInfo::Type::HalfAxis, CID_STEERING_R, GenericInputBinding::LeftStickRight}, + {"StickUp", TRANSLATE_NOOP("USB", "Stick Up"), InputBindingInfo::Type::HalfAxis, CID_THROTTLE, GenericInputBinding::LeftStickUp}, + {"StickDown", TRANSLATE_NOOP("USB", "Stick Down"), InputBindingInfo::Type::HalfAxis, CID_BRAKE, GenericInputBinding::LeftStickDown}, + {"A", TRANSLATE_NOOP("USB", "A"), InputBindingInfo::Type::Button, CID_BUTTON0, GenericInputBinding::Cross}, + {"B", TRANSLATE_NOOP("USB", "B"), InputBindingInfo::Type::Button, CID_BUTTON1, GenericInputBinding::Circle}, + {"C", TRANSLATE_NOOP("USB", "C"), InputBindingInfo::Type::Button, CID_BUTTON2, GenericInputBinding::R2}, + {"X", TRANSLATE_NOOP("USB", "X"), InputBindingInfo::Type::Button, CID_BUTTON3, GenericInputBinding::Square}, + {"Y", TRANSLATE_NOOP("USB", "Y"), InputBindingInfo::Type::Button, CID_BUTTON4, GenericInputBinding::Triangle}, + {"Z", TRANSLATE_NOOP("USB", "Z"), InputBindingInfo::Type::Button, CID_BUTTON5, GenericInputBinding::L2}, + {"L", TRANSLATE_NOOP("USB", "L"), InputBindingInfo::Type::Button, CID_BUTTON6, GenericInputBinding::L1}, + {"R", TRANSLATE_NOOP("USB", "R"), InputBindingInfo::Type::Button, CID_BUTTON7, GenericInputBinding::R1}, + {"Select", TRANSLATE_NOOP("USB", "Select"), InputBindingInfo::Type::Button, CID_BUTTON8, GenericInputBinding::Select}, + {"Start", TRANSLATE_NOOP("USB", "Start"), InputBindingInfo::Type::Button, CID_BUTTON9, GenericInputBinding::Start}, + {"DPadUp", TRANSLATE_NOOP("USB", "D-Pad Up"), InputBindingInfo::Type::Button, CID_DPAD_UP, GenericInputBinding::DPadUp}, + {"DPadDown", TRANSLATE_NOOP("USB", "D-Pad Down"), InputBindingInfo::Type::Button, CID_DPAD_DOWN, GenericInputBinding::DPadDown}, + {"DPadLeft", TRANSLATE_NOOP("USB", "D-Pad Left"), InputBindingInfo::Type::Button, CID_DPAD_LEFT, GenericInputBinding::DPadLeft}, + {"DPadRight", TRANSLATE_NOOP("USB", "D-Pad Right"), InputBindingInfo::Type::Button, CID_DPAD_RIGHT, GenericInputBinding::DPadRight}, }; return bindings; @@ -387,9 +388,11 @@ namespace usb_pad gsl::span SeamicDevice::Settings(u32 subtype) const { static constexpr const SettingInfo info[] = { - {SettingInfo::Type::StringList, "input_device_name", "Input Device", "Selects the device to read audio from.", "", nullptr, - nullptr, nullptr, nullptr, nullptr, &AudioDevice::GetInputDeviceList}, - {SettingInfo::Type::Integer, "input_latency", "Input Latency", "Specifies the latency to the host input device.", + {SettingInfo::Type::StringList, "input_device_name", TRANSLATE_NOOP("USB", "Input Device"), + TRANSLATE_NOOP("USB", "Selects the device to read audio from."), "", nullptr, nullptr, nullptr, nullptr, + nullptr, &AudioDevice::GetInputDeviceList}, + {SettingInfo::Type::Integer, "input_latency", TRANSLATE_NOOP("USB", "Input Latency"), + TRANSLATE_NOOP("USB", "Specifies the latency to the host input device."), AudioDevice::DEFAULT_LATENCY_STR, "1", "1000", "1", "%dms", nullptr, nullptr, 1.0f}, }; return info; diff --git a/pcsx2/USB/usb-printer/usb-printer.cpp b/pcsx2/USB/usb-printer/usb-printer.cpp index e4160eec5c..74c1b950b8 100644 --- a/pcsx2/USB/usb-printer/usb-printer.cpp +++ b/pcsx2/USB/usb-printer/usb-printer.cpp @@ -97,12 +97,14 @@ namespace usb_printer if (!s->print_file) { Host::AddIconOSDMessage("USBPrinterOpen", ICON_FA_EXCLAMATION_TRIANGLE, - fmt::format("Failed to open '{}' for printing.", s->print_filename), Host::OSD_ERROR_DURATION); + fmt::format(TRANSLATE_SV("USB", "Failed to open '{}' for printing."), s->print_filename), + Host::OSD_ERROR_DURATION); return; } Host::AddIconOSDMessage("USBPrinterOpen", ICON_FA_SAVE, - fmt::format("Printer saving to '{}'...", Path::GetFileName(s->print_filename)), Host::OSD_INFO_DURATION); + fmt::format(TRANSLATE_SV("USB", "Printer saving to '{}'..."), Path::GetFileName(s->print_filename)), + Host::OSD_INFO_DURATION); BMPHeader header = {0}; header.magic = 0x4D42; @@ -329,7 +331,7 @@ namespace usb_printer const char* PrinterDevice::Name() const { - return "Printer"; + return TRANSLATE_NOOP("USB", "Printer"); } const char* PrinterDevice::TypeName() const diff --git a/pcsx2/VMManager.cpp b/pcsx2/VMManager.cpp index eb709b4368..4e1f9d960c 100644 --- a/pcsx2/VMManager.cpp +++ b/pcsx2/VMManager.cpp @@ -1541,7 +1541,8 @@ bool VMManager::DoSaveState(const char* filename, s32 slot_for_message, bool zip if (!FileSystem::RenamePath(filename, backup_filename.c_str())) { Host::AddIconOSDMessage(std::move(osd_key), ICON_FA_EXCLAMATION_TRIANGLE, - fmt::format("Failed to back up old save state {}.", Path::GetFileName(filename)), + fmt::format( + TRANSLATE_SV("VMManager", "Failed to back up old save state {}."), Path::GetFileName(filename)), Host::OSD_ERROR_DURATION); } } @@ -1564,7 +1565,8 @@ bool VMManager::DoSaveState(const char* filename, s32 slot_for_message, bool zip catch (Exception::BaseException& e) { Host::AddIconOSDMessage(std::move(osd_key), ICON_FA_EXCLAMATION_TRIANGLE, - fmt::format("Failed to save save state: {}.", e.DiagMsg()), Host::OSD_ERROR_DURATION); + fmt::format(TRANSLATE_SV("VMManager", "Failed to save save state: {}."), e.DiagMsg()), + Host::OSD_ERROR_DURATION); return false; } } @@ -1578,13 +1580,17 @@ void VMManager::ZipSaveState(std::unique_ptr elist, if (SaveState_ZipToDisk(std::move(elist), std::move(screenshot), filename)) { if (slot_for_message >= 0 && VMManager::HasValidVM()) + { Host::AddIconOSDMessage(std::move(osd_key), ICON_FA_SAVE, - fmt::format("State saved to slot {}.", slot_for_message), Host::OSD_QUICK_DURATION); + fmt::format(TRANSLATE_SV("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("Failed to save save state to slot {}.", slot_for_message), Host::OSD_ERROR_DURATION); + fmt::format(TRANSLATE_SV("VMManager", "Failed to save save state to slot {}."), slot_for_message, + Host::OSD_ERROR_DURATION)); } DevCon.WriteLn("Zipping save state to '%s' took %.2f ms", filename, timer.GetTimeMilliseconds()); @@ -1670,7 +1676,8 @@ bool VMManager::LoadStateFromSlot(s32 slot) if (filename.empty()) { Host::AddIconOSDMessage("LoadStateFromSlot", ICON_FA_EXCLAMATION_TRIANGLE, - fmt::format("There is no save state in slot {}.", slot), 5.0f); + fmt::format(TRANSLATE_SV("VMManager", "There is no save state in slot {}."), slot), + Host::OSD_QUICK_DURATION); return false; } @@ -1682,7 +1689,7 @@ bool VMManager::LoadStateFromSlot(s32 slot) #endif Host::AddIconOSDMessage("LoadStateFromSlot", ICON_FA_FOLDER_OPEN, - fmt::format("Loading state from slot {}...", slot), Host::OSD_QUICK_DURATION); + fmt::format(TRANSLATE_SV("VMManager", "Loading state from slot {}..."), slot), Host::OSD_QUICK_DURATION); return DoLoadState(filename.c_str()); } @@ -1698,8 +1705,8 @@ bool VMManager::SaveStateToSlot(s32 slot, bool zip_on_thread) return false; // if it takes more than a minute.. well.. wtf. - Host::AddIconOSDMessage( - fmt::format("SaveStateSlot{}", slot), ICON_FA_SAVE, fmt::format("Saving state to slot {}...", slot), 60.0f); + Host::AddIconOSDMessage(fmt::format("SaveStateSlot{}", slot), ICON_FA_SAVE, + fmt::format(TRANSLATE_SV("VMManager", "Saving state to slot {}..."), slot), 60.0f); return DoSaveState(filename.c_str(), slot, zip_on_thread, EmuConfig.BackupSavestate); } @@ -1760,15 +1767,21 @@ bool VMManager::ChangeDisc(CDVD_SourceType source, std::string path) if (result) { if (source == CDVD_SourceType::NoDisc) - Host::AddIconOSDMessage("ChangeDisc", ICON_FA_COMPACT_DISC, "Disc removed.", Host::OSD_INFO_DURATION); + { + Host::AddIconOSDMessage("ChangeDisc", ICON_FA_COMPACT_DISC, TRANSLATE_SV("VMManager", "Disc removed."), + Host::OSD_INFO_DURATION); + } else + { Host::AddIconOSDMessage("ChangeDisc", ICON_FA_COMPACT_DISC, - fmt::format("Disc changed to '{}'.", display_name), Host::OSD_INFO_DURATION); + fmt::format(TRANSLATE_SV("VMManager", "Disc changed to '{}'."), display_name), Host::OSD_INFO_DURATION); + } } else { Host::AddIconOSDMessage("ChangeDisc", ICON_FA_COMPACT_DISC, - fmt::format("Failed to open new disc image '{}'. Reverting to old image.", display_name), + fmt::format( + TRANSLATE_SV("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()) @@ -1776,7 +1789,8 @@ bool VMManager::ChangeDisc(CDVD_SourceType source, std::string path) if (!DoCDVDopen()) { Host::AddIconOSDMessage("ChangeDisc", ICON_FA_COMPACT_DISC, - "Failed to switch back to old disc image. Removing disc.", Host::OSD_CRITICAL_ERROR_DURATION); + TRANSLATE_SV("VMManager", "Failed to switch back to old disc image. Removing disc."), + Host::OSD_CRITICAL_ERROR_DURATION); CDVDsys_ChangeSource(CDVD_SourceType::NoDisc); DoCDVDopen(); } @@ -2207,7 +2221,8 @@ void VMManager::EnforceAchievementsChallengeModeSettings() if (EmuConfig.EnableCheats) { Host::AddKeyedOSDMessage("ChallengeDisableCheats", - "Cheats have been disabled due to achievements hardcore mode.", Host::OSD_WARNING_DURATION); + TRANSLATE_STR("VMManager", "Cheats have been disabled due to achievements hardcore mode."), + Host::OSD_WARNING_DURATION); EmuConfig.EnableCheats = false; } @@ -2251,52 +2266,95 @@ void VMManager::WarnAboutUnsafeSettings() return; std::string messages; + auto append = [&messages](const char* icon, const std::string_view& msg) + { + messages += icon; + messages += ' '; + messages += msg; + messages += '\n'; + }; if (EmuConfig.Speedhacks.fastCDVD) - messages += ICON_FA_COMPACT_DISC " Fast CDVD is enabled, this may break games.\n"; + append(ICON_FA_COMPACT_DISC, TRANSLATE_SV("VMManager", "Fast CDVD is enabled, this may break games.")); if (EmuConfig.Speedhacks.EECycleRate != 0 || EmuConfig.Speedhacks.EECycleSkip != 0) - messages += - ICON_FA_TACHOMETER_ALT " Cycle rate/skip is not at default, this may crash or make games run too slow.\n"; + { + append(ICON_FA_TACHOMETER_ALT, + TRANSLATE_SV("VMManager", "Cycle rate/skip is not at default, this may crash or make games run too slow.")); + } if (EmuConfig.SPU2.SynchMode == Pcsx2Config::SPU2Options::SynchronizationMode::ASync) - messages += ICON_FA_VOLUME_MUTE " Audio is using async mix, expect desynchronization in FMVs.\n"; + { + append(ICON_FA_VOLUME_MUTE, + TRANSLATE_SV("VMManager", "Audio is using async mix, expect desynchronization in FMVs.")); + } if (EmuConfig.GS.UpscaleMultiplier < 1.0f) - messages += ICON_FA_TV " Upscale multiplier is below native, this will break rendering.\n"; + append(ICON_FA_TV, TRANSLATE_SV("VMManager", "Upscale multiplier is below native, this will break rendering.")); if (EmuConfig.GS.HWMipmap != HWMipmapLevel::Automatic) - messages += ICON_FA_IMAGES " Mipmapping is not set to automatic. This may break rendering in some games.\n"; + { + append(ICON_FA_IMAGES, + TRANSLATE_SV("VMManager", "Mipmapping is not set to automatic. This may break rendering in some games.")); + } if (EmuConfig.GS.TextureFiltering != BiFiltering::PS2) - messages += ICON_FA_FILTER - " Texture filtering is not set to Bilinear (PS2). This will break rendering in some games.\n"; + { + append(ICON_FA_FILTER, + TRANSLATE_SV("VMManager", + "Texture filtering is not set to Bilinear (PS2). This will break rendering in some games.")); + } if (EmuConfig.GS.TriFilter != TriFiltering::Automatic) - messages += - ICON_FA_PAGER " Trilinear filtering is not set to automatic. This may break rendering in some games.\n"; + { + append( + ICON_FA_PAGER, TRANSLATE_SV("VMManager", + "Trilinear filtering is not set to automatic. This may break rendering in some games.")); + } if (EmuConfig.GS.AccurateBlendingUnit <= AccBlendLevel::Minimum) - messages += ICON_FA_BLENDER " Blending is below basic, this may break effects in some games.\n"; + { + append(ICON_FA_BLENDER, + TRANSLATE_SV("VMManager", "Blending is below basic, this may break effects in some games.")); + } if (EmuConfig.GS.HWDownloadMode != GSHardwareDownloadMode::Enabled) - messages += ICON_FA_DOWNLOAD - " Hardware Download Mode is not set to Accurate, this may break rendering in some games.\n"; + { + append(ICON_FA_DOWNLOAD, + TRANSLATE_SV( + "VMManager", "Hardware Download Mode is not set to Accurate, this may break rendering in some games.")); + } if (EmuConfig.Cpu.sseMXCSR.GetRoundMode() != SSEround_Chop) - messages += ICON_FA_MICROCHIP " EE FPU Round Mode is not set to default, this may break some games.\n"; + { + append(ICON_FA_MICROCHIP, + TRANSLATE_SV("VMManager", "EE FPU Round Mode is not set to default, this may break some games.")); + } if (!EmuConfig.Cpu.Recompiler.fpuOverflow || EmuConfig.Cpu.Recompiler.fpuExtraOverflow || EmuConfig.Cpu.Recompiler.fpuFullMode) - messages += ICON_FA_MICROCHIP " EE FPU Clamp Mode is not set to default, this may break some games.\n"; + { + append(ICON_FA_MICROCHIP, + TRANSLATE_SV("VMManager", "EE FPU Clamp Mode is not set to default, this may break some games.")); + } if (EmuConfig.Cpu.sseVU0MXCSR.GetRoundMode() != SSEround_Chop || EmuConfig.Cpu.sseVU1MXCSR.GetRoundMode() != SSEround_Chop) - messages += ICON_FA_MICROCHIP " VU Round Mode is not set to default, this may break some games.\n"; + { + append(ICON_FA_MICROCHIP, + TRANSLATE_SV("VMManager", "VU Round Mode is not set to default, this may break some games.")); + } if (!EmuConfig.Cpu.Recompiler.vu0Overflow || EmuConfig.Cpu.Recompiler.vu0ExtraOverflow || EmuConfig.Cpu.Recompiler.vu0SignOverflow || !EmuConfig.Cpu.Recompiler.vu1Overflow || EmuConfig.Cpu.Recompiler.vu1ExtraOverflow || EmuConfig.Cpu.Recompiler.vu1SignOverflow) { - messages += ICON_FA_MICROCHIP " VU Clamp Mode is not set to default, this may break some games.\n"; + append(ICON_FA_MICROCHIP, + TRANSLATE_SV("VMManager", "VU Clamp Mode is not set to default, this may break some games.")); } if (!EmuConfig.EnableGameFixes) - messages += ICON_FA_GAMEPAD " Game Fixes are not enabled. Compatibility with some games may be affected.\n"; + { + append(ICON_FA_GAMEPAD, + TRANSLATE_SV("VMManager", "Game Fixes are not enabled. Compatibility with some games may be affected.")); + } if (!EmuConfig.EnablePatches) - messages += - ICON_FA_GAMEPAD " Compatibility Patches are not enabled. Compatibility with some games may be affected.\n"; + { + append(ICON_FA_GAMEPAD, + TRANSLATE_SV( + "VMManager", "Compatibility Patches are not enabled. Compatibility with some games may be affected.")); + } if (EmuConfig.GS.FramerateNTSC != Pcsx2Config::GSOptions::DEFAULT_FRAME_RATE_NTSC) - messages += ICON_FA_TV " Frame rate for NTSC is not default. This may break some games.\n"; + append(ICON_FA_TV, TRANSLATE_SV("VMManager", "Frame rate for NTSC is not default. This may break some games.")); if (EmuConfig.GS.FrameratePAL != Pcsx2Config::GSOptions::DEFAULT_FRAME_RATE_PAL) - messages += ICON_FA_TV " Frame rate for PAL is not default. This may break some games.\n"; + append(ICON_FA_TV, TRANSLATE_SV("VMManager", "Frame rate for PAL is not default. This may break some games.")); if (!messages.empty()) { @@ -2313,33 +2371,65 @@ void VMManager::WarnAboutUnsafeSettings() messages.clear(); if (!EmuConfig.Cpu.Recompiler.EnableEE) - messages += - ICON_FA_EXCLAMATION_CIRCLE " EE Recompiler is not enabled, this will significantly reduce performance.\n"; + { + append(ICON_FA_EXCLAMATION_CIRCLE, + TRANSLATE_SV("VMManager", "EE Recompiler is not enabled, this will significantly reduce performance.")); + } if (!EmuConfig.Cpu.Recompiler.EnableVU0) - messages += - ICON_FA_EXCLAMATION_CIRCLE " VU0 Recompiler is not enabled, this will significantly reduce performance.\n"; + { + append(ICON_FA_EXCLAMATION_CIRCLE, + TRANSLATE_SV("VMManager", "VU0 Recompiler is not enabled, this will significantly reduce performance.")); + } if (!EmuConfig.Cpu.Recompiler.EnableVU1) - messages += - ICON_FA_EXCLAMATION_CIRCLE " VU1 Recompiler is not enabled, this will significantly reduce performance.\n"; + { + append(ICON_FA_EXCLAMATION_CIRCLE, + TRANSLATE_SV("VMManager", "VU1 Recompiler is not enabled, this will significantly reduce performance.")); + } if (!EmuConfig.Cpu.Recompiler.EnableIOP) - messages += - ICON_FA_EXCLAMATION_CIRCLE " IOP Recompiler is not enabled, this will significantly reduce performance.\n"; + { + append(ICON_FA_EXCLAMATION_CIRCLE, + TRANSLATE_SV("VMManager", "IOP Recompiler is not enabled, this will significantly reduce performance.")); + } if (EmuConfig.Cpu.Recompiler.EnableEECache) - messages += ICON_FA_EXCLAMATION_CIRCLE " EE Cache is enabled, this will significantly reduce performance.\n"; + { + append(ICON_FA_EXCLAMATION_CIRCLE, + TRANSLATE_SV("VMManager", "EE Cache is enabled, this will significantly reduce performance.")); + } if (!EmuConfig.Speedhacks.WaitLoop) - messages += ICON_FA_EXCLAMATION_CIRCLE " EE Wait Loop Detection is not enabled, this may reduce performance.\n"; + { + append(ICON_FA_EXCLAMATION_CIRCLE, + TRANSLATE_SV("VMManager", "EE Wait Loop Detection is not enabled, this may reduce performance.")); + } if (!EmuConfig.Speedhacks.IntcStat) - messages += ICON_FA_EXCLAMATION_CIRCLE " INTC Spin Detection is not enabled, this may reduce performance.\n"; + { + append(ICON_FA_EXCLAMATION_CIRCLE, + TRANSLATE_SV("VMManager", "INTC Spin Detection is not enabled, this may reduce performance.")); + } if (!EmuConfig.Speedhacks.vu1Instant) - messages += ICON_FA_EXCLAMATION_CIRCLE " Instant VU1 is disabled, this may reduce performance.\n"; + { + append(ICON_FA_EXCLAMATION_CIRCLE, + TRANSLATE_SV("VMManager", "Instant VU1 is disabled, this may reduce performance.")); + } if (!EmuConfig.Speedhacks.vuFlagHack) - messages += ICON_FA_EXCLAMATION_CIRCLE " mVU Flag Hack is not enabled, this may reduce performance.\n"; + { + append(ICON_FA_EXCLAMATION_CIRCLE, + TRANSLATE_SV("VMManager", "mVU Flag Hack is not enabled, this may reduce performance.")); + } if (EmuConfig.GS.GPUPaletteConversion) - messages += ICON_FA_EXCLAMATION_CIRCLE " GPU Palette Conversion is enabled, this may reduce performance.\n"; + { + append(ICON_FA_EXCLAMATION_CIRCLE, + TRANSLATE_SV("VMManager", "GPU Palette Conversion is enabled, this may reduce performance.")); + } if (EmuConfig.GS.TexturePreloading != TexturePreloadingLevel::Full) - messages += ICON_FA_EXCLAMATION_CIRCLE " Texture Preloading is not Full, this may reduce performance.\n"; + { + append(ICON_FA_EXCLAMATION_CIRCLE, + TRANSLATE_SV("VMManager", "Texture Preloading is not Full, this may reduce performance.")); + } if (EmuConfig.GS.UserHacks_EstimateTextureRegion) - messages += ICON_FA_EXCLAMATION_CIRCLE " Estimate texture region is enabled, this may reduce performance.\n"; + { + append(ICON_FA_EXCLAMATION_CIRCLE, + TRANSLATE_SV("VMManager", "Estimate texture region is enabled, this may reduce performance.")); + } if (!messages.empty()) {