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
f6db47510d
commit
be95b494dc
|
@ -275,6 +275,7 @@ namespace FileSorts
|
||||||
return system1.compare(system2) > 0;
|
return system1.compare(system2) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(GETTEXT_DUMMY_ENTRIES)
|
||||||
void gettextMessageCatalogEntries()
|
void gettextMessageCatalogEntries()
|
||||||
{
|
{
|
||||||
_("name, ascending");
|
_("name, ascending");
|
||||||
|
@ -298,5 +299,6 @@ namespace FileSorts
|
||||||
_("system, ascending");
|
_("system, ascending");
|
||||||
_("system, descending");
|
_("system, descending");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace FileSorts
|
} // namespace FileSorts
|
||||||
|
|
|
@ -37,8 +37,10 @@ namespace FileSorts
|
||||||
bool compareSystem(const FileData* file1, const FileData* file2);
|
bool compareSystem(const FileData* file1, const FileData* file2);
|
||||||
bool compareSystemDescending(const FileData* file1, const FileData* file2);
|
bool compareSystemDescending(const FileData* file1, const FileData* file2);
|
||||||
|
|
||||||
|
#if defined(GETTEXT_DUMMY_ENTRIES)
|
||||||
// This is just to get gettext msgid entries added to the PO message catalog files.
|
// This is just to get gettext msgid entries added to the PO message catalog files.
|
||||||
void gettextMessageCatalogEntries();
|
void gettextMessageCatalogEntries();
|
||||||
|
#endif
|
||||||
|
|
||||||
extern const std::vector<FileData::SortType> SortTypes;
|
extern const std::vector<FileData::SortType> SortTypes;
|
||||||
} // namespace FileSorts
|
} // namespace FileSorts
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#include "utils/FileSystemUtil.h"
|
#include "utils/FileSystemUtil.h"
|
||||||
|
#include "utils/LocalizationUtil.h"
|
||||||
|
|
||||||
#include <pugixml.hpp>
|
#include <pugixml.hpp>
|
||||||
|
|
||||||
|
@ -21,50 +22,50 @@ namespace
|
||||||
// saving the values in GuiMetaDataEd.
|
// saving the values in GuiMetaDataEd.
|
||||||
MetaDataDecl gameDecls[] {
|
MetaDataDecl gameDecls[] {
|
||||||
// Key Type Default value Statistic Name in GuiMetaDataEd Prompt in GuiMetaDataEd Scrape
|
// Key Type Default value Statistic Name in GuiMetaDataEd Prompt in GuiMetaDataEd Scrape
|
||||||
{"name", MD_STRING, "", false, "name", "enter name", true},
|
{"name", MD_STRING, "", false, "NAME", "ENTER NAME", true},
|
||||||
{"sortname", MD_STRING, "", false, "sortname", "enter sortname", false},
|
{"sortname", MD_STRING, "", false, "SORTNAME", "ENTER SORTNAME", false},
|
||||||
{"collectionsortname", MD_STRING, "", false, "custom collections sortname", "enter collections sortname", false},
|
{"collectionsortname", MD_STRING, "", false, "CUSTOM COLLECTIONS SORTNAME", "ENTER COLLECTIONS SORTNAME", false},
|
||||||
{"desc", MD_MULTILINE_STRING, "", false, "description", "enter description", true},
|
{"desc", MD_MULTILINE_STRING, "", false, "DESCRIPTION", "ENTER DESCRIPTION", true},
|
||||||
{"rating", MD_RATING, "0", false, "rating", "enter rating", true},
|
{"rating", MD_RATING, "0", false, "RATING", "ENTER RATING", true},
|
||||||
{"releasedate", MD_DATE, "19700101T000000", false, "release date", "enter release date", true},
|
{"releasedate", MD_DATE, "19700101T000000", false, "RELEASE DATE", "ENTER RELEASE DATE", true},
|
||||||
{"developer", MD_STRING, "unknown", false, "developer", "enter developer", true},
|
{"developer", MD_STRING, "unknown", false, "DEVELOPER", "ENTER DEVELOPER", true},
|
||||||
{"publisher", MD_STRING, "unknown", false, "publisher", "enter publisher", true},
|
{"publisher", MD_STRING, "unknown", false, "PUBLISHER", "ENTER PUBLISHER", true},
|
||||||
{"genre", MD_STRING, "unknown", false, "genre", "enter genre", true},
|
{"genre", MD_STRING, "unknown", false, "GENRE", "ENTER GENRE", true},
|
||||||
{"players", MD_STRING, "unknown", false, "players", "enter number of players", true},
|
{"players", MD_STRING, "unknown", false, "PLAYERS", "ENTER NUMBER OF PLAYERS", true},
|
||||||
{"favorite", MD_BOOL, "false", false, "favorite", "enter favorite off/on", false},
|
{"favorite", MD_BOOL, "false", false, "FAVORITE", "ENTER FAVORITE OFF/ON", false},
|
||||||
{"completed", MD_BOOL, "false", false, "completed", "enter completed off/on", false},
|
{"completed", MD_BOOL, "false", false, "COMPLETED", "ENTER COMPLETED OFF/ON", false},
|
||||||
{"kidgame", MD_BOOL, "false", false, "kidgame", "enter kidgame off/on", false},
|
{"kidgame", MD_BOOL, "false", false, "KIDGAME", "ENTER KIDGAME OFF/ON", false},
|
||||||
{"hidden", MD_BOOL, "false", false, "hidden", "enter hidden off/on", false},
|
{"hidden", MD_BOOL, "false", false, "HIDDEN", "ENTER HIDDEN OFF/ON", false},
|
||||||
{"broken", MD_BOOL, "false", false, "broken/not working", "enter broken off/on", false},
|
{"broken", MD_BOOL, "false", false, "BROKEN/NOT WORKING", "ENTER BROKEN OFF/ON", false},
|
||||||
{"nogamecount", MD_BOOL, "false", false, "exclude from game counter", "enter don't count as game off/on", false},
|
{"nogamecount", MD_BOOL, "false", false, "EXCLUDE FROM GAME COUNTER", "ENTER DON'T COUNT AS GAME OFF/ON", false},
|
||||||
{"nomultiscrape", MD_BOOL, "false", false, "exclude from multi-scraper", "enter no multi-scrape off/on", false},
|
{"nomultiscrape", MD_BOOL, "false", false, "EXCLUDE FROM MULTI-SCRAPER", "ENTER NO MULTI-SCRAPE OFF/ON", false},
|
||||||
{"hidemetadata", MD_BOOL, "false", false, "hide metadata fields", "enter hide metadata off/on", false},
|
{"hidemetadata", MD_BOOL, "false", false, "HIDE METADATA FIELDS", "ENTER HIDE METADATA OFF/ON", false},
|
||||||
{"playcount", MD_INT, "0", false, "times played", "enter number of times played", false},
|
{"playcount", MD_INT, "0", false, "TIMES PLAYED", "ENTER NUMBER OF TIMES PLAYED", false},
|
||||||
{"controller", MD_CONTROLLER, "", false, "controller", "select controller", true},
|
{"controller", MD_CONTROLLER, "", false, "CONTROLLER", "SELECT CONTROLLER", true},
|
||||||
{"altemulator", MD_ALT_EMULATOR, "", false, "alternative emulator", "select alternative emulator", false},
|
{"altemulator", MD_ALT_EMULATOR, "", false, "ALTERNATIVE EMULATOR", "SELECT ALTERNATIVE EMULATOR", false},
|
||||||
{"lastplayed", MD_TIME, "0", true, "last played", "enter last played date", false}
|
{"lastplayed", MD_TIME, "0", true, "LAST PLAYED", "ENTER LAST PLAYED DATE", false}
|
||||||
};
|
};
|
||||||
|
|
||||||
MetaDataDecl folderDecls[] {
|
MetaDataDecl folderDecls[] {
|
||||||
// Key Type Default value Statistic Name in GuiMetaDataEd Prompt in GuiMetaDataEd Scrape
|
// Key Type Default value Statistic Name in GuiMetaDataEd Prompt in GuiMetaDataEd Scrape
|
||||||
{"name", MD_STRING, "", false, "name", "enter name", true},
|
{"name", MD_STRING, "", false, "NAME", "ENTER NAME", true},
|
||||||
{"desc", MD_MULTILINE_STRING, "", false, "description", "enter description", true},
|
{"desc", MD_MULTILINE_STRING, "", false, "DESCRIPTION", "ENTER DESCRIPTION", true},
|
||||||
{"rating", MD_RATING, "0", false, "rating", "enter rating", true},
|
{"rating", MD_RATING, "0", false, "RATING", "ENTER RATING", true},
|
||||||
{"releasedate", MD_DATE, "19700101T000000", false, "release date", "enter release date", true},
|
{"releasedate", MD_DATE, "19700101T000000", false, "RELEASE DATE", "ENTER RELEASE DATE", true},
|
||||||
{"developer", MD_STRING, "unknown", false, "developer", "enter developer", true},
|
{"developer", MD_STRING, "unknown", false, "DEVELOPER", "ENTER DEVELOPER", true},
|
||||||
{"publisher", MD_STRING, "unknown", false, "publisher", "enter publisher", true},
|
{"publisher", MD_STRING, "unknown", false, "PUBLISHER", "ENTER PUBLISHER", true},
|
||||||
{"genre", MD_STRING, "unknown", false, "genre", "enter genre", true},
|
{"genre", MD_STRING, "unknown", false, "GENRE", "ENTER GENRE", true},
|
||||||
{"players", MD_STRING, "unknown", false, "players", "enter number of players", true},
|
{"players", MD_STRING, "unknown", false, "PLAYERS", "ENTER NUMBER OF PLAYERS", true},
|
||||||
{"favorite", MD_BOOL, "false", false, "favorite", "enter favorite off/on", false},
|
{"favorite", MD_BOOL, "false", false, "FAVORITE", "ENTER FAVORITE OFF/ON", false},
|
||||||
{"completed", MD_BOOL, "false", false, "completed", "enter completed off/on", false},
|
{"completed", MD_BOOL, "false", false, "COMPLETED", "ENTER COMPLETED OFF/ON", false},
|
||||||
{"kidgame", MD_BOOL, "false", false, "kidgame (only affects badges)", "enter kidgame off/on", false},
|
{"kidgame", MD_BOOL, "false", false, "KIDGAME (ONLY AFFECTS BADGES)", "ENTER KIDGAME OFF/ON", false},
|
||||||
{"hidden", MD_BOOL, "false", false, "hidden", "enter hidden off/on", false},
|
{"hidden", MD_BOOL, "false", false, "HIDDEN", "ENTER HIDDEN OFF/ON", false},
|
||||||
{"broken", MD_BOOL, "false", false, "broken/not working", "enter broken off/on", false},
|
{"broken", MD_BOOL, "false", false, "BROKEN/NOT WORKING", "ENTER BROKEN OFF/ON", false},
|
||||||
{"nomultiscrape", MD_BOOL, "false", false, "exclude from multi-scraper", "enter no multi-scrape off/on", false},
|
{"nomultiscrape", MD_BOOL, "false", false, "EXCLUDE FROM MULTI-SCRAPER", "ENTER NO MULTI-SCRAPE OFF/ON", false},
|
||||||
{"hidemetadata", MD_BOOL, "false", false, "hide metadata fields", "enter hide metadata off/on", false},
|
{"hidemetadata", MD_BOOL, "false", false, "HIDE METADATA FIELDS", "ENTER HIDE METADATA OFF/ON", false},
|
||||||
{"controller", MD_CONTROLLER, "", false, "controller", "select controller", true},
|
{"controller", MD_CONTROLLER, "", false, "CONTROLLER", "SELECT CONTROLLER", true},
|
||||||
{"folderlink", MD_FOLDER_LINK, "", false, "folder link", "select folder link", false},
|
{"folderlink", MD_FOLDER_LINK, "", false, "FOLDER LINK", "SELECT FOLDER LINK", false},
|
||||||
{"lastplayed", MD_TIME, "0", true, "last played", "enter last played date", false}
|
{"lastplayed", MD_TIME, "0", true, "LAST PLAYED", "ENTER LAST PLAYED DATE", false}
|
||||||
};
|
};
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
|
@ -184,3 +185,47 @@ void MetaDataList::resetChangedFlag()
|
||||||
// Reset the change flag.
|
// Reset the change flag.
|
||||||
mWasChanged = false;
|
mWasChanged = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(GETTEXT_DUMMY_ENTRIES)
|
||||||
|
void gettextMessageCatalogEntries()
|
||||||
|
{
|
||||||
|
_("NAME");
|
||||||
|
_("ENTER NAME");
|
||||||
|
_("SORTNAME");
|
||||||
|
_("ENTER SORTNAME");
|
||||||
|
_("CUSTOM COLLECTIONS SORTNAME");
|
||||||
|
_("ENTER COLLECTIONS SORTNAME");
|
||||||
|
_("DESCRIPTION");
|
||||||
|
_("ENTER DESCRIPTION");
|
||||||
|
_("RATING");
|
||||||
|
_("RELEASE DATE");
|
||||||
|
_("ENTER RELEASE DATE");
|
||||||
|
_("DEVELOPER");
|
||||||
|
_("ENTER DEVELOPER");
|
||||||
|
_("PUBLISHER");
|
||||||
|
_("ENTER PUBLISHER");
|
||||||
|
_("GENRE");
|
||||||
|
_("ENTER GENRE");
|
||||||
|
_("PLAYERS");
|
||||||
|
_("ENTER NUMBER OF PLAYERS");
|
||||||
|
_("FAVORITE");
|
||||||
|
_("COMPLETED");
|
||||||
|
_("KIDGAME");
|
||||||
|
_("KIDGAME (ONLY AFFECTS BADGES)");
|
||||||
|
_("HIDDEN");
|
||||||
|
_("BROKEN/NOT WORKING");
|
||||||
|
_("EXCLUDE FROM GAME COUNTER");
|
||||||
|
_("EXCLUDE FROM MULTI-SCRAPER");
|
||||||
|
_("HIDE METADATA FIELDS");
|
||||||
|
_("TIMES PLAYED");
|
||||||
|
_("ENTER NUMBER OF TIMES PLAYED");
|
||||||
|
_("CONTROLLER");
|
||||||
|
_("SELECT CONTROLLER");
|
||||||
|
_("ALTERNATIVE EMULATOR");
|
||||||
|
_("SELECT ALTERNATIVE EMULATOR");
|
||||||
|
_("FOLDER LINK");
|
||||||
|
_("SELECT FOLDER LINK");
|
||||||
|
_("LAST PLAYED");
|
||||||
|
_("ENTER LAST PLAYED DATE");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -95,6 +95,11 @@ private:
|
||||||
std::map<std::string, std::string> mMap;
|
std::map<std::string, std::string> mMap;
|
||||||
std::string mNoResult = "";
|
std::string mNoResult = "";
|
||||||
bool mWasChanged;
|
bool mWasChanged;
|
||||||
|
|
||||||
|
#if defined(GETTEXT_DUMMY_ENTRIES)
|
||||||
|
// This is just to get gettext msgid entries added to the PO message catalog files.
|
||||||
|
void gettextMessageCatalogEntries();
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ES_APP_META_DATA_H
|
#endif // ES_APP_META_DATA_H
|
||||||
|
|
|
@ -11,14 +11,15 @@
|
||||||
|
|
||||||
#include "GamelistFileParser.h"
|
#include "GamelistFileParser.h"
|
||||||
#include "SystemData.h"
|
#include "SystemData.h"
|
||||||
|
#include "utils/LocalizationUtil.h"
|
||||||
#include "views/ViewController.h"
|
#include "views/ViewController.h"
|
||||||
|
|
||||||
GuiAlternativeEmulators::GuiAlternativeEmulators()
|
GuiAlternativeEmulators::GuiAlternativeEmulators()
|
||||||
: mMenu {"ALTERNATIVE EMULATORS"}
|
: mMenu {_("ALTERNATIVE EMULATORS")}
|
||||||
, mHasSystems {false}
|
, mHasSystems {false}
|
||||||
{
|
{
|
||||||
addChild(&mMenu);
|
addChild(&mMenu);
|
||||||
mMenu.addButton("BACK", "back", [this] { delete this; });
|
mMenu.addButton(_("BACK"), _("back"), [this] { delete this; });
|
||||||
|
|
||||||
// Horizontal sizes for the system and label entries.
|
// Horizontal sizes for the system and label entries.
|
||||||
float systemSizeX {mMenu.getSize().x / 3.27f};
|
float systemSizeX {mMenu.getSize().x / 3.27f};
|
||||||
|
@ -256,8 +257,8 @@ bool GuiAlternativeEmulators::input(InputConfig* config, Input input)
|
||||||
std::vector<HelpPrompt> GuiAlternativeEmulators::getHelpPrompts()
|
std::vector<HelpPrompt> GuiAlternativeEmulators::getHelpPrompts()
|
||||||
{
|
{
|
||||||
std::vector<HelpPrompt> prompts {mMenu.getHelpPrompts()};
|
std::vector<HelpPrompt> prompts {mMenu.getHelpPrompts()};
|
||||||
prompts.push_back(HelpPrompt("b", "back"));
|
prompts.push_back(HelpPrompt("b", _("back")));
|
||||||
if (mHasSystems)
|
if (mHasSystems)
|
||||||
prompts.push_back(HelpPrompt("a", "select"));
|
prompts.push_back(HelpPrompt("a", _("select")));
|
||||||
return prompts;
|
return prompts;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include "components/OptionListComponent.h"
|
#include "components/OptionListComponent.h"
|
||||||
#include "guis/GuiTextEditKeyboardPopup.h"
|
#include "guis/GuiTextEditKeyboardPopup.h"
|
||||||
#include "guis/GuiTextEditPopup.h"
|
#include "guis/GuiTextEditPopup.h"
|
||||||
|
#include "utils/LocalizationUtil.h"
|
||||||
#include "utils/StringUtil.h"
|
#include "utils/StringUtil.h"
|
||||||
|
|
||||||
GuiGamelistFilter::GuiGamelistFilter(SystemData* system,
|
GuiGamelistFilter::GuiGamelistFilter(SystemData* system,
|
||||||
|
@ -245,7 +246,7 @@ bool GuiGamelistFilter::input(InputConfig* config, Input input)
|
||||||
std::vector<HelpPrompt> GuiGamelistFilter::getHelpPrompts()
|
std::vector<HelpPrompt> GuiGamelistFilter::getHelpPrompts()
|
||||||
{
|
{
|
||||||
std::vector<HelpPrompt> prompts {mMenu.getHelpPrompts()};
|
std::vector<HelpPrompt> prompts {mMenu.getHelpPrompts()};
|
||||||
prompts.push_back(HelpPrompt("b", "back"));
|
prompts.push_back(HelpPrompt("b", _("back")));
|
||||||
prompts.push_back(HelpPrompt("a", "select"));
|
prompts.push_back(HelpPrompt("a", _("select")));
|
||||||
return prompts;
|
return prompts;
|
||||||
}
|
}
|
||||||
|
|
|
@ -600,14 +600,14 @@ std::vector<HelpPrompt> GuiGamelistOptions::getHelpPrompts()
|
||||||
auto prompts = mMenu.getHelpPrompts();
|
auto prompts = mMenu.getHelpPrompts();
|
||||||
if (mSystem->getRootFolder()->getChildren().size() > 0 || mIsCustomCollectionGroup ||
|
if (mSystem->getRootFolder()->getChildren().size() > 0 || mIsCustomCollectionGroup ||
|
||||||
mIsCustomCollection || CollectionSystemsManager::getInstance()->isEditing())
|
mIsCustomCollection || CollectionSystemsManager::getInstance()->isEditing())
|
||||||
prompts.push_back(HelpPrompt("a", "select"));
|
prompts.push_back(HelpPrompt("a", _("select")));
|
||||||
if (mSystem->getRootFolder()->getChildren().size() > 0 && mSystem->getName() != "recent") {
|
if (mSystem->getRootFolder()->getChildren().size() > 0 && mSystem->getName() != "recent") {
|
||||||
prompts.push_back(HelpPrompt("b", "close (apply)"));
|
prompts.push_back(HelpPrompt("b", _("close (apply)")));
|
||||||
prompts.push_back(HelpPrompt("back", "close (cancel)"));
|
prompts.push_back(HelpPrompt("back", _("close (cancel)")));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
prompts.push_back(HelpPrompt("b", "close"));
|
prompts.push_back(HelpPrompt("b", _("close")));
|
||||||
prompts.push_back(HelpPrompt("back", "close"));
|
prompts.push_back(HelpPrompt("back", _("close")));
|
||||||
}
|
}
|
||||||
return prompts;
|
return prompts;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1970,7 +1970,7 @@ void GuiMenu::openUtilities()
|
||||||
HelpStyle style {getHelpStyle()};
|
HelpStyle style {getHelpStyle()};
|
||||||
|
|
||||||
ComponentListRow row;
|
ComponentListRow row;
|
||||||
row.addElement(std::make_shared<TextComponent>("ORPHANED DATA CLEANUP",
|
row.addElement(std::make_shared<TextComponent>(_("ORPHANED DATA CLEANUP"),
|
||||||
Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary),
|
Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary),
|
||||||
true);
|
true);
|
||||||
row.addElement(mMenu.makeArrow(), false);
|
row.addElement(mMenu.makeArrow(), false);
|
||||||
|
@ -1979,7 +1979,7 @@ void GuiMenu::openUtilities()
|
||||||
s->addRow(row);
|
s->addRow(row);
|
||||||
|
|
||||||
row.elements.clear();
|
row.elements.clear();
|
||||||
row.addElement(std::make_shared<TextComponent>("CREATE/UPDATE SYSTEM DIRECTORIES",
|
row.addElement(std::make_shared<TextComponent>(_("CREATE/UPDATE SYSTEM DIRECTORIES"),
|
||||||
Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary),
|
Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary),
|
||||||
true);
|
true);
|
||||||
|
|
||||||
|
@ -1991,15 +1991,16 @@ void GuiMenu::openUtilities()
|
||||||
row.makeAcceptInputHandler([this] {
|
row.makeAcceptInputHandler([this] {
|
||||||
mWindow->pushGui(new GuiMsgBox(
|
mWindow->pushGui(new GuiMsgBox(
|
||||||
getHelpStyle(),
|
getHelpStyle(),
|
||||||
"THIS WILL CREATE ALL GAME SYSTEM DIRECTORIES INSIDE YOUR ROM FOLDER AND IT WILL ALSO "
|
_("THIS WILL CREATE ALL GAME SYSTEM DIRECTORIES INSIDE YOUR ROM FOLDER AND IT WILL "
|
||||||
"UPDATE ALL SYSTEMINFO.TXT FILES. THIS IS A SAFE OPERATION THAT WILL NOT DELETE OR "
|
"ALSO UPDATE ALL SYSTEMINFO.TXT FILES. THIS IS A SAFE OPERATION THAT WILL NOT DELETE "
|
||||||
"MODIFY YOUR GAME FILES. TO DECREASE APPLICATION STARTUP TIMES IT'S RECOMMENDED TO "
|
"OR MODIFY YOUR GAME FILES. TO DECREASE APPLICATION STARTUP TIMES IT'S RECOMMENDED "
|
||||||
"DELETE THE SYSTEM DIRECTORIES YOU DON'T NEED AFTER RUNNING THIS UTILITY",
|
"TO DELETE THE SYSTEM DIRECTORIES YOU DON'T NEED AFTER RUNNING THIS UTILITY"),
|
||||||
"PROCEED",
|
_("PROCEED"),
|
||||||
[this] {
|
[this] {
|
||||||
if (!SystemData::createSystemDirectories()) {
|
if (!SystemData::createSystemDirectories()) {
|
||||||
mWindow->pushGui(new GuiMsgBox(
|
mWindow->pushGui(new GuiMsgBox(
|
||||||
getHelpStyle(), "THE SYSTEM DIRECTORIES WERE SUCCESSFULLY CREATED", _("OK"),
|
getHelpStyle(), _("THE SYSTEM DIRECTORIES WERE SUCCESSFULLY CREATED"),
|
||||||
|
_("OK"),
|
||||||
[this] {
|
[this] {
|
||||||
if (CollectionSystemsManager::getInstance()->isEditing())
|
if (CollectionSystemsManager::getInstance()->isEditing())
|
||||||
CollectionSystemsManager::getInstance()->exitEditMode();
|
CollectionSystemsManager::getInstance()->exitEditMode();
|
||||||
|
@ -2018,15 +2019,15 @@ void GuiMenu::openUtilities()
|
||||||
else {
|
else {
|
||||||
mWindow->pushGui(new GuiMsgBox(
|
mWindow->pushGui(new GuiMsgBox(
|
||||||
getHelpStyle(),
|
getHelpStyle(),
|
||||||
"ERROR CREATING SYSTEM DIRECTORIES, PERMISSION PROBLEMS OR "
|
_("ERROR CREATING SYSTEM DIRECTORIES, PERMISSION PROBLEMS OR "
|
||||||
"DISK FULL?\nSEE THE LOG FILE FOR MORE DETAILS",
|
"DISK FULL? SEE THE LOG FILE FOR MORE DETAILS"),
|
||||||
_("OK"), nullptr, "", nullptr, "", nullptr, nullptr, true, true,
|
_("OK"), nullptr, "", nullptr, "", nullptr, nullptr, true, true,
|
||||||
(mRenderer->getIsVerticalOrientation() ?
|
(mRenderer->getIsVerticalOrientation() ?
|
||||||
0.70f :
|
0.70f :
|
||||||
0.44f * (1.778f / mRenderer->getScreenAspectRatio()))));
|
0.44f * (1.778f / mRenderer->getScreenAspectRatio()))));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"CANCEL", nullptr, "", nullptr, nullptr, false, true,
|
_("CANCEL"), nullptr, "", nullptr, nullptr, false, true,
|
||||||
(mRenderer->getIsVerticalOrientation() ?
|
(mRenderer->getIsVerticalOrientation() ?
|
||||||
0.80f :
|
0.80f :
|
||||||
0.52f * (1.778f / mRenderer->getScreenAspectRatio()))));
|
0.52f * (1.778f / mRenderer->getScreenAspectRatio()))));
|
||||||
|
@ -2035,7 +2036,7 @@ void GuiMenu::openUtilities()
|
||||||
s->addRow(row);
|
s->addRow(row);
|
||||||
|
|
||||||
row.elements.clear();
|
row.elements.clear();
|
||||||
row.addElement(std::make_shared<TextComponent>("RESCAN ROM DIRECTORY",
|
row.addElement(std::make_shared<TextComponent>(_("RESCAN ROM DIRECTORY"),
|
||||||
Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary),
|
Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary),
|
||||||
true);
|
true);
|
||||||
|
|
||||||
|
@ -2045,9 +2046,9 @@ void GuiMenu::openUtilities()
|
||||||
row.makeAcceptInputHandler([this] {
|
row.makeAcceptInputHandler([this] {
|
||||||
mWindow->pushGui(new GuiMsgBox(
|
mWindow->pushGui(new GuiMsgBox(
|
||||||
getHelpStyle(),
|
getHelpStyle(),
|
||||||
"THIS WILL RESCAN YOUR ROM DIRECTORY FOR CHANGES SUCH AS ADDED OR REMOVED GAMES AND "
|
_("THIS WILL RESCAN YOUR ROM DIRECTORY FOR CHANGES SUCH AS ADDED OR REMOVED GAMES AND "
|
||||||
"SYSTEMS",
|
"SYSTEMS"),
|
||||||
"PROCEED",
|
_("PROCEED"),
|
||||||
[this] {
|
[this] {
|
||||||
if (CollectionSystemsManager::getInstance()->isEditing())
|
if (CollectionSystemsManager::getInstance()->isEditing())
|
||||||
CollectionSystemsManager::getInstance()->exitEditMode();
|
CollectionSystemsManager::getInstance()->exitEditMode();
|
||||||
|
@ -2060,7 +2061,7 @@ void GuiMenu::openUtilities()
|
||||||
}
|
}
|
||||||
ViewController::getInstance()->rescanROMDirectory();
|
ViewController::getInstance()->rescanROMDirectory();
|
||||||
},
|
},
|
||||||
"CANCEL", nullptr, "", nullptr, nullptr, false, true,
|
_("CANCEL"), nullptr, "", nullptr, nullptr, false, true,
|
||||||
(mRenderer->getIsVerticalOrientation() ?
|
(mRenderer->getIsVerticalOrientation() ?
|
||||||
0.76f :
|
0.76f :
|
||||||
0.52f * (1.778f / mRenderer->getScreenAspectRatio()))));
|
0.52f * (1.778f / mRenderer->getScreenAspectRatio()))));
|
||||||
|
@ -2079,12 +2080,12 @@ void GuiMenu::openQuitMenu()
|
||||||
if (!Settings::getInstance()->getBool("ShowQuitMenu")) {
|
if (!Settings::getInstance()->getBool("ShowQuitMenu")) {
|
||||||
#endif
|
#endif
|
||||||
mWindow->pushGui(new GuiMsgBox(
|
mWindow->pushGui(new GuiMsgBox(
|
||||||
this->getHelpStyle(), "REALLY QUIT?", "YES",
|
this->getHelpStyle(), _("REALLY QUIT?"), _("YES"),
|
||||||
[this] {
|
[this] {
|
||||||
close(true);
|
close(true);
|
||||||
Utils::Platform::quitES();
|
Utils::Platform::quitES();
|
||||||
},
|
},
|
||||||
"NO", nullptr));
|
_("NO"), nullptr));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
auto s = new GuiSettings(_("QUIT"));
|
auto s = new GuiSettings(_("QUIT"));
|
||||||
|
@ -2096,15 +2097,15 @@ void GuiMenu::openQuitMenu()
|
||||||
|
|
||||||
row.makeAcceptInputHandler([window, this] {
|
row.makeAcceptInputHandler([window, this] {
|
||||||
window->pushGui(new GuiMsgBox(
|
window->pushGui(new GuiMsgBox(
|
||||||
this->getHelpStyle(), "REALLY QUIT?", "YES",
|
this->getHelpStyle(), _("REALLY QUIT?"), _("YES"),
|
||||||
[this] {
|
[this] {
|
||||||
close(true);
|
close(true);
|
||||||
Utils::Platform::quitES();
|
Utils::Platform::quitES();
|
||||||
},
|
},
|
||||||
"NO", nullptr));
|
_("NO"), nullptr));
|
||||||
});
|
});
|
||||||
auto quitText = std::make_shared<TextComponent>("QUIT ES-DE", Font::get(FONT_SIZE_MEDIUM),
|
auto quitText = std::make_shared<TextComponent>(
|
||||||
mMenuColorPrimary);
|
_("QUIT ES-DE"), Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary);
|
||||||
quitText->setSelectable(true);
|
quitText->setSelectable(true);
|
||||||
row.addElement(quitText, true);
|
row.addElement(quitText, true);
|
||||||
s->addRow(row);
|
s->addRow(row);
|
||||||
|
@ -2112,16 +2113,16 @@ void GuiMenu::openQuitMenu()
|
||||||
row.elements.clear();
|
row.elements.clear();
|
||||||
row.makeAcceptInputHandler([window, this] {
|
row.makeAcceptInputHandler([window, this] {
|
||||||
window->pushGui(new GuiMsgBox(
|
window->pushGui(new GuiMsgBox(
|
||||||
this->getHelpStyle(), "REALLY REBOOT?", "YES",
|
this->getHelpStyle(), _("REALLY REBOOT?"), _("YES"),
|
||||||
[] {
|
[] {
|
||||||
if (Utils::Platform::quitES(Utils::Platform::QuitMode::REBOOT) != 0) {
|
if (Utils::Platform::quitES(Utils::Platform::QuitMode::REBOOT) != 0) {
|
||||||
LOG(LogWarning) << "Reboot terminated with non-zero result!";
|
LOG(LogWarning) << "Reboot terminated with non-zero result!";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"NO", nullptr));
|
_("NO"), nullptr));
|
||||||
});
|
});
|
||||||
auto rebootText = std::make_shared<TextComponent>(
|
auto rebootText = std::make_shared<TextComponent>(
|
||||||
"REBOOT SYSTEM", Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary);
|
_("REBOOT SYSTEM"), Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary);
|
||||||
rebootText->setSelectable(true);
|
rebootText->setSelectable(true);
|
||||||
row.addElement(rebootText, true);
|
row.addElement(rebootText, true);
|
||||||
s->addRow(row);
|
s->addRow(row);
|
||||||
|
@ -2129,16 +2130,16 @@ void GuiMenu::openQuitMenu()
|
||||||
row.elements.clear();
|
row.elements.clear();
|
||||||
row.makeAcceptInputHandler([window, this] {
|
row.makeAcceptInputHandler([window, this] {
|
||||||
window->pushGui(new GuiMsgBox(
|
window->pushGui(new GuiMsgBox(
|
||||||
this->getHelpStyle(), "REALLY POWER OFF?", "YES",
|
this->getHelpStyle(), _("REALLY POWER OFF?"), _("YES"),
|
||||||
[] {
|
[] {
|
||||||
if (Utils::Platform::quitES(Utils::Platform::QuitMode::POWEROFF) != 0) {
|
if (Utils::Platform::quitES(Utils::Platform::QuitMode::POWEROFF) != 0) {
|
||||||
LOG(LogWarning) << "Power off terminated with non-zero result!";
|
LOG(LogWarning) << "Power off terminated with non-zero result!";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"NO", nullptr));
|
_("NO"), nullptr));
|
||||||
});
|
});
|
||||||
auto powerOffText = std::make_shared<TextComponent>(
|
auto powerOffText = std::make_shared<TextComponent>(
|
||||||
"POWER OFF SYSTEM", Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary);
|
_("POWER OFF SYSTEM"), Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary);
|
||||||
powerOffText->setSelectable(true);
|
powerOffText->setSelectable(true);
|
||||||
row.addElement(powerOffText, true);
|
row.addElement(powerOffText, true);
|
||||||
s->addRow(row);
|
s->addRow(row);
|
||||||
|
@ -2268,9 +2269,9 @@ bool GuiMenu::input(InputConfig* config, Input input)
|
||||||
std::vector<HelpPrompt> GuiMenu::getHelpPrompts()
|
std::vector<HelpPrompt> GuiMenu::getHelpPrompts()
|
||||||
{
|
{
|
||||||
std::vector<HelpPrompt> prompts;
|
std::vector<HelpPrompt> prompts;
|
||||||
prompts.push_back(HelpPrompt("up/down", "choose"));
|
prompts.push_back(HelpPrompt("up/down", _("choose")));
|
||||||
prompts.push_back(HelpPrompt("a", "select"));
|
prompts.push_back(HelpPrompt("a", _("select")));
|
||||||
prompts.push_back(HelpPrompt("b", "close menu"));
|
prompts.push_back(HelpPrompt("b", _("close menu")));
|
||||||
prompts.push_back(HelpPrompt("start", "close menu"));
|
prompts.push_back(HelpPrompt("start", _("close menu")));
|
||||||
return prompts;
|
return prompts;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include "guis/GuiTextEditKeyboardPopup.h"
|
#include "guis/GuiTextEditKeyboardPopup.h"
|
||||||
#include "guis/GuiTextEditPopup.h"
|
#include "guis/GuiTextEditPopup.h"
|
||||||
#include "resources/Font.h"
|
#include "resources/Font.h"
|
||||||
|
#include "utils/LocalizationUtil.h"
|
||||||
#include "utils/StringUtil.h"
|
#include "utils/StringUtil.h"
|
||||||
|
|
||||||
#define TITLE_HEIGHT \
|
#define TITLE_HEIGHT \
|
||||||
|
@ -70,7 +71,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
|
||||||
addChild(&mBackground);
|
addChild(&mBackground);
|
||||||
addChild(&mGrid);
|
addChild(&mGrid);
|
||||||
|
|
||||||
mTitle = std::make_shared<TextComponent>("EDIT METADATA", Font::get(FONT_SIZE_LARGE),
|
mTitle = std::make_shared<TextComponent>(_("EDIT METADATA"), Font::get(FONT_SIZE_LARGE),
|
||||||
mMenuColorTitle, ALIGN_CENTER);
|
mMenuColorTitle, ALIGN_CENTER);
|
||||||
mGrid.setEntry(mTitle, glm::ivec2 {0, 0}, false, true, glm::ivec2 {2, 2});
|
mGrid.setEntry(mTitle, glm::ivec2 {0, 0}, false, true, glm::ivec2 {2, 2});
|
||||||
|
|
||||||
|
@ -147,7 +148,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
|
||||||
// entry instead of for instance the spacer. That is so because ComponentList
|
// entry instead of for instance the spacer. That is so because ComponentList
|
||||||
// always looks for the help prompt at the back of the element stack.
|
// always looks for the help prompt at the back of the element stack.
|
||||||
ComponentListRow row;
|
ComponentListRow row;
|
||||||
auto lbl = std::make_shared<TextComponent>(Utils::String::toUpper(it->displayName),
|
auto lbl = std::make_shared<TextComponent>(_(it->displayName.c_str()),
|
||||||
Font::get(FONT_SIZE_SMALL), mMenuColorPrimary);
|
Font::get(FONT_SIZE_SMALL), mMenuColorPrimary);
|
||||||
row.addElement(lbl, true); // Label.
|
row.addElement(lbl, true); // Label.
|
||||||
|
|
||||||
|
@ -207,7 +208,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
|
||||||
bracket->setColorShift(mMenuColorPrimary);
|
bracket->setColorShift(mMenuColorPrimary);
|
||||||
row.addElement(bracket, false);
|
row.addElement(bracket, false);
|
||||||
|
|
||||||
const std::string title {it->displayPrompt};
|
const std::string title {_(it->displayPrompt.c_str())};
|
||||||
|
|
||||||
// OK callback (apply new value to ed).
|
// OK callback (apply new value to ed).
|
||||||
auto updateVal = [ed, originalValue](const std::string& newVal) {
|
auto updateVal = [ed, originalValue](const std::string& newVal) {
|
||||||
|
@ -251,7 +252,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
|
||||||
if (ed->getValue() != "") {
|
if (ed->getValue() != "") {
|
||||||
ComponentListRow row;
|
ComponentListRow row;
|
||||||
std::shared_ptr<TextComponent> clearText {std::make_shared<TextComponent>(
|
std::shared_ptr<TextComponent> clearText {std::make_shared<TextComponent>(
|
||||||
ViewController::CROSSEDCIRCLE_CHAR + " CLEAR ENTRY",
|
ViewController::CROSSEDCIRCLE_CHAR + " " + _("CLEAR ENTRY"),
|
||||||
Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary)};
|
Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary)};
|
||||||
clearText->setSelectable(true);
|
clearText->setSelectable(true);
|
||||||
row.addElement(clearText, true);
|
row.addElement(clearText, true);
|
||||||
|
@ -293,8 +294,9 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
|
||||||
bracket->setColorShift(mMenuColorPrimary);
|
bracket->setColorShift(mMenuColorPrimary);
|
||||||
row.addElement(bracket, false);
|
row.addElement(bracket, false);
|
||||||
|
|
||||||
const std::string title {mRenderer->getIsVerticalOrientation() ? "select emulator" :
|
const std::string title {mRenderer->getIsVerticalOrientation() ?
|
||||||
it->displayPrompt};
|
_("SELECT EMULATOR") :
|
||||||
|
_(it->displayPrompt.c_str())};
|
||||||
|
|
||||||
// OK callback (apply new value to ed).
|
// OK callback (apply new value to ed).
|
||||||
auto updateVal = [this, ed, originalValue](const std::string& newVal) {
|
auto updateVal = [this, ed, originalValue](const std::string& newVal) {
|
||||||
|
@ -334,7 +336,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
|
||||||
GuiSettings* s {nullptr};
|
GuiSettings* s {nullptr};
|
||||||
|
|
||||||
if (mInvalidEmulatorEntry && singleEntry)
|
if (mInvalidEmulatorEntry && singleEntry)
|
||||||
s = new GuiSettings("CLEAR INVALID ENTRY");
|
s = new GuiSettings(_("CLEAR INVALID ENTRY"));
|
||||||
else
|
else
|
||||||
s = new GuiSettings(title);
|
s = new GuiSettings(title);
|
||||||
|
|
||||||
|
@ -346,7 +348,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
|
||||||
"", ViewController::EXCLAMATION_CHAR + " " + originalValue));
|
"", ViewController::EXCLAMATION_CHAR + " " + originalValue));
|
||||||
else if (ed->getValue() != "")
|
else if (ed->getValue() != "")
|
||||||
launchCommands.push_back(std::make_pair(
|
launchCommands.push_back(std::make_pair(
|
||||||
"", ViewController::CROSSEDCIRCLE_CHAR + " CLEAR ENTRY"));
|
"", ViewController::CROSSEDCIRCLE_CHAR + " " + _("CLEAR ENTRY")));
|
||||||
|
|
||||||
for (auto entry : launchCommands) {
|
for (auto entry : launchCommands) {
|
||||||
if (mInvalidEmulatorEntry && singleEntry &&
|
if (mInvalidEmulatorEntry && singleEntry &&
|
||||||
|
@ -372,10 +374,16 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
|
||||||
scraperParams.system->getSystemEnvData()
|
scraperParams.system->getSystemEnvData()
|
||||||
->mLaunchCommands.front()
|
->mLaunchCommands.front()
|
||||||
.second == label)
|
.second == label)
|
||||||
labelText->setValue(labelText->getValue().append(" [SYSTEM-WIDE]"));
|
labelText->setValue(labelText->getValue()
|
||||||
|
.append(" [")
|
||||||
|
.append(_("SYSTEM-WIDE"))
|
||||||
|
.append("]"));
|
||||||
|
|
||||||
if (scraperParams.system->getAlternativeEmulator() == label)
|
if (scraperParams.system->getAlternativeEmulator() == label)
|
||||||
labelText->setValue(labelText->getValue().append(" [SYSTEM-WIDE]"));
|
labelText->setValue(labelText->getValue()
|
||||||
|
.append(" [")
|
||||||
|
.append(_("SYSTEM-WIDE"))
|
||||||
|
.append("]"));
|
||||||
|
|
||||||
row.addElement(labelText, true);
|
row.addElement(labelText, true);
|
||||||
row.makeAcceptInputHandler(
|
row.makeAcceptInputHandler(
|
||||||
|
@ -433,7 +441,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
|
||||||
bracket->setColorShift(mMenuColorPrimary);
|
bracket->setColorShift(mMenuColorPrimary);
|
||||||
row.addElement(bracket, false);
|
row.addElement(bracket, false);
|
||||||
|
|
||||||
const std::string title {it->displayPrompt};
|
const std::string title {_(it->displayPrompt.c_str())};
|
||||||
|
|
||||||
std::vector<FileData*> children;
|
std::vector<FileData*> children;
|
||||||
if (originalValue != "")
|
if (originalValue != "")
|
||||||
|
@ -510,7 +518,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
|
||||||
if (ed->getValue() != "") {
|
if (ed->getValue() != "") {
|
||||||
ComponentListRow row;
|
ComponentListRow row;
|
||||||
std::shared_ptr<TextComponent> clearText {std::make_shared<TextComponent>(
|
std::shared_ptr<TextComponent> clearText {std::make_shared<TextComponent>(
|
||||||
ViewController::CROSSEDCIRCLE_CHAR + " CLEAR ENTRY",
|
ViewController::CROSSEDCIRCLE_CHAR + " " + _("CLEAR ENTRY"),
|
||||||
Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary)};
|
Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary)};
|
||||||
clearText->setSelectable(true);
|
clearText->setSelectable(true);
|
||||||
row.addElement(clearText, true);
|
row.addElement(clearText, true);
|
||||||
|
@ -554,7 +562,7 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
|
||||||
row.addElement(bracket, false);
|
row.addElement(bracket, false);
|
||||||
|
|
||||||
bool multiLine {it->type == MD_MULTILINE_STRING};
|
bool multiLine {it->type == MD_MULTILINE_STRING};
|
||||||
const std::string title {it->displayPrompt};
|
const std::string title {_(it->displayPrompt.c_str())};
|
||||||
|
|
||||||
gamePath = Utils::FileSystem::getStem(scraperParams.game->getPath());
|
gamePath = Utils::FileSystem::getStem(scraperParams.game->getPath());
|
||||||
|
|
||||||
|
@ -606,14 +614,14 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
|
||||||
mRenderer->getIsVerticalOrientation() ? mPosition.y : 0.0f};
|
mRenderer->getIsVerticalOrientation() ? mPosition.y : 0.0f};
|
||||||
mWindow->pushGui(new GuiTextEditKeyboardPopup(
|
mWindow->pushGui(new GuiTextEditKeyboardPopup(
|
||||||
getHelpStyle(), verticalPosition, title, ed->getValue(), updateVal,
|
getHelpStyle(), verticalPosition, title, ed->getValue(), updateVal,
|
||||||
multiLine, "apply", "APPLY CHANGES?", "", ""));
|
multiLine, _("APPLY"), _("APPLY CHANGES?"), "", ""));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
row.makeAcceptInputHandler([this, title, ed, updateVal, multiLine] {
|
row.makeAcceptInputHandler([this, title, ed, updateVal, multiLine] {
|
||||||
mWindow->pushGui(new GuiTextEditPopup(getHelpStyle(), title, ed->getValue(),
|
mWindow->pushGui(new GuiTextEditPopup(getHelpStyle(), title, ed->getValue(),
|
||||||
updateVal, multiLine, "APPLY",
|
updateVal, multiLine, _("APPLY"),
|
||||||
"APPLY CHANGES?"));
|
_("APPLY CHANGES?")));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -647,14 +655,14 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
|
||||||
|
|
||||||
if (!scraperParams.system->hasPlatformId(PlatformIds::PLATFORM_IGNORE))
|
if (!scraperParams.system->hasPlatformId(PlatformIds::PLATFORM_IGNORE))
|
||||||
buttons.push_back(std::make_shared<ButtonComponent>(
|
buttons.push_back(std::make_shared<ButtonComponent>(
|
||||||
"SCRAPE", "scrape", std::bind(&GuiMetaDataEd::fetch, this)));
|
_("SCRAPE"), _("scrape"), std::bind(&GuiMetaDataEd::fetch, this)));
|
||||||
|
|
||||||
buttons.push_back(std::make_shared<ButtonComponent>("SAVE", "save metadata", [&] {
|
buttons.push_back(std::make_shared<ButtonComponent>(_("SAVE"), _("save metadata"), [&] {
|
||||||
save();
|
save();
|
||||||
delete this;
|
delete this;
|
||||||
}));
|
}));
|
||||||
buttons.push_back(
|
buttons.push_back(
|
||||||
std::make_shared<ButtonComponent>("CANCEL", "cancel changes", [&] { delete this; }));
|
std::make_shared<ButtonComponent>(_("CANCEL"), _("cancel changes"), [&] { delete this; }));
|
||||||
if (scraperParams.game->getType() == FOLDER) {
|
if (scraperParams.game->getType() == FOLDER) {
|
||||||
if (mClearGameFunc) {
|
if (mClearGameFunc) {
|
||||||
auto clearSelf = [&] {
|
auto clearSelf = [&] {
|
||||||
|
@ -662,16 +670,20 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
|
||||||
delete this;
|
delete this;
|
||||||
};
|
};
|
||||||
auto clearSelfBtnFunc = [this, clearSelf] {
|
auto clearSelfBtnFunc = [this, clearSelf] {
|
||||||
mWindow->pushGui(new GuiMsgBox(getHelpStyle(),
|
mWindow->pushGui(
|
||||||
"THIS WILL DELETE ANY MEDIA FILES AND\n"
|
new GuiMsgBox(getHelpStyle(),
|
||||||
"THE GAMELIST.XML ENTRY FOR THIS FOLDER,\n"
|
_("THIS WILL DELETE ANY MEDIA FILES AND "
|
||||||
"BUT NEITHER THE FOLDER ITSELF OR ANY\n"
|
"THE GAMELIST.XML ENTRY FOR THIS FOLDER, "
|
||||||
"CONTENT INSIDE IT WILL BE REMOVED\n"
|
"BUT NEITHER THE DIRECTORY ITSELF OR ANY "
|
||||||
"ARE YOU SURE?",
|
"CONTENT INSIDE IT WILL BE REMOVED"),
|
||||||
"YES", clearSelf, "NO", nullptr));
|
_("PROCEED"), clearSelf, _("CANCEL"), nullptr, "", nullptr,
|
||||||
|
nullptr, false, true,
|
||||||
|
(mRenderer->getIsVerticalOrientation() ?
|
||||||
|
0.70f :
|
||||||
|
0.46f * (1.778f / mRenderer->getScreenAspectRatio()))));
|
||||||
};
|
};
|
||||||
buttons.push_back(
|
buttons.push_back(
|
||||||
std::make_shared<ButtonComponent>("CLEAR", "clear folder", clearSelfBtnFunc));
|
std::make_shared<ButtonComponent>(_("CLEAR"), _("clear folder"), clearSelfBtnFunc));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -681,16 +693,20 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
|
||||||
delete this;
|
delete this;
|
||||||
};
|
};
|
||||||
auto clearSelfBtnFunc = [this, clearSelf] {
|
auto clearSelfBtnFunc = [this, clearSelf] {
|
||||||
mWindow->pushGui(new GuiMsgBox(getHelpStyle(),
|
mWindow->pushGui(
|
||||||
"THIS WILL DELETE ANY MEDIA FILES\n"
|
new GuiMsgBox(getHelpStyle(),
|
||||||
"AND THE GAMELIST.XML ENTRY FOR\n"
|
_("THIS WILL DELETE ANY MEDIA FILES "
|
||||||
"THIS GAME, BUT THE GAME FILE\n"
|
"AND THE GAMELIST.XML ENTRY FOR "
|
||||||
"ITSELF WILL NOT BE REMOVED\n"
|
"THIS GAME, BUT THE GAME FILE "
|
||||||
"ARE YOU SURE?",
|
"ITSELF WILL NOT BE REMOVED"),
|
||||||
"YES", clearSelf, "NO", nullptr));
|
_("PROCEED"), clearSelf, _("CANCEL"), nullptr, "", nullptr,
|
||||||
|
nullptr, false, true,
|
||||||
|
(mRenderer->getIsVerticalOrientation() ?
|
||||||
|
0.70f :
|
||||||
|
0.46f * (1.778f / mRenderer->getScreenAspectRatio()))));
|
||||||
};
|
};
|
||||||
buttons.push_back(
|
buttons.push_back(
|
||||||
std::make_shared<ButtonComponent>("CLEAR", "clear file", clearSelfBtnFunc));
|
std::make_shared<ButtonComponent>(_("CLEAR"), _("clear file"), clearSelfBtnFunc));
|
||||||
}
|
}
|
||||||
|
|
||||||
// For the special case where a directory has a supported file extension and is therefore
|
// For the special case where a directory has a supported file extension and is therefore
|
||||||
|
@ -701,15 +717,19 @@ GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
|
||||||
delete this;
|
delete this;
|
||||||
};
|
};
|
||||||
auto deleteGameBtnFunc = [this, deleteFilesAndSelf] {
|
auto deleteGameBtnFunc = [this, deleteFilesAndSelf] {
|
||||||
mWindow->pushGui(new GuiMsgBox(getHelpStyle(),
|
mWindow->pushGui(
|
||||||
"THIS WILL DELETE THE GAME\n"
|
new GuiMsgBox(getHelpStyle(),
|
||||||
"FILE, ANY MEDIA FILES AND\n"
|
_("THIS WILL DELETE THE GAME "
|
||||||
"THE GAMELIST.XML ENTRY\n"
|
"FILE, ANY MEDIA FILES AND "
|
||||||
"ARE YOU SURE?",
|
"THE GAMELIST.XML ENTRY"),
|
||||||
"YES", deleteFilesAndSelf, "NO", nullptr));
|
_("PROCEED"), deleteFilesAndSelf, _("CANCEL"), nullptr, "",
|
||||||
|
nullptr, nullptr, false, true,
|
||||||
|
(mRenderer->getIsVerticalOrientation() ?
|
||||||
|
0.70f :
|
||||||
|
0.46f * (1.778f / mRenderer->getScreenAspectRatio()))));
|
||||||
};
|
};
|
||||||
buttons.push_back(
|
buttons.push_back(std::make_shared<ButtonComponent>(_("DELETE"), _("delete game"),
|
||||||
std::make_shared<ButtonComponent>("DELETE", "delete game", deleteGameBtnFunc));
|
deleteGameBtnFunc));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -992,12 +1012,12 @@ void GuiMetaDataEd::close()
|
||||||
if (metadataUpdated) {
|
if (metadataUpdated) {
|
||||||
// Changes were made, ask if the user wants to save them.
|
// Changes were made, ask if the user wants to save them.
|
||||||
mWindow->pushGui(new GuiMsgBox(
|
mWindow->pushGui(new GuiMsgBox(
|
||||||
getHelpStyle(), "SAVE CHANGES?", "YES",
|
getHelpStyle(), _("SAVE CHANGES?"), _("YES"),
|
||||||
[this, closeFunc] {
|
[this, closeFunc] {
|
||||||
save();
|
save();
|
||||||
closeFunc();
|
closeFunc();
|
||||||
},
|
},
|
||||||
"NO", closeFunc, "", nullptr, nullptr, true));
|
_("NO"), closeFunc, "", nullptr, nullptr, true));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Always save if the media files have been changed (i.e. newly scraped images).
|
// Always save if the media files have been changed (i.e. newly scraped images).
|
||||||
|
@ -1028,7 +1048,7 @@ bool GuiMetaDataEd::input(InputConfig* config, Input input)
|
||||||
std::vector<HelpPrompt> GuiMetaDataEd::getHelpPrompts()
|
std::vector<HelpPrompt> GuiMetaDataEd::getHelpPrompts()
|
||||||
{
|
{
|
||||||
std::vector<HelpPrompt> prompts {mGrid.getHelpPrompts()};
|
std::vector<HelpPrompt> prompts {mGrid.getHelpPrompts()};
|
||||||
prompts.push_back(HelpPrompt("y", "scrape"));
|
prompts.push_back(HelpPrompt("y", _("scrape")));
|
||||||
prompts.push_back(HelpPrompt("b", "back"));
|
prompts.push_back(HelpPrompt("b", _("back")));
|
||||||
return prompts;
|
return prompts;
|
||||||
}
|
}
|
||||||
|
|
|
@ -277,6 +277,6 @@ bool GuiSettings::input(InputConfig* config, Input input)
|
||||||
std::vector<HelpPrompt> GuiSettings::getHelpPrompts()
|
std::vector<HelpPrompt> GuiSettings::getHelpPrompts()
|
||||||
{
|
{
|
||||||
std::vector<HelpPrompt> prompts {mMenu.getHelpPrompts()};
|
std::vector<HelpPrompt> prompts {mMenu.getHelpPrompts()};
|
||||||
prompts.push_back(HelpPrompt("b", "back"));
|
prompts.push_back(HelpPrompt("b", _("back")));
|
||||||
return prompts;
|
return prompts;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "CollectionSystemsManager.h"
|
#include "CollectionSystemsManager.h"
|
||||||
#include "UIModeController.h"
|
#include "UIModeController.h"
|
||||||
#include "animations/LambdaAnimation.h"
|
#include "animations/LambdaAnimation.h"
|
||||||
|
#include "utils/LocalizationUtil.h"
|
||||||
|
|
||||||
#define FADE_IN_START_OPACITY 0.5f
|
#define FADE_IN_START_OPACITY 0.5f
|
||||||
#define FADE_IN_TIME 325
|
#define FADE_IN_TIME 325
|
||||||
|
@ -506,33 +507,33 @@ std::vector<HelpPrompt> GamelistView::getHelpPrompts()
|
||||||
|
|
||||||
if (Settings::getInstance()->getString("QuickSystemSelect") != "disabled") {
|
if (Settings::getInstance()->getString("QuickSystemSelect") != "disabled") {
|
||||||
if (getQuickSystemSelectLeftButton() == "leftshoulder")
|
if (getQuickSystemSelectLeftButton() == "leftshoulder")
|
||||||
prompts.push_back(HelpPrompt("lr", "system"));
|
prompts.push_back(HelpPrompt("lr", _("system")));
|
||||||
else if (getQuickSystemSelectLeftButton() == "lefttrigger")
|
else if (getQuickSystemSelectLeftButton() == "lefttrigger")
|
||||||
prompts.push_back(HelpPrompt("ltrt", "system"));
|
prompts.push_back(HelpPrompt("ltrt", _("system")));
|
||||||
else if (getQuickSystemSelectLeftButton() == "left")
|
else if (getQuickSystemSelectLeftButton() == "left")
|
||||||
prompts.push_back(HelpPrompt("left/right", "system"));
|
prompts.push_back(HelpPrompt("left/right", _("system")));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mRoot->getSystem()->getThemeFolder() == "custom-collections" && mCursorStack.empty() &&
|
if (mRoot->getSystem()->getThemeFolder() == "custom-collections" && mCursorStack.empty() &&
|
||||||
ViewController::getInstance()->getState().viewing == ViewController::ViewMode::GAMELIST)
|
ViewController::getInstance()->getState().viewing == ViewController::ViewMode::GAMELIST)
|
||||||
prompts.push_back(HelpPrompt("a", "select"));
|
prompts.push_back(HelpPrompt("a", _("select")));
|
||||||
else
|
else
|
||||||
prompts.push_back(HelpPrompt("a", "select"));
|
prompts.push_back(HelpPrompt("a", _("select")));
|
||||||
|
|
||||||
prompts.push_back(HelpPrompt("b", "back"));
|
prompts.push_back(HelpPrompt("b", _("back")));
|
||||||
prompts.push_back(HelpPrompt("x", "view media"));
|
prompts.push_back(HelpPrompt("x", _("view media")));
|
||||||
|
|
||||||
if (!UIModeController::getInstance()->isUIModeKid())
|
if (!UIModeController::getInstance()->isUIModeKid())
|
||||||
prompts.push_back(HelpPrompt("back", "options"));
|
prompts.push_back(HelpPrompt("back", _("options")));
|
||||||
if (mRoot->getSystem()->isGameSystem() &&
|
if (mRoot->getSystem()->isGameSystem() &&
|
||||||
(Settings::getInstance()->getString("RandomEntryButton") == "games" ||
|
(Settings::getInstance()->getString("RandomEntryButton") == "games" ||
|
||||||
Settings::getInstance()->getString("RandomEntryButton") == "gamessystems"))
|
Settings::getInstance()->getString("RandomEntryButton") == "gamessystems"))
|
||||||
prompts.push_back(HelpPrompt("thumbstickclick", "random"));
|
prompts.push_back(HelpPrompt("thumbstickclick", _("random")));
|
||||||
|
|
||||||
if (mRoot->getSystem()->getThemeFolder() == "custom-collections" &&
|
if (mRoot->getSystem()->getThemeFolder() == "custom-collections" &&
|
||||||
!CollectionSystemsManager::getInstance()->isEditing() && mCursorStack.empty() &&
|
!CollectionSystemsManager::getInstance()->isEditing() && mCursorStack.empty() &&
|
||||||
ViewController::getInstance()->getState().viewing == ViewController::ViewMode::GAMELIST) {
|
ViewController::getInstance()->getState().viewing == ViewController::ViewMode::GAMELIST) {
|
||||||
prompts.push_back(HelpPrompt("y", "jump to game"));
|
prompts.push_back(HelpPrompt("y", _("jump to game")));
|
||||||
}
|
}
|
||||||
else if (mRoot->getSystem()->isGameSystem() &&
|
else if (mRoot->getSystem()->isGameSystem() &&
|
||||||
(mRoot->getSystem()->getThemeFolder() != "custom-collections" ||
|
(mRoot->getSystem()->getThemeFolder() != "custom-collections" ||
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "Window.h"
|
#include "Window.h"
|
||||||
#include "animations/LambdaAnimation.h"
|
#include "animations/LambdaAnimation.h"
|
||||||
#include "guis/GuiMsgBox.h"
|
#include "guis/GuiMsgBox.h"
|
||||||
|
#include "utils/LocalizationUtil.h"
|
||||||
#include "views/ViewController.h"
|
#include "views/ViewController.h"
|
||||||
|
|
||||||
#if defined(_WIN64)
|
#if defined(_WIN64)
|
||||||
|
@ -200,18 +201,18 @@ std::vector<HelpPrompt> SystemView::getHelpPrompts()
|
||||||
if (mCarousel != nullptr) {
|
if (mCarousel != nullptr) {
|
||||||
if (mCarousel->getType() == CarouselComponent<SystemData*>::CarouselType::VERTICAL ||
|
if (mCarousel->getType() == CarouselComponent<SystemData*>::CarouselType::VERTICAL ||
|
||||||
mCarousel->getType() == CarouselComponent<SystemData*>::CarouselType::VERTICAL_WHEEL)
|
mCarousel->getType() == CarouselComponent<SystemData*>::CarouselType::VERTICAL_WHEEL)
|
||||||
prompts.push_back(HelpPrompt("up/down", "choose"));
|
prompts.push_back(HelpPrompt("up/down", _("choose")));
|
||||||
else
|
else
|
||||||
prompts.push_back(HelpPrompt("left/right", "choose"));
|
prompts.push_back(HelpPrompt("left/right", _("choose")));
|
||||||
}
|
}
|
||||||
else if (mGrid != nullptr) {
|
else if (mGrid != nullptr) {
|
||||||
prompts.push_back(HelpPrompt("up/down/left/right", "choose"));
|
prompts.push_back(HelpPrompt("up/down/left/right", _("choose")));
|
||||||
}
|
}
|
||||||
else if (mTextList != nullptr) {
|
else if (mTextList != nullptr) {
|
||||||
prompts.push_back(HelpPrompt("up/down", "choose"));
|
prompts.push_back(HelpPrompt("up/down", _("choose")));
|
||||||
}
|
}
|
||||||
|
|
||||||
prompts.push_back(HelpPrompt("a", "select"));
|
prompts.push_back(HelpPrompt("a", _("select")));
|
||||||
|
|
||||||
if (Settings::getInstance()->getString("RandomEntryButton") == "gamessystems")
|
if (Settings::getInstance()->getString("RandomEntryButton") == "gamessystems")
|
||||||
prompts.push_back(HelpPrompt("thumbstickclick", "random"));
|
prompts.push_back(HelpPrompt("thumbstickclick", "random"));
|
||||||
|
|
|
@ -2063,6 +2063,7 @@ void ThemeData::parseElement(const pugi::xml_node& root,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(GETTEXT_DUMMY_ENTRIES)
|
||||||
void ThemeData::gettextMessageCatalogEntries()
|
void ThemeData::gettextMessageCatalogEntries()
|
||||||
{
|
{
|
||||||
// sSupportedFontSizes
|
// sSupportedFontSizes
|
||||||
|
@ -2084,3 +2085,4 @@ void ThemeData::gettextMessageCatalogEntries()
|
||||||
_("21:9 vertical");
|
_("21:9 vertical");
|
||||||
_("32:9 vertical");
|
_("32:9 vertical");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -263,8 +263,10 @@ private:
|
||||||
const std::map<std::string, ElementPropertyType>& typeMap,
|
const std::map<std::string, ElementPropertyType>& typeMap,
|
||||||
ThemeElement& element);
|
ThemeElement& element);
|
||||||
|
|
||||||
|
#if defined(GETTEXT_DUMMY_ENTRIES)
|
||||||
// This is just to get gettext msgid entries added to the PO message catalog files.
|
// This is just to get gettext msgid entries added to the PO message catalog files.
|
||||||
void gettextMessageCatalogEntries();
|
void gettextMessageCatalogEntries();
|
||||||
|
#endif
|
||||||
|
|
||||||
static std::vector<std::string> sSupportedViews;
|
static std::vector<std::string> sSupportedViews;
|
||||||
static std::vector<std::string> sSupportedMediaTypes;
|
static std::vector<std::string> sSupportedMediaTypes;
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "components/ComponentGrid.h"
|
#include "components/ComponentGrid.h"
|
||||||
|
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
|
#include "utils/LocalizationUtil.h"
|
||||||
|
|
||||||
using namespace GridFlags;
|
using namespace GridFlags;
|
||||||
|
|
||||||
|
@ -515,12 +516,12 @@ std::vector<HelpPrompt> ComponentGrid::getHelpPrompts()
|
||||||
|
|
||||||
// Check existing capabilities as indicated by the help prompts, and if the prompts should
|
// Check existing capabilities as indicated by the help prompts, and if the prompts should
|
||||||
// be combined into "up/down/left/right" then also remove the single-axis prompts.
|
// be combined into "up/down/left/right" then also remove the single-axis prompts.
|
||||||
if (!prompts.empty() && prompts.back() == HelpPrompt("up/down", "choose")) {
|
if (!prompts.empty() && prompts.back() == HelpPrompt("up/down", _("choose"))) {
|
||||||
canScrollVert = true;
|
canScrollVert = true;
|
||||||
if (canScrollHoriz && canScrollVert)
|
if (canScrollHoriz && canScrollVert)
|
||||||
prompts.pop_back();
|
prompts.pop_back();
|
||||||
}
|
}
|
||||||
else if (!prompts.empty() && prompts.back() == HelpPrompt("left/right", "choose")) {
|
else if (!prompts.empty() && prompts.back() == HelpPrompt("left/right", _("choose"))) {
|
||||||
canScrollHoriz = true;
|
canScrollHoriz = true;
|
||||||
if (canScrollHoriz && canScrollVert)
|
if (canScrollHoriz && canScrollVert)
|
||||||
prompts.pop_back();
|
prompts.pop_back();
|
||||||
|
@ -528,11 +529,11 @@ std::vector<HelpPrompt> ComponentGrid::getHelpPrompts()
|
||||||
|
|
||||||
// Any duplicates will be removed in Window::setHelpPrompts()
|
// Any duplicates will be removed in Window::setHelpPrompts()
|
||||||
if (canScrollHoriz && canScrollVert)
|
if (canScrollHoriz && canScrollVert)
|
||||||
prompts.push_back(HelpPrompt("up/down/left/right", "choose"));
|
prompts.push_back(HelpPrompt("up/down/left/right", _("choose")));
|
||||||
else if (canScrollHoriz)
|
else if (canScrollHoriz)
|
||||||
prompts.push_back(HelpPrompt("left/right", "choose"));
|
prompts.push_back(HelpPrompt("left/right", _("choose")));
|
||||||
else if (canScrollVert)
|
else if (canScrollVert)
|
||||||
prompts.push_back(HelpPrompt("up/down", "choose"));
|
prompts.push_back(HelpPrompt("up/down", _("choose")));
|
||||||
|
|
||||||
return prompts;
|
return prompts;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "components/ComponentList.h"
|
#include "components/ComponentList.h"
|
||||||
|
|
||||||
#include "resources/Font.h"
|
#include "resources/Font.h"
|
||||||
|
#include "utils/LocalizationUtil.h"
|
||||||
|
|
||||||
#define TOTAL_HORIZONTAL_PADDING_PX 20.0f
|
#define TOTAL_HORIZONTAL_PADDING_PX 20.0f
|
||||||
|
|
||||||
|
@ -412,7 +413,7 @@ std::vector<HelpPrompt> ComponentList::getHelpPrompts()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (addMovePrompt)
|
if (addMovePrompt)
|
||||||
prompts.push_back(HelpPrompt("up/down", "choose"));
|
prompts.push_back(HelpPrompt("up/down", _("choose")));
|
||||||
}
|
}
|
||||||
|
|
||||||
return prompts;
|
return prompts;
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
#include "resources/Font.h"
|
#include "resources/Font.h"
|
||||||
|
#include "utils/LocalizationUtil.h"
|
||||||
#include "utils/StringUtil.h"
|
#include "utils/StringUtil.h"
|
||||||
|
|
||||||
DateTimeEditComponent::DateTimeEditComponent(bool alignRight, DisplayMode dispMode)
|
DateTimeEditComponent::DateTimeEditComponent(bool alignRight, DisplayMode dispMode)
|
||||||
|
@ -235,13 +236,13 @@ std::vector<HelpPrompt> DateTimeEditComponent::getHelpPrompts()
|
||||||
{
|
{
|
||||||
std::vector<HelpPrompt> prompts;
|
std::vector<HelpPrompt> prompts;
|
||||||
if (!mEditing) {
|
if (!mEditing) {
|
||||||
prompts.push_back(HelpPrompt("a", "edit date"));
|
prompts.push_back(HelpPrompt("a", _("edit date")));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
prompts.push_back(HelpPrompt("b", "cancel"));
|
prompts.push_back(HelpPrompt("b", _("cancel")));
|
||||||
prompts.push_back(HelpPrompt("a", "apply"));
|
prompts.push_back(HelpPrompt("a", _("apply")));
|
||||||
prompts.push_back(HelpPrompt("left/right", "Y-M-D"));
|
prompts.push_back(HelpPrompt("left/right", _("Y-M-D")));
|
||||||
prompts.push_back(HelpPrompt("up/down", "modify"));
|
prompts.push_back(HelpPrompt("up/down", _("modify")));
|
||||||
}
|
}
|
||||||
return prompts;
|
return prompts;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "Window.h"
|
#include "Window.h"
|
||||||
#include "resources/TextureResource.h"
|
#include "resources/TextureResource.h"
|
||||||
#include "utils/CImgUtil.h"
|
#include "utils/CImgUtil.h"
|
||||||
|
#include "utils/LocalizationUtil.h"
|
||||||
#include "utils/StringUtil.h"
|
#include "utils/StringUtil.h"
|
||||||
|
|
||||||
ImageComponent::ImageComponent(bool forceLoad, bool dynamic)
|
ImageComponent::ImageComponent(bool forceLoad, bool dynamic)
|
||||||
|
@ -759,7 +760,7 @@ void ImageComponent::applyTheme(const std::shared_ptr<ThemeData>& theme,
|
||||||
std::vector<HelpPrompt> ImageComponent::getHelpPrompts()
|
std::vector<HelpPrompt> ImageComponent::getHelpPrompts()
|
||||||
{
|
{
|
||||||
std::vector<HelpPrompt> ret;
|
std::vector<HelpPrompt> ret;
|
||||||
ret.push_back(HelpPrompt("a", "select"));
|
ret.push_back(HelpPrompt("a", _("select")));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -373,9 +373,9 @@ private:
|
||||||
{
|
{
|
||||||
std::vector<HelpPrompt> prompts;
|
std::vector<HelpPrompt> prompts;
|
||||||
if (!mMultiSelect)
|
if (!mMultiSelect)
|
||||||
prompts.push_back(HelpPrompt("left/right", "change value"));
|
prompts.push_back(HelpPrompt("left/right", _("change value")));
|
||||||
|
|
||||||
prompts.push_back(HelpPrompt("a", "select"));
|
prompts.push_back(HelpPrompt("a", _("select")));
|
||||||
return prompts;
|
return prompts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -513,11 +513,11 @@ private:
|
||||||
mMenu.addRow(row, (!mParent->mMultiSelect && it->selected), false);
|
mMenu.addRow(row, (!mParent->mMultiSelect && it->selected), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
mMenu.addButton(_("BACK"), "back", [this] { delete this; });
|
mMenu.addButton(_("BACK"), _("back"), [this] { delete this; });
|
||||||
|
|
||||||
if (mParent->mMultiSelect) {
|
if (mParent->mMultiSelect) {
|
||||||
if (!mParent->mMultiExclusiveSelect) {
|
if (!mParent->mMultiExclusiveSelect) {
|
||||||
mMenu.addButton(_("SELECT ALL"), "select all", [this, checkBoxes] {
|
mMenu.addButton(_("SELECT ALL"), _("select all"), [this, checkBoxes] {
|
||||||
for (unsigned int i = 0; i < mParent->mEntries.size(); ++i) {
|
for (unsigned int i = 0; i < mParent->mEntries.size(); ++i) {
|
||||||
mParent->mEntries.at(i).selected = true;
|
mParent->mEntries.at(i).selected = true;
|
||||||
checkBoxes.at(i)->setImage(CHECKED_PATH);
|
checkBoxes.at(i)->setImage(CHECKED_PATH);
|
||||||
|
@ -526,18 +526,19 @@ private:
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
mMenu.addButton(_("SELECT NONE"), "select none", [this, checkBoxes, textEntries] {
|
mMenu.addButton(_("SELECT NONE"), _("select none"),
|
||||||
for (unsigned int i = 0; i < mParent->mEntries.size(); ++i) {
|
[this, checkBoxes, textEntries] {
|
||||||
mParent->mEntries.at(i).selected = false;
|
for (unsigned int i = 0; i < mParent->mEntries.size(); ++i) {
|
||||||
checkBoxes.at(i)->setImage(UNCHECKED_PATH);
|
mParent->mEntries.at(i).selected = false;
|
||||||
if (mParent->mMultiExclusiveSelect) {
|
checkBoxes.at(i)->setImage(UNCHECKED_PATH);
|
||||||
checkBoxes.at(i)->setOpacity(1.0f);
|
if (mParent->mMultiExclusiveSelect) {
|
||||||
textEntries.at(i)->setOpacity(1.0f);
|
checkBoxes.at(i)->setOpacity(1.0f);
|
||||||
textEntries.at(i)->setEnabled(true);
|
textEntries.at(i)->setOpacity(1.0f);
|
||||||
}
|
textEntries.at(i)->setEnabled(true);
|
||||||
}
|
}
|
||||||
mParent->onSelectedChanged();
|
}
|
||||||
});
|
mParent->onSelectedChanged();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
mMenu.setPosition((Renderer::getScreenWidth() - mMenu.getSize().x) / 2.0f,
|
mMenu.setPosition((Renderer::getScreenWidth() - mMenu.getSize().x) / 2.0f,
|
||||||
|
@ -558,8 +559,8 @@ private:
|
||||||
std::vector<HelpPrompt> getHelpPrompts() override
|
std::vector<HelpPrompt> getHelpPrompts() override
|
||||||
{
|
{
|
||||||
auto prompts = mMenu.getHelpPrompts();
|
auto prompts = mMenu.getHelpPrompts();
|
||||||
prompts.push_back(HelpPrompt("a", "select"));
|
prompts.push_back(HelpPrompt("a", _("select")));
|
||||||
prompts.push_back(HelpPrompt("b", "back"));
|
prompts.push_back(HelpPrompt("b", _("back")));
|
||||||
return prompts;
|
return prompts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
#include "ThemeData.h"
|
#include "ThemeData.h"
|
||||||
#include "resources/TextureResource.h"
|
#include "resources/TextureResource.h"
|
||||||
|
#include "utils/LocalizationUtil.h"
|
||||||
|
|
||||||
RatingComponent::RatingComponent(bool colorizeChanges, bool linearInterpolation)
|
RatingComponent::RatingComponent(bool colorizeChanges, bool linearInterpolation)
|
||||||
: mRenderer {Renderer::getInstance()}
|
: mRenderer {Renderer::getInstance()}
|
||||||
|
@ -308,6 +309,6 @@ void RatingComponent::applyTheme(const std::shared_ptr<ThemeData>& theme,
|
||||||
std::vector<HelpPrompt> RatingComponent::getHelpPrompts()
|
std::vector<HelpPrompt> RatingComponent::getHelpPrompts()
|
||||||
{
|
{
|
||||||
std::vector<HelpPrompt> prompts;
|
std::vector<HelpPrompt> prompts;
|
||||||
prompts.push_back(HelpPrompt("a", "add half star"));
|
prompts.push_back(HelpPrompt("a", _("add half star")));
|
||||||
return prompts;
|
return prompts;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "SwitchComponent.h"
|
#include "SwitchComponent.h"
|
||||||
|
|
||||||
#include "resources/Font.h"
|
#include "resources/Font.h"
|
||||||
|
#include "utils/LocalizationUtil.h"
|
||||||
|
|
||||||
SwitchComponent::SwitchComponent(bool state)
|
SwitchComponent::SwitchComponent(bool state)
|
||||||
: mState {state}
|
: mState {state}
|
||||||
|
@ -88,6 +89,6 @@ void SwitchComponent::onStateChanged()
|
||||||
std::vector<HelpPrompt> SwitchComponent::getHelpPrompts()
|
std::vector<HelpPrompt> SwitchComponent::getHelpPrompts()
|
||||||
{
|
{
|
||||||
std::vector<HelpPrompt> prompts;
|
std::vector<HelpPrompt> prompts;
|
||||||
prompts.push_back(HelpPrompt("a", "toggle"));
|
prompts.push_back(HelpPrompt("a", _("toggle")));
|
||||||
return prompts;
|
return prompts;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
#include "Window.h"
|
#include "Window.h"
|
||||||
|
#include "utils/LocalizationUtil.h"
|
||||||
#include "utils/StringUtil.h"
|
#include "utils/StringUtil.h"
|
||||||
|
|
||||||
TextComponent::TextComponent()
|
TextComponent::TextComponent()
|
||||||
|
@ -559,7 +560,7 @@ std::vector<HelpPrompt> TextComponent::getHelpPrompts()
|
||||||
{
|
{
|
||||||
std::vector<HelpPrompt> prompts;
|
std::vector<HelpPrompt> prompts;
|
||||||
if (mSelectable)
|
if (mSelectable)
|
||||||
prompts.push_back(HelpPrompt("a", "select"));
|
prompts.push_back(HelpPrompt("a", _("select")));
|
||||||
return prompts;
|
return prompts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include "components/TextEditComponent.h"
|
#include "components/TextEditComponent.h"
|
||||||
|
|
||||||
|
#include "utils/LocalizationUtil.h"
|
||||||
#include "utils/StringUtil.h"
|
#include "utils/StringUtil.h"
|
||||||
|
|
||||||
#if defined(__ANDROID__)
|
#if defined(__ANDROID__)
|
||||||
|
@ -402,13 +403,13 @@ std::vector<HelpPrompt> TextEditComponent::getHelpPrompts()
|
||||||
{
|
{
|
||||||
std::vector<HelpPrompt> prompts;
|
std::vector<HelpPrompt> prompts;
|
||||||
if (mEditing) {
|
if (mEditing) {
|
||||||
prompts.push_back(HelpPrompt("lt", "first"));
|
prompts.push_back(HelpPrompt("lt", _("first")));
|
||||||
prompts.push_back(HelpPrompt("rt", "last"));
|
prompts.push_back(HelpPrompt("rt", _("last")));
|
||||||
prompts.push_back(HelpPrompt("left/right", "move cursor"));
|
prompts.push_back(HelpPrompt("left/right", _("move cursor")));
|
||||||
prompts.push_back(HelpPrompt("b", "back"));
|
prompts.push_back(HelpPrompt("b", _("back")));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
prompts.push_back(HelpPrompt("a", "edit"));
|
prompts.push_back(HelpPrompt("a", _("edit")));
|
||||||
}
|
}
|
||||||
return prompts;
|
return prompts;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "Window.h"
|
#include "Window.h"
|
||||||
#include "resources/ResourceManager.h"
|
#include "resources/ResourceManager.h"
|
||||||
#include "utils/FileSystemUtil.h"
|
#include "utils/FileSystemUtil.h"
|
||||||
|
#include "utils/LocalizationUtil.h"
|
||||||
#include "utils/StringUtil.h"
|
#include "utils/StringUtil.h"
|
||||||
|
|
||||||
#define SCREENSAVER_FADE_IN_TIME 900
|
#define SCREENSAVER_FADE_IN_TIME 900
|
||||||
|
@ -392,7 +393,7 @@ void VideoComponent::applyTheme(const std::shared_ptr<ThemeData>& theme,
|
||||||
std::vector<HelpPrompt> VideoComponent::getHelpPrompts()
|
std::vector<HelpPrompt> VideoComponent::getHelpPrompts()
|
||||||
{
|
{
|
||||||
std::vector<HelpPrompt> ret;
|
std::vector<HelpPrompt> ret;
|
||||||
ret.push_back(HelpPrompt("a", "select"));
|
ret.push_back(HelpPrompt("a", _("select")));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -172,7 +172,7 @@ std::vector<HelpPrompt> GuiMsgBox::getHelpPrompts()
|
||||||
std::vector<HelpPrompt> prompts {mGrid.getHelpPrompts()};
|
std::vector<HelpPrompt> prompts {mGrid.getHelpPrompts()};
|
||||||
|
|
||||||
if (!mDisableBackButton)
|
if (!mDisableBackButton)
|
||||||
prompts.push_back(HelpPrompt("b", "Back"));
|
prompts.push_back(HelpPrompt("b", _("back")));
|
||||||
|
|
||||||
return prompts;
|
return prompts;
|
||||||
}
|
}
|
||||||
|
|
|
@ -364,13 +364,13 @@ bool GuiTextEditKeyboardPopup::input(InputConfig* config, Input input)
|
||||||
if (mText->getValue() != mInitValue) {
|
if (mText->getValue() != mInitValue) {
|
||||||
// Changes were made, ask if the user wants to save them.
|
// Changes were made, ask if the user wants to save them.
|
||||||
mWindow->pushGui(new GuiMsgBox(
|
mWindow->pushGui(new GuiMsgBox(
|
||||||
mHelpStyle, mSaveConfirmationText, "YES",
|
mHelpStyle, mSaveConfirmationText, _("YES"),
|
||||||
[this] {
|
[this] {
|
||||||
this->mOkCallback(mText->getValue());
|
this->mOkCallback(mText->getValue());
|
||||||
delete this;
|
delete this;
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
"NO",
|
_("NO"),
|
||||||
[this] {
|
[this] {
|
||||||
delete this;
|
delete this;
|
||||||
return true;
|
return true;
|
||||||
|
@ -498,19 +498,19 @@ std::vector<HelpPrompt> GuiTextEditKeyboardPopup::getHelpPrompts()
|
||||||
std::vector<HelpPrompt> prompts {mGrid.getHelpPrompts()};
|
std::vector<HelpPrompt> prompts {mGrid.getHelpPrompts()};
|
||||||
|
|
||||||
if (!mText->isEditing()) {
|
if (!mText->isEditing()) {
|
||||||
prompts.push_back(HelpPrompt("lt", "shift"));
|
prompts.push_back(HelpPrompt("lt", _("shift")));
|
||||||
prompts.push_back(HelpPrompt("rt", "alt"));
|
prompts.push_back(HelpPrompt("rt", _("alt")));
|
||||||
}
|
}
|
||||||
else if (mMultiLine) {
|
else if (mMultiLine) {
|
||||||
prompts.push_back(HelpPrompt("a", "newline"));
|
prompts.push_back(HelpPrompt("a", _("newline")));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
prompts.push_back(HelpPrompt("a", mAcceptBtnHelpText));
|
prompts.push_back(HelpPrompt("a", mAcceptBtnHelpText));
|
||||||
}
|
}
|
||||||
|
|
||||||
prompts.push_back(HelpPrompt("l", "backspace"));
|
prompts.push_back(HelpPrompt("l", _("backspace")));
|
||||||
prompts.push_back(HelpPrompt("r", "space"));
|
prompts.push_back(HelpPrompt("r", _("space")));
|
||||||
prompts.push_back(HelpPrompt("b", "back"));
|
prompts.push_back(HelpPrompt("b", _("back")));
|
||||||
|
|
||||||
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;
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "components/ComponentGrid.h"
|
#include "components/ComponentGrid.h"
|
||||||
#include "components/TextComponent.h"
|
#include "components/TextComponent.h"
|
||||||
#include "components/TextEditComponent.h"
|
#include "components/TextEditComponent.h"
|
||||||
|
#include "utils/LocalizationUtil.h"
|
||||||
|
|
||||||
class GuiTextEditKeyboardPopup : public GuiComponent
|
class GuiTextEditKeyboardPopup : public GuiComponent
|
||||||
{
|
{
|
||||||
|
@ -25,13 +26,13 @@ public:
|
||||||
const std::string& initValue,
|
const std::string& initValue,
|
||||||
const std::function<void(const std::string&)>& okCallback,
|
const std::function<void(const std::string&)>& okCallback,
|
||||||
bool multiLine,
|
bool multiLine,
|
||||||
const std::string& acceptBtnHelpText = "OK",
|
const std::string& acceptBtnHelpText = _("OK"),
|
||||||
const std::string& saveConfirmationText = "SAVE CHANGES?",
|
const std::string& saveConfirmationText = _("SAVE CHANGES?"),
|
||||||
const std::string& infoString = "",
|
const std::string& infoString = "",
|
||||||
const std::string& defaultValue = "",
|
const std::string& defaultValue = "",
|
||||||
const std::string& loadBtnHelpText = "LOAD DEFAULT",
|
const std::string& loadBtnHelpText = _("LOAD DEFAULT"),
|
||||||
const std::string& clearBtnHelpText = "CLEAR",
|
const std::string& clearBtnHelpText = _("CLEAR"),
|
||||||
const std::string& cancelBtnHelpText = "DISCARD CHANGES");
|
const std::string& cancelBtnHelpText = _("DISCARD CHANGES"));
|
||||||
|
|
||||||
void onSizeChanged() override;
|
void onSizeChanged() override;
|
||||||
bool input(InputConfig* config, Input input) override;
|
bool input(InputConfig* config, Input input) override;
|
||||||
|
|
|
@ -73,11 +73,11 @@ GuiTextEditPopup::GuiTextEditPopup(const HelpStyle& helpstyle,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
buttons.push_back(std::make_shared<ButtonComponent>("clear", clearBtnHelpText,
|
buttons.push_back(std::make_shared<ButtonComponent>(_("CLEAR"), clearBtnHelpText,
|
||||||
[this] { mText->setValue(""); }));
|
[this] { mText->setValue(""); }));
|
||||||
|
|
||||||
buttons.push_back(
|
buttons.push_back(std::make_shared<ButtonComponent>(_("CANCEL"), _("discard changes"),
|
||||||
std::make_shared<ButtonComponent>("CANCEL", "discard changes", [this] { delete this; }));
|
[this] { delete this; }));
|
||||||
|
|
||||||
mButtonGrid = MenuComponent::makeButtonGrid(buttons);
|
mButtonGrid = MenuComponent::makeButtonGrid(buttons);
|
||||||
|
|
||||||
|
@ -191,13 +191,13 @@ bool GuiTextEditPopup::input(InputConfig* config, Input input)
|
||||||
if (mText->getValue() != mInitValue) {
|
if (mText->getValue() != mInitValue) {
|
||||||
// Changes were made, ask if the user wants to save them.
|
// Changes were made, ask if the user wants to save them.
|
||||||
mWindow->pushGui(new GuiMsgBox(
|
mWindow->pushGui(new GuiMsgBox(
|
||||||
mHelpStyle, mSaveConfirmationText, "YES",
|
mHelpStyle, mSaveConfirmationText, _("YES"),
|
||||||
[this] {
|
[this] {
|
||||||
this->mOkCallback(mText->getValue());
|
this->mOkCallback(mText->getValue());
|
||||||
delete this;
|
delete this;
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
"NO",
|
_("NO"),
|
||||||
[this] {
|
[this] {
|
||||||
delete this;
|
delete this;
|
||||||
return true;
|
return true;
|
||||||
|
@ -272,14 +272,14 @@ std::vector<HelpPrompt> GuiTextEditPopup::getHelpPrompts()
|
||||||
|
|
||||||
if (mText->isEditing()) {
|
if (mText->isEditing()) {
|
||||||
if (mMultiLine)
|
if (mMultiLine)
|
||||||
prompts.push_back(HelpPrompt("a", "newline"));
|
prompts.push_back(HelpPrompt("a", _("newline")));
|
||||||
else
|
else
|
||||||
prompts.push_back(HelpPrompt("a", mAcceptBtnText));
|
prompts.push_back(HelpPrompt("a", mAcceptBtnText));
|
||||||
}
|
}
|
||||||
|
|
||||||
prompts.push_back(HelpPrompt("l", "backspace"));
|
prompts.push_back(HelpPrompt("l", _("backspace")));
|
||||||
prompts.push_back(HelpPrompt("r", "space"));
|
prompts.push_back(HelpPrompt("r", _("space")));
|
||||||
prompts.push_back(HelpPrompt("b", "back"));
|
prompts.push_back(HelpPrompt("b", _("back")));
|
||||||
return prompts;
|
return prompts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "components/ComponentGrid.h"
|
#include "components/ComponentGrid.h"
|
||||||
#include "components/TextComponent.h"
|
#include "components/TextComponent.h"
|
||||||
#include "components/TextEditComponent.h"
|
#include "components/TextEditComponent.h"
|
||||||
|
#include "utils/LocalizationUtil.h"
|
||||||
|
|
||||||
class GuiTextEditPopup : public GuiComponent
|
class GuiTextEditPopup : public GuiComponent
|
||||||
{
|
{
|
||||||
|
@ -24,13 +25,13 @@ public:
|
||||||
const std::string& initValue,
|
const std::string& initValue,
|
||||||
const std::function<void(const std::string&)>& okCallback,
|
const std::function<void(const std::string&)>& okCallback,
|
||||||
bool multiLine,
|
bool multiLine,
|
||||||
const std::string& acceptBtnText = "OK",
|
const std::string& acceptBtnText = _("OK"),
|
||||||
const std::string& saveConfirmationText = "SAVE CHANGES?",
|
const std::string& saveConfirmationText = _("SAVE CHANGES?"),
|
||||||
const std::string& infoString = "",
|
const std::string& infoString = "",
|
||||||
const std::string& defaultValue = "",
|
const std::string& defaultValue = "",
|
||||||
const std::string& loadBtnHelpText = "LOAD DEFAULT",
|
const std::string& loadBtnHelpText = _("LOAD DEFAULT"),
|
||||||
const std::string& clearBtnHelpText = "CLEAR",
|
const std::string& clearBtnHelpText = _("CLEAR"),
|
||||||
const std::string& cancelBtnHelpText = "DISCARD CHANGES");
|
const std::string& cancelBtnHelpText = _("DISCARD CHANGES"));
|
||||||
|
|
||||||
void onSizeChanged() override;
|
void onSizeChanged() override;
|
||||||
bool input(InputConfig* config, Input input) override;
|
bool input(InputConfig* config, Input input) override;
|
||||||
|
|
Loading…
Reference in a new issue