mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-04-10 19:15:13 +00:00
Added localization support to parts of the application
This commit is contained in:
parent
c8259aa792
commit
062288ad07
|
@ -720,22 +720,26 @@ void GuiMenu::openUIOptions()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (selectedMode != "full") {
|
else if (selectedMode != "full") {
|
||||||
std::string msg {"YOU ARE CHANGING THE UI TO THE RESTRICTED MODE\n'" +
|
std::string msg;
|
||||||
Utils::String::toUpper(selectedMode) + "'\n"};
|
|
||||||
if (selectedMode == "kiosk") {
|
if (selectedMode == "kiosk") {
|
||||||
msg.append("THIS WILL HIDE MOST MENU OPTIONS TO PREVENT\n");
|
msg = Utils::String::format(
|
||||||
msg.append("CHANGES TO THE SYSTEM\n");
|
_("THIS CHANGES THE UI TO THE RESTRICTED MODE\n'KIOSK'\n"
|
||||||
|
"THIS WILL HIDE MOST MENU OPTIONS\n"
|
||||||
|
"TO UNLOCK AND RETURN TO THE FULL UI, ENTER THIS CODE:\n%s\n\n"
|
||||||
|
"DO YOU WANT TO PROCEED?"),
|
||||||
|
UIModeController::getInstance()->getFormattedPassKeyStr().c_str());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
msg.append("THIS WILL LIMIT THE AVAILABLE GAMES TO THE ONES\n");
|
msg = Utils::String::format(
|
||||||
msg.append("FLAGGED SUITABLE FOR CHILDREN\n");
|
_("THIS CHANGES THE UI TO THE RESTRICTED MODE\n'KID'\n"
|
||||||
|
"THIS ONLY ENABLES GAMES THAT HAVE BEEN FLAGGED\n"
|
||||||
|
"AS SUITABLE FOR CHILDREN\n"
|
||||||
|
"TO UNLOCK AND RETURN TO THE FULL UI, ENTER THIS CODE:\n%s\n\n"
|
||||||
|
"DO YOU WANT TO PROCEED?"),
|
||||||
|
UIModeController::getInstance()->getFormattedPassKeyStr().c_str());
|
||||||
}
|
}
|
||||||
msg.append("TO UNLOCK AND RETURN TO THE FULL UI, ENTER THIS CODE: \n")
|
|
||||||
.append(UIModeController::getInstance()->getFormattedPassKeyStr())
|
|
||||||
.append("\n\n")
|
|
||||||
.append("DO YOU WANT TO PROCEED?");
|
|
||||||
mWindow->pushGui(new GuiMsgBox(
|
mWindow->pushGui(new GuiMsgBox(
|
||||||
this->getHelpStyle(), msg, "YES",
|
this->getHelpStyle(), msg, _("YES"),
|
||||||
[this, selectedMode] {
|
[this, selectedMode] {
|
||||||
LOG(LogDebug) << "GuiMenu::openUISettings(): Setting UI mode to '"
|
LOG(LogDebug) << "GuiMenu::openUISettings(): Setting UI mode to '"
|
||||||
<< selectedMode << "'.";
|
<< selectedMode << "'.";
|
||||||
|
@ -762,7 +766,7 @@ void GuiMenu::openUIOptions()
|
||||||
false);
|
false);
|
||||||
mWindow->invalidateCachedBackground();
|
mWindow->invalidateCachedBackground();
|
||||||
},
|
},
|
||||||
"NO", nullptr, "", nullptr, nullptr, true));
|
_("NO"), nullptr, "", nullptr, nullptr, true));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LOG(LogDebug) << "GuiMenu::openUISettings(): Setting UI mode to '" << selectedMode
|
LOG(LogDebug) << "GuiMenu::openUISettings(): Setting UI mode to '" << selectedMode
|
||||||
|
|
|
@ -322,12 +322,21 @@ private:
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
|
|
||||||
// For special situations, allow the "selected" text to be overridden to a custom value.
|
// For special situations, allow the "selected" text to be overridden to a custom value.
|
||||||
if (mOverrideMultiText != "")
|
if (mOverrideMultiText != "") {
|
||||||
ss << mOverrideMultiText;
|
ss << mOverrideMultiText;
|
||||||
else if (mMultiShowTotal)
|
}
|
||||||
ss << getSelectedObjects().size() << " (OF " << mEntries.size() << ") SELECTED";
|
else if (mMultiShowTotal) {
|
||||||
else
|
const std::string numString {Utils::String::format(
|
||||||
ss << getSelectedObjects().size() << " SELECTED";
|
_("%i (OF %i)"), getSelectedObjects().size(), mEntries.size())};
|
||||||
|
ss << Utils::String::format(
|
||||||
|
_n("%s SELECTED", "%s SELECTED", getSelectedObjects().size()),
|
||||||
|
numString.c_str());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ss << Utils::String::format(
|
||||||
|
_n("%i SELECTED", "%i SELECTED", getSelectedObjects().size()),
|
||||||
|
getSelectedObjects().size());
|
||||||
|
}
|
||||||
|
|
||||||
mText.setText(ss.str());
|
mText.setText(ss.str());
|
||||||
mText.setSize(0, mText.getSize().y);
|
mText.setSize(0, mText.getSize().y);
|
||||||
|
|
|
@ -40,41 +40,6 @@
|
||||||
#include "guis/GuiMsgBox.h"
|
#include "guis/GuiMsgBox.h"
|
||||||
#include "utils/StringUtil.h"
|
#include "utils/StringUtil.h"
|
||||||
|
|
||||||
// clang-format off
|
|
||||||
std::vector<std::vector<std::string>> kbBaseUS {
|
|
||||||
{"1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "DEL"},
|
|
||||||
{"!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "+", "DEL"},
|
|
||||||
{"¡", "²", "³", "¤", "€", "¼", "½", "¾", "‘", "’", "¥", "×", "DEL"},
|
|
||||||
{"¹", "", "", "£", "", "", "", "", "", "", "", "÷", "DEL"},
|
|
||||||
|
|
||||||
{"q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "[", "]", "OK"},
|
|
||||||
{"Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "{", "}", "OK"},
|
|
||||||
{"ä", "å", "é", "®", "þ", "ü", "ú", "í", "ó", "ö", "«", "»", "OK"},
|
|
||||||
{"Ä", "Å", "É", "", "Þ", "Ü", "Ú", "Í", "Ó", "Ö", "", "", "OK"},
|
|
||||||
|
|
||||||
{"a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'", "\\", "-rowspan-"},
|
|
||||||
{"A", "S", "D", "F", "G", "H", "J", "K", "L", ":", "\"", "|", "-rowspan-"},
|
|
||||||
{"á", "ß", "ð", "", "", "", "", "", "ø", "¶", "´", "¬", "-rowspan-"},
|
|
||||||
{"Á", "§", "Ð", "", "", "", "", "", "Ø", "°", "¨", "¦", "-rowspan-"},
|
|
||||||
|
|
||||||
{"`", "z", "x", "c", "v", "b", "n", "m", ",", ".", "/", "ALT", "-colspan-"},
|
|
||||||
{"~", "Z", "X", "C", "V", "B", "N", "M", "<", ">", "?", "ALT", "-colspan-"},
|
|
||||||
{"", "æ", "", "©", "", "", "ñ", "µ", "ç", "", "¿", "ALT", "-colspan-"},
|
|
||||||
{"", "Æ", "", "¢", "", "", "Ñ", "Μ", "Ç", "", "", "ALT", "-colspan-"}};
|
|
||||||
|
|
||||||
std::vector<std::vector<std::string>> kbLastRowNormal {
|
|
||||||
{"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"},
|
|
||||||
{"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"},
|
|
||||||
{"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"},
|
|
||||||
{"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}};
|
|
||||||
|
|
||||||
std::vector<std::vector<std::string>> kbLastRowLoad {
|
|
||||||
{"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "LOAD", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"},
|
|
||||||
{"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "LOAD", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"},
|
|
||||||
{"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "LOAD", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"},
|
|
||||||
{"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "LOAD", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}};
|
|
||||||
// clang-format on
|
|
||||||
|
|
||||||
GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup(
|
GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup(
|
||||||
const HelpStyle& helpstyle,
|
const HelpStyle& helpstyle,
|
||||||
const float verticalPosition,
|
const float verticalPosition,
|
||||||
|
@ -111,6 +76,41 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup(
|
||||||
, mNavigationRepeatDirX {0}
|
, mNavigationRepeatDirX {0}
|
||||||
, mNavigationRepeatDirY {0}
|
, mNavigationRepeatDirY {0}
|
||||||
{
|
{
|
||||||
|
// clang-format off
|
||||||
|
std::vector<std::vector<std::string>> kbBaseUS {
|
||||||
|
{"1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "DEL"},
|
||||||
|
{"!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "+", "DEL"},
|
||||||
|
{"¡", "²", "³", "¤", "€", "¼", "½", "¾", "‘", "’", "¥", "×", "DEL"},
|
||||||
|
{"¹", "", "", "£", "", "", "", "", "", "", "", "÷", "DEL"},
|
||||||
|
|
||||||
|
{"q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "[", "]", "OK"},
|
||||||
|
{"Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "{", "}", "OK"},
|
||||||
|
{"ä", "å", "é", "®", "þ", "ü", "ú", "í", "ó", "ö", "«", "»", "OK"},
|
||||||
|
{"Ä", "Å", "É", "", "Þ", "Ü", "Ú", "Í", "Ó", "Ö", "", "", "OK"},
|
||||||
|
|
||||||
|
{"a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'", "\\", "-rowspan-"},
|
||||||
|
{"A", "S", "D", "F", "G", "H", "J", "K", "L", ":", "\"", "|", "-rowspan-"},
|
||||||
|
{"á", "ß", "ð", "", "", "", "", "", "ø", "¶", "´", "¬", "-rowspan-"},
|
||||||
|
{"Á", "§", "Ð", "", "", "", "", "", "Ø", "°", "¨", "¦", "-rowspan-"},
|
||||||
|
|
||||||
|
{"`", "z", "x", "c", "v", "b", "n", "m", ",", ".", "/", "ALT", "-colspan-"},
|
||||||
|
{"~", "Z", "X", "C", "V", "B", "N", "M", "<", ">", "?", "ALT", "-colspan-"},
|
||||||
|
{"", "æ", "", "©", "", "", "ñ", "µ", "ç", "", "¿", "ALT", "-colspan-"},
|
||||||
|
{"", "Æ", "", "¢", "", "", "Ñ", "Μ", "Ç", "", "", "ALT", "-colspan-"}};
|
||||||
|
|
||||||
|
std::vector<std::vector<std::string>> kbLastRowNormal {
|
||||||
|
{"SHIFT", "-colspan-", _("SPACE"), "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", _("CLEAR"), "-colspan-", _("CANCEL"), "-colspan-"},
|
||||||
|
{"SHIFT", "-colspan-", _("SPACE"), "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", _("CLEAR"), "-colspan-", _("CANCEL"), "-colspan-"},
|
||||||
|
{"SHIFT", "-colspan-", _("SPACE"), "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", _("CLEAR"), "-colspan-", _("CANCEL"), "-colspan-"},
|
||||||
|
{"SHIFT", "-colspan-", _("SPACE"), "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", _("CLEAR"), "-colspan-", _("CANCEL"), "-colspan-"}};
|
||||||
|
|
||||||
|
std::vector<std::vector<std::string>> kbLastRowLoad {
|
||||||
|
{"SHIFT", "-colspan-", _("SPACE"), "-colspan-", "-colspan-", "-colspan-", "-colspan-", _("LOAD"), "-colspan-", _("CLEAR"), "-colspan-", _("CANCEL"), "-colspan-"},
|
||||||
|
{"SHIFT", "-colspan-", _("SPACE"), "-colspan-", "-colspan-", "-colspan-", "-colspan-", _("LOAD"), "-colspan-", _("CLEAR"), "-colspan-", _("CANCEL"), "-colspan-"},
|
||||||
|
{"SHIFT", "-colspan-", _("SPACE"), "-colspan-", "-colspan-", "-colspan-", "-colspan-", _("LOAD"), "-colspan-", _("CLEAR"), "-colspan-", _("CANCEL"), "-colspan-"},
|
||||||
|
{"SHIFT", "-colspan-", _("SPACE"), "-colspan-", "-colspan-", "-colspan-", "-colspan-", _("LOAD"), "-colspan-", _("CLEAR"), "-colspan-", _("CANCEL"), "-colspan-"}};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
addChild(&mBackground);
|
addChild(&mBackground);
|
||||||
addChild(&mGrid);
|
addChild(&mGrid);
|
||||||
|
|
||||||
|
@ -185,7 +185,7 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup(
|
||||||
alted = OK_SYMBOL;
|
alted = OK_SYMBOL;
|
||||||
altshifted = OK_SYMBOL;
|
altshifted = OK_SYMBOL;
|
||||||
}
|
}
|
||||||
else if (lower == "SPACE") {
|
else if (lower == _("SPACE")) {
|
||||||
lower = " ";
|
lower = " ";
|
||||||
upper = " ";
|
upper = " ";
|
||||||
alted = " ";
|
alted = " ";
|
||||||
|
@ -515,12 +515,12 @@ std::vector<HelpPrompt> GuiTextEditKeyboardPopup::getHelpPrompts()
|
||||||
if (prompts.size() > 0 && prompts.front().second == OK_SYMBOL)
|
if (prompts.size() > 0 && prompts.front().second == OK_SYMBOL)
|
||||||
prompts.front().second = mAcceptBtnHelpText;
|
prompts.front().second = mAcceptBtnHelpText;
|
||||||
else if (prompts.size() > 0 && prompts.front().second == " ")
|
else if (prompts.size() > 0 && prompts.front().second == " ")
|
||||||
prompts.front().second = "SPACE";
|
prompts.front().second = _("SPACE");
|
||||||
else if (prompts.size() > 0 && prompts.front().second == "CLEAR")
|
else if (prompts.size() > 0 && prompts.front().second == _("CLEAR"))
|
||||||
prompts.front().second = mClearBtnHelpText;
|
prompts.front().second = mClearBtnHelpText;
|
||||||
else if (prompts.size() > 0 && prompts.front().second == "LOAD")
|
else if (prompts.size() > 0 && prompts.front().second == _("LOAD"))
|
||||||
prompts.front().second = mLoadBtnHelpText;
|
prompts.front().second = mLoadBtnHelpText;
|
||||||
else if (prompts.size() > 0 && prompts.front().second == "CANCEL")
|
else if (prompts.size() > 0 && prompts.front().second == _("CANCEL"))
|
||||||
prompts.front().second = mCancelBtnHelpText;
|
prompts.front().second = mCancelBtnHelpText;
|
||||||
|
|
||||||
// If a prompt has no value set, then remove it.
|
// If a prompt has no value set, then remove it.
|
||||||
|
@ -677,22 +677,22 @@ std::shared_ptr<ButtonComponent> GuiTextEditKeyboardPopup::makeButton(
|
||||||
mText->stopEditing();
|
mText->stopEditing();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (key == "SPACE" || key == " ") {
|
else if (key == _("SPACE") || key == " ") {
|
||||||
mText->startEditing();
|
mText->startEditing();
|
||||||
mText->textInput(" ");
|
mText->textInput(" ");
|
||||||
mText->stopEditing();
|
mText->stopEditing();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (key == "LOAD") {
|
else if (key == _("LOAD")) {
|
||||||
mText->setValue(mDefaultValue->getValue());
|
mText->setValue(mDefaultValue->getValue());
|
||||||
mText->setCursor(mDefaultValue->getValue().size());
|
mText->setCursor(mDefaultValue->getValue().size());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (key == "CLEAR") {
|
else if (key == _("CLEAR")) {
|
||||||
mText->setValue("");
|
mText->setValue("");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (key == "CANCEL") {
|
else if (key == _("CANCEL")) {
|
||||||
delete this;
|
delete this;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue