summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerEmu/ControlGroup
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2018-03-30 21:42:26 +0200
committerJosJuice <josjuice@gmail.com>2018-04-13 13:04:26 +0200
commit3f13dbe0878523b65d158efddc3eff37d59ca3a2 (patch)
treecaefeb5190e80d1615aa7036ef6811fb84cf126e /Source/Core/InputCommon/ControllerEmu/ControlGroup
parent71dd2d9d4c2fe7230445d89a398e15b0af0cfcaf (diff)
Translate certain button names but not all
Some button names should be translated, for instance Up, Left and such. At the same time, some other button names shouldn't be translated, for reasons that might be less obvious. In 0146456af, I removed the _trans markers for button names that never need to be translated (such as A and B), but that isn't actually enough to ensure that DolphinWX won't try to translate them anyway. This commit adds a bool that explicitly tells the GUI whether a button name should be translated. Otherwise we'll have problems like the GUI treating the button name "B" (which isn't supposed to be translated) as matching the translatable string "B" (being an abbreviation of "bytes"), meaning that the button "B" will be labeled "o" when running Dolphin in French (after translations get pulled from Transifex the next time). By the way, while it turned out that DolphinWX translated all button names, it also turned out that DolphinQt2 translated *no* button names. Go figure. This commit makes them consistent with each other.
Diffstat (limited to 'Source/Core/InputCommon/ControllerEmu/ControlGroup')
-rw-r--r--Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.cpp4
-rw-r--r--Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp10
-rw-r--r--Source/Core/InputCommon/ControllerEmu/ControlGroup/Force.cpp12
-rw-r--r--Source/Core/InputCommon/ControllerEmu/ControlGroup/ModifySettingsButton.cpp2
-rw-r--r--Source/Core/InputCommon/ControllerEmu/ControlGroup/Slider.cpp4
-rw-r--r--Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.cpp10
6 files changed, 21 insertions, 21 deletions
diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.cpp b/Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.cpp
index 2b7430dcbf..9ca3a70eb2 100644
--- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.cpp
+++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/AnalogStick.cpp
@@ -28,9 +28,9 @@ AnalogStick::AnalogStick(const char* const name_, const char* const ui_name_,
: ControlGroup(name_, ui_name_, GroupType::Stick)
{
for (auto& named_direction : named_directions)
- controls.emplace_back(std::make_unique<Input>(named_direction));
+ controls.emplace_back(std::make_unique<Input>(true, named_direction));
- controls.emplace_back(std::make_unique<Input>(_trans("Modifier")));
+ controls.emplace_back(std::make_unique<Input>(true, _trans("Modifier")));
numeric_settings.emplace_back(
std::make_unique<NumericSetting>(_trans("Radius"), default_radius, 0, 100));
numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Dead Zone"), 0, 0, 50));
diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp
index 3467205ccf..2ee8e146f4 100644
--- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp
+++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Cursor.cpp
@@ -24,12 +24,12 @@ namespace ControllerEmu
Cursor::Cursor(const std::string& name_) : ControlGroup(name_, GroupType::Cursor)
{
for (auto& named_direction : named_directions)
- controls.emplace_back(std::make_unique<Input>(named_direction));
+ controls.emplace_back(std::make_unique<Input>(true, named_direction));
- controls.emplace_back(std::make_unique<Input>(_trans("Forward")));
- controls.emplace_back(std::make_unique<Input>(_trans("Backward")));
- controls.emplace_back(std::make_unique<Input>(_trans("Hide")));
- controls.emplace_back(std::make_unique<Input>(_trans("Recenter")));
+ controls.emplace_back(std::make_unique<Input>(true, _trans("Forward")));
+ controls.emplace_back(std::make_unique<Input>(true, _trans("Backward")));
+ controls.emplace_back(std::make_unique<Input>(true, _trans("Hide")));
+ controls.emplace_back(std::make_unique<Input>(true, _trans("Recenter")));
numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Center"), 0.5));
numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Width"), 0.5));
diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Force.cpp b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Force.cpp
index a825ce51c9..c620bd787a 100644
--- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Force.cpp
+++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Force.cpp
@@ -19,12 +19,12 @@ namespace ControllerEmu
{
Force::Force(const std::string& name_) : ControlGroup(name_, GroupType::Force)
{
- controls.emplace_back(std::make_unique<Input>(_trans("Up")));
- controls.emplace_back(std::make_unique<Input>(_trans("Down")));
- controls.emplace_back(std::make_unique<Input>(_trans("Left")));
- controls.emplace_back(std::make_unique<Input>(_trans("Right")));
- controls.emplace_back(std::make_unique<Input>(_trans("Forward")));
- controls.emplace_back(std::make_unique<Input>(_trans("Backward")));
+ controls.emplace_back(std::make_unique<Input>(true, _trans("Up")));
+ controls.emplace_back(std::make_unique<Input>(true, _trans("Down")));
+ controls.emplace_back(std::make_unique<Input>(true, _trans("Left")));
+ controls.emplace_back(std::make_unique<Input>(true, _trans("Right")));
+ controls.emplace_back(std::make_unique<Input>(true, _trans("Forward")));
+ controls.emplace_back(std::make_unique<Input>(true, _trans("Backward")));
numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Dead Zone"), 0, 0, 50));
}
diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/ModifySettingsButton.cpp b/Source/Core/InputCommon/ControllerEmu/ControlGroup/ModifySettingsButton.cpp
index a534b7904f..943a0bae85 100644
--- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/ModifySettingsButton.cpp
+++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/ModifySettingsButton.cpp
@@ -27,7 +27,7 @@ ModifySettingsButton::ModifySettingsButton(std::string button_name)
void ModifySettingsButton::AddInput(std::string button_name, bool toggle)
{
- controls.emplace_back(new Input(std::move(button_name)));
+ controls.emplace_back(std::make_unique<Input>(true, std::move(button_name)));
threshold_exceeded.emplace_back(false);
associated_settings.emplace_back(false);
associated_settings_toggle.emplace_back(toggle);
diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Slider.cpp b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Slider.cpp
index b5e7ff5a1a..f04508e011 100644
--- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Slider.cpp
+++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Slider.cpp
@@ -20,8 +20,8 @@ namespace ControllerEmu
Slider::Slider(const std::string& name_, const std::string& ui_name_)
: ControlGroup(name_, ui_name_, GroupType::Slider)
{
- controls.emplace_back(std::make_unique<Input>("Left"));
- controls.emplace_back(std::make_unique<Input>("Right"));
+ controls.emplace_back(std::make_unique<Input>(true, _trans("Left")));
+ controls.emplace_back(std::make_unique<Input>(true, _trans("Right")));
numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Dead Zone"), 0, 0, 50));
}
diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.cpp b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.cpp
index 72bc258976..94d3538685 100644
--- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.cpp
+++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Tilt.cpp
@@ -19,12 +19,12 @@ namespace ControllerEmu
{
Tilt::Tilt(const std::string& name_) : ControlGroup(name_, GroupType::Tilt)
{
- controls.emplace_back(std::make_unique<Input>(_trans("Forward")));
- controls.emplace_back(std::make_unique<Input>(_trans("Backward")));
- controls.emplace_back(std::make_unique<Input>(_trans("Left")));
- controls.emplace_back(std::make_unique<Input>(_trans("Right")));
+ controls.emplace_back(std::make_unique<Input>(true, _trans("Forward")));
+ controls.emplace_back(std::make_unique<Input>(true, _trans("Backward")));
+ controls.emplace_back(std::make_unique<Input>(true, _trans("Left")));
+ controls.emplace_back(std::make_unique<Input>(true, _trans("Right")));
- controls.emplace_back(std::make_unique<Input>(_trans("Modifier")));
+ controls.emplace_back(std::make_unique<Input>(true, _trans("Modifier")));
numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Dead Zone"), 0, 0, 50));
numeric_settings.emplace_back(std::make_unique<NumericSetting>(_trans("Circle Stick"), 0));