Permalink
Browse files

Merge pull request #9909 from vnctdj/hFileStringI18n

Make some strings in .h files translatable
  • Loading branch information...
hrydgard committed Aug 18, 2017
2 parents e8a81df + 7f37c40 commit d1685954c5e1930fc1e330f14e44ec59387cc14d
Showing with 17 additions and 10 deletions.
  1. +8 −4 UI/ControlMappingScreen.cpp
  2. +5 −4 UI/ControlMappingScreen.h
  3. +2 −1 UI/DevScreens.h
  4. +2 −1 UI/EmuScreen.cpp
@@ -182,25 +182,29 @@ void ControlMapper::MappedCallback(KeyDef kdf) {
UI::EventReturn ControlMapper::OnReplace(UI::EventParams &params) {
actionIndex_ = atoi(params.v->Tag().c_str());
action_ = REPLACEONE;
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&ControlMapper::MappedCallback, this, std::placeholders::_1)));
I18NCategory *km = GetI18NCategory("KeyMapping");
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&ControlMapper::MappedCallback, this, std::placeholders::_1), km));
return UI::EVENT_DONE;
}
UI::EventReturn ControlMapper::OnReplaceAll(UI::EventParams &params) {
action_ = REPLACEALL;
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&ControlMapper::MappedCallback, this, std::placeholders::_1)));
I18NCategory *km = GetI18NCategory("KeyMapping");
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&ControlMapper::MappedCallback, this, std::placeholders::_1), km));
return UI::EVENT_DONE;
}
UI::EventReturn ControlMapper::OnAdd(UI::EventParams &params) {
action_ = ADD;
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&ControlMapper::MappedCallback, this, std::placeholders::_1)));
I18NCategory *km = GetI18NCategory("KeyMapping");
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&ControlMapper::MappedCallback, this, std::placeholders::_1), km));
return UI::EVENT_DONE;
}
UI::EventReturn ControlMapper::OnAddMouse(UI::EventParams &params) {
action_ = ADD;
g_Config.bMapMouse = true;
scrm_->push(new KeyMappingNewMouseKeyDialog(pspKey_, true, std::bind(&ControlMapper::MappedCallback, this, std::placeholders::_1)));
I18NCategory *km = GetI18NCategory("KeyMapping");
scrm_->push(new KeyMappingNewMouseKeyDialog(pspKey_, true, std::bind(&ControlMapper::MappedCallback, this, std::placeholders::_1), km));
return UI::EVENT_DONE;
}
@@ -21,6 +21,7 @@
#include <vector>
#include <mutex>
#include "i18n/i18n.h"
#include "ui/view.h"
#include "ui/ui_screen.h"
@@ -49,8 +50,8 @@ class ControlMappingScreen : public UIDialogScreenWithBackground {
class KeyMappingNewKeyDialog : public PopupScreen {
public:
explicit KeyMappingNewKeyDialog(int btn, bool replace, std::function<void(KeyDef)> callback)
: PopupScreen("Map Key", "Cancel", ""), callback_(callback), mapped_(false) {
explicit KeyMappingNewKeyDialog(int btn, bool replace, std::function<void(KeyDef)> callback, I18NCategory *i18n)
: PopupScreen(i18n->T("Map Key"), "Cancel", ""), callback_(callback), mapped_(false) {
pspBtn_ = btn;
}
@@ -72,8 +73,8 @@ class KeyMappingNewKeyDialog : public PopupScreen {
class KeyMappingNewMouseKeyDialog : public PopupScreen {
public:
explicit KeyMappingNewMouseKeyDialog(int btn, bool replace, std::function<void(KeyDef)> callback)
: PopupScreen("Map Mouse", "", ""), callback_(callback), mapped_(false) {
explicit KeyMappingNewMouseKeyDialog(int btn, bool replace, std::function<void(KeyDef)> callback, I18NCategory *i18n)
: PopupScreen(i18n->T("Map Mouse"), "", ""), callback_(callback), mapped_(false) {
pspBtn_ = btn;
}
View
@@ -23,14 +23,15 @@
#include <vector>
#include "file/file_util.h"
#include "i18n/i18n.h"
#include "ui/ui_screen.h"
#include "UI/MiscScreens.h"
#include "GPU/Common/ShaderCommon.h"
class DevMenu : public PopupScreen {
public:
DevMenu() : PopupScreen("Dev Tools") {}
DevMenu(I18NCategory *i18n) : PopupScreen(i18n->T("Dev Tools")) {}
void CreatePopupContents(UI::ViewGroup *parent) override;
void dialogFinished(const Screen *dialog, DialogResult result) override;
View
@@ -787,7 +787,8 @@ void EmuScreen::CreateViews() {
UI::EventReturn EmuScreen::OnDevTools(UI::EventParams &params) {
releaseButtons();
DevMenu *devMenu = new DevMenu();
I18NCategory *dev = GetI18NCategory("Developer");
DevMenu *devMenu = new DevMenu(dev);
if (params.v)
devMenu->SetPopupOrigin(params.v);
screenManager()->push(devMenu);

0 comments on commit d168595

Please sign in to comment.