USB: Fix some default strings not being translatable

This commit is contained in:
Stenzek 2023-06-30 22:52:41 +10:00 committed by Connor McLaughlin
parent 82cecc89e2
commit 4192de7dac
3 changed files with 8 additions and 7 deletions

View File

@ -1027,7 +1027,7 @@ void USBDeviceWidget::onAutomaticBindingClicked()
void USBDeviceWidget::onClearBindingsClicked()
{
if (QMessageBox::question(QtUtils::GetRootWidget(this), tr("Clear Bindings"),
tr("Are you sure you want to clear all bindings for this controller? This action cannot be undone.")) != QMessageBox::Yes)
tr("Are you sure you want to clear all bindings for this device? This action cannot be undone.")) != QMessageBox::Yes)
{
return;
}

View File

@ -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() : TRANSLATE("USB", "None");
return proxy ? proxy->TypeName() : TRANSLATE_NOOP("USB", "None");
}
std::vector<std::pair<const char*, const char*>> USB::GetDeviceTypes()
@ -558,7 +558,7 @@ std::vector<std::pair<const char*, const char*>> USB::GetDeviceTypes()
RegisterDevice& rd = RegisterDevice::instance();
std::vector<std::pair<const char*, const char*>> ret;
ret.reserve(rd.Map().size() + 1);
ret.emplace_back("None", TRANSLATE("USB", "Not Connected"));
ret.emplace_back("None", TRANSLATE_NOOP("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<std::pair<const char*, const char*>> USB::GetDeviceTypes()
const char* USB::GetDeviceName(const std::string_view& device)
{
const DeviceProxy* dev = RegisterDevice::instance().Device(device);
return dev ? dev->Name() : TRANSLATE("USB", "Not Connected");
return dev ? dev->Name() : TRANSLATE_NOOP("USB", "Not Connected");
}
const char* USB::GetDeviceSubtypeName(const std::string_view& device, u32 subtype)

View File

@ -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-
@ -15,6 +15,7 @@
#include "USB/usb-mic/audiodev-cubeb.h"
#include "USB/USB.h"
#include "Host.h"
#include "common/Assertions.h"
#include "common/Console.h"
@ -117,8 +118,8 @@ namespace usb_mic
std::vector<std::pair<std::string, std::string>> CubebAudioDevice::GetDeviceList(bool input)
{
std::vector<std::pair<std::string, std::string>> ret;
ret.emplace_back("", "Not Connected");
ret.emplace_back("cubeb_default", input ? "Default Input Device" : "Default Output Device");
ret.emplace_back("", TRANSLATE_SV("USB", "Not Connected"));
ret.emplace_back("cubeb_default", input ? TRANSLATE_SV("USB", "Default Input Device") : TRANSLATE_SV("USB", "Default Output Device"));
if (GetCubebContext())
{
const cubeb_device_collection& col = input ? s_cubeb_input_devices : s_cubeb_output_devices;