GUI: Mark Grid-related things translatable
This commit is contained in:
parent
9a01b16ada
commit
f33e3c26a5
5 changed files with 38 additions and 21 deletions
|
@ -574,6 +574,7 @@ bool LauncherDialog::doGameDetection(const Common::String &path) {
|
||||||
|
|
||||||
if (candidates[idx].hasUnknownFiles) {
|
if (candidates[idx].hasUnknownFiles) {
|
||||||
description += Common::U32String(" - ");
|
description += Common::U32String(" - ");
|
||||||
|
// I18N: Unknown game variant
|
||||||
description += _("Unknown variant");
|
description += _("Unknown variant");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -834,14 +835,14 @@ void LauncherChooser::selectLauncher() {
|
||||||
|
|
||||||
switch (requestedType) {
|
switch (requestedType) {
|
||||||
case kLauncherDisplayGrid:
|
case kLauncherDisplayGrid:
|
||||||
_impl = new LauncherGrid(Common::U32String("LauncherGrid"));
|
_impl = new LauncherGrid("LauncherGrid");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// fallthrough intended
|
// fallthrough intended
|
||||||
case kLauncherDisplayList:
|
case kLauncherDisplayList:
|
||||||
#endif // !DISABLE_LAUNCHERDISPLAY_GRID
|
#endif // !DISABLE_LAUNCHERDISPLAY_GRID
|
||||||
_impl = new LauncherSimple(Common::U32String("Launcher"));
|
_impl = new LauncherSimple("Launcher");
|
||||||
#ifndef DISABLE_LAUNCHERDISPLAY_GRID
|
#ifndef DISABLE_LAUNCHERDISPLAY_GRID
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -865,7 +866,7 @@ int LauncherChooser::runModal() {
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
|
||||||
LauncherSimple::LauncherSimple(const Common::U32String &title)
|
LauncherSimple::LauncherSimple(const Common::String &title)
|
||||||
: LauncherDialog(title),
|
: LauncherDialog(title),
|
||||||
_list(nullptr) {
|
_list(nullptr) {
|
||||||
build();
|
build();
|
||||||
|
@ -1025,7 +1026,8 @@ void LauncherSimple::groupEntries(const Common::Array<const Common::ConfigManage
|
||||||
attrs.push_back(engineid);
|
attrs.push_back(engineid);
|
||||||
}
|
}
|
||||||
_list->setGroupHeaderFormat(Common::U32String(""), Common::U32String(""));
|
_list->setGroupHeaderFormat(Common::U32String(""), Common::U32String(""));
|
||||||
metadataNames[""] = "Unknown Engine";
|
// I18N: List grouping when no engine is specified
|
||||||
|
metadataNames[""] = _("Unknown Engine");
|
||||||
Common::HashMap<Common::String, MetadataEngine, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo>::iterator i = _metadataParser._engineInfo.begin();
|
Common::HashMap<Common::String, MetadataEngine, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo>::iterator i = _metadataParser._engineInfo.begin();
|
||||||
for (; i != _metadataParser._engineInfo.end(); ++i) {
|
for (; i != _metadataParser._engineInfo.end(); ++i) {
|
||||||
if (i->_value.alt_name.empty()) {
|
if (i->_value.alt_name.empty()) {
|
||||||
|
@ -1042,7 +1044,8 @@ void LauncherSimple::groupEntries(const Common::Array<const Common::ConfigManage
|
||||||
attrs.push_back(_metadataParser._gameInfo[gameid].company_id);
|
attrs.push_back(_metadataParser._gameInfo[gameid].company_id);
|
||||||
}
|
}
|
||||||
_list->setGroupHeaderFormat(Common::U32String(""), Common::U32String(""));
|
_list->setGroupHeaderFormat(Common::U32String(""), Common::U32String(""));
|
||||||
metadataNames[""] = "Unknown Publisher";
|
// I18N: List grouping when no pubisher is specified
|
||||||
|
metadataNames[""] = _("Unknown Publisher");
|
||||||
Common::HashMap<Common::String, MetadataCompany, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo>::iterator i = _metadataParser._companyInfo.begin();
|
Common::HashMap<Common::String, MetadataCompany, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo>::iterator i = _metadataParser._companyInfo.begin();
|
||||||
for (; i != _metadataParser._companyInfo.end(); ++i) {
|
for (; i != _metadataParser._companyInfo.end(); ++i) {
|
||||||
if (i->_value.alt_name.empty()) {
|
if (i->_value.alt_name.empty()) {
|
||||||
|
@ -1059,7 +1062,8 @@ void LauncherSimple::groupEntries(const Common::Array<const Common::ConfigManage
|
||||||
attrs.push_back(_metadataParser._gameInfo[gameid].series_id);
|
attrs.push_back(_metadataParser._gameInfo[gameid].series_id);
|
||||||
}
|
}
|
||||||
_list->setGroupHeaderFormat(Common::U32String(""), Common::U32String(""));
|
_list->setGroupHeaderFormat(Common::U32String(""), Common::U32String(""));
|
||||||
metadataNames[""] = "No Series";
|
// I18N: List group when no game series is specified
|
||||||
|
metadataNames[""] = _("No Series");
|
||||||
Common::HashMap<Common::String, MetadataSeries, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo>::iterator i = _metadataParser._seriesInfo.begin();
|
Common::HashMap<Common::String, MetadataSeries, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo>::iterator i = _metadataParser._seriesInfo.begin();
|
||||||
for (; i != _metadataParser._seriesInfo.end(); ++i) {
|
for (; i != _metadataParser._seriesInfo.end(); ++i) {
|
||||||
metadataNames[i->_key] = i->_value.name;
|
metadataNames[i->_key] = i->_value.name;
|
||||||
|
@ -1073,7 +1077,8 @@ void LauncherSimple::groupEntries(const Common::Array<const Common::ConfigManage
|
||||||
attrs.push_back(language);
|
attrs.push_back(language);
|
||||||
}
|
}
|
||||||
_list->setGroupHeaderFormat(Common::U32String(""), Common::U32String(""));
|
_list->setGroupHeaderFormat(Common::U32String(""), Common::U32String(""));
|
||||||
metadataNames[""] = "Language not detected";
|
// I18N: List group when no languageis specified
|
||||||
|
metadataNames[""] = _("Language not detected");
|
||||||
const Common::LanguageDescription *l = Common::g_languages;
|
const Common::LanguageDescription *l = Common::g_languages;
|
||||||
for (; l->code; ++l) {
|
for (; l->code; ++l) {
|
||||||
metadataNames[l->code] = l->description;
|
metadataNames[l->code] = l->description;
|
||||||
|
@ -1087,7 +1092,8 @@ void LauncherSimple::groupEntries(const Common::Array<const Common::ConfigManage
|
||||||
attrs.push_back(platform);
|
attrs.push_back(platform);
|
||||||
}
|
}
|
||||||
_list->setGroupHeaderFormat(Common::U32String(""), Common::U32String(""));
|
_list->setGroupHeaderFormat(Common::U32String(""), Common::U32String(""));
|
||||||
metadataNames[""] = "Platform not detected";
|
// I18N: List group when no platform is specified
|
||||||
|
metadataNames[""] = _("Platform not detected");
|
||||||
const Common::PlatformDescription *p = Common::g_platforms;
|
const Common::PlatformDescription *p = Common::g_platforms;
|
||||||
for (; p->code; ++p) {
|
for (; p->code; ++p) {
|
||||||
metadataNames[p->code] = p->description;
|
metadataNames[p->code] = p->description;
|
||||||
|
@ -1183,7 +1189,7 @@ void LauncherSimple::updateButtons() {
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
|
||||||
#ifndef DISABLE_LAUNCHERDISPLAY_GRID
|
#ifndef DISABLE_LAUNCHERDISPLAY_GRID
|
||||||
LauncherGrid::LauncherGrid(const Common::U32String &title)
|
LauncherGrid::LauncherGrid(const Common::String &title)
|
||||||
: LauncherDialog(title),
|
: LauncherDialog(title),
|
||||||
_grid(nullptr) {
|
_grid(nullptr) {
|
||||||
build();
|
build();
|
||||||
|
@ -1207,7 +1213,8 @@ void LauncherGrid::groupEntries(const Common::Array<const Common::ConfigManager:
|
||||||
attrs.push_back(engineid);
|
attrs.push_back(engineid);
|
||||||
}
|
}
|
||||||
_grid->setGroupHeaderFormat(Common::U32String(""), Common::U32String(""));
|
_grid->setGroupHeaderFormat(Common::U32String(""), Common::U32String(""));
|
||||||
metadataNames[""] = "Unknown Engine";
|
// I18N: List grouping when no enginr is specified
|
||||||
|
metadataNames[""] = _("Unknown Engine");
|
||||||
Common::HashMap<Common::String, MetadataEngine, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo>::iterator i = _metadataParser._engineInfo.begin();
|
Common::HashMap<Common::String, MetadataEngine, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo>::iterator i = _metadataParser._engineInfo.begin();
|
||||||
for (; i != _metadataParser._engineInfo.end(); ++i) {
|
for (; i != _metadataParser._engineInfo.end(); ++i) {
|
||||||
if (i->_value.alt_name.empty()) {
|
if (i->_value.alt_name.empty()) {
|
||||||
|
@ -1224,7 +1231,8 @@ void LauncherGrid::groupEntries(const Common::Array<const Common::ConfigManager:
|
||||||
attrs.push_back(_metadataParser._gameInfo[gameid].series_id);
|
attrs.push_back(_metadataParser._gameInfo[gameid].series_id);
|
||||||
}
|
}
|
||||||
_grid->setGroupHeaderFormat(Common::U32String(""), Common::U32String(""));
|
_grid->setGroupHeaderFormat(Common::U32String(""), Common::U32String(""));
|
||||||
metadataNames[""] = "No Series";
|
// I18N: List grouping when no game series is specified
|
||||||
|
metadataNames[""] = _("No Series");
|
||||||
Common::HashMap<Common::String, MetadataSeries, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo>::iterator i = _metadataParser._seriesInfo.begin();
|
Common::HashMap<Common::String, MetadataSeries, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo>::iterator i = _metadataParser._seriesInfo.begin();
|
||||||
for (; i != _metadataParser._seriesInfo.end(); ++i) {
|
for (; i != _metadataParser._seriesInfo.end(); ++i) {
|
||||||
metadataNames[i->_key] = i->_value.name;
|
metadataNames[i->_key] = i->_value.name;
|
||||||
|
@ -1237,7 +1245,8 @@ void LauncherGrid::groupEntries(const Common::Array<const Common::ConfigManager:
|
||||||
attrs.push_back(_metadataParser._gameInfo[gameid].company_id);
|
attrs.push_back(_metadataParser._gameInfo[gameid].company_id);
|
||||||
}
|
}
|
||||||
_grid->setGroupHeaderFormat(Common::U32String(""), Common::U32String(""));
|
_grid->setGroupHeaderFormat(Common::U32String(""), Common::U32String(""));
|
||||||
metadataNames[""] = "Unknown Publisher";
|
// I18N: List group when no publisher is specified
|
||||||
|
metadataNames[""] = _("Unknown Publisher");
|
||||||
Common::HashMap<Common::String, MetadataCompany, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo>::iterator i = _metadataParser._companyInfo.begin();
|
Common::HashMap<Common::String, MetadataCompany, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo>::iterator i = _metadataParser._companyInfo.begin();
|
||||||
for (; i != _metadataParser._companyInfo.end(); ++i) {
|
for (; i != _metadataParser._companyInfo.end(); ++i) {
|
||||||
if (i->_value.alt_name.empty()) {
|
if (i->_value.alt_name.empty()) {
|
||||||
|
@ -1255,7 +1264,8 @@ void LauncherGrid::groupEntries(const Common::Array<const Common::ConfigManager:
|
||||||
attrs.push_back(language);
|
attrs.push_back(language);
|
||||||
}
|
}
|
||||||
_grid->setGroupHeaderFormat(Common::U32String(""), Common::U32String(""));
|
_grid->setGroupHeaderFormat(Common::U32String(""), Common::U32String(""));
|
||||||
metadataNames[""] = "Language not detected";
|
// I18N: List group when no language is specified
|
||||||
|
metadataNames[""] = _("Language not detected");
|
||||||
const Common::LanguageDescription *l = Common::g_languages;
|
const Common::LanguageDescription *l = Common::g_languages;
|
||||||
for (; l->code; ++l) {
|
for (; l->code; ++l) {
|
||||||
metadataNames[l->code] = l->description;
|
metadataNames[l->code] = l->description;
|
||||||
|
@ -1269,7 +1279,8 @@ void LauncherGrid::groupEntries(const Common::Array<const Common::ConfigManager:
|
||||||
attrs.push_back(platform);
|
attrs.push_back(platform);
|
||||||
}
|
}
|
||||||
_grid->setGroupHeaderFormat(Common::U32String(""), Common::U32String(""));
|
_grid->setGroupHeaderFormat(Common::U32String(""), Common::U32String(""));
|
||||||
metadataNames[""] = "Platform not detected";
|
// I18N: List group when no platform is specified
|
||||||
|
metadataNames[""] = _("Platform not detected");
|
||||||
const Common::PlatformDescription *p = Common::g_platforms;
|
const Common::PlatformDescription *p = Common::g_platforms;
|
||||||
for (; p->code; ++p) {
|
for (; p->code; ++p) {
|
||||||
metadataNames[p->code] = p->description;
|
metadataNames[p->code] = p->description;
|
||||||
|
@ -1279,7 +1290,8 @@ void LauncherGrid::groupEntries(const Common::Array<const Common::ConfigManager:
|
||||||
case kGroupByNone: // Fall-through intentional
|
case kGroupByNone: // Fall-through intentional
|
||||||
default:
|
default:
|
||||||
for (uint i = 0; i < metadata.size(); ++i) {
|
for (uint i = 0; i < metadata.size(); ++i) {
|
||||||
attrs.push_back(Common::String("All"));
|
// I18N: Group for All items
|
||||||
|
attrs.push_back(_("All"));
|
||||||
}
|
}
|
||||||
_grid->setGroupHeaderFormat(Common::U32String(""), Common::U32String(""));
|
_grid->setGroupHeaderFormat(Common::U32String(""), Common::U32String(""));
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -192,7 +192,7 @@ public:
|
||||||
|
|
||||||
class LauncherSimple : public LauncherDialog {
|
class LauncherSimple : public LauncherDialog {
|
||||||
public:
|
public:
|
||||||
LauncherSimple(const Common::U32String &title);
|
LauncherSimple(const Common::String &title);
|
||||||
|
|
||||||
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
|
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
|
||||||
void handleKeyDown(Common::KeyState state) override;
|
void handleKeyDown(Common::KeyState state) override;
|
||||||
|
@ -213,7 +213,7 @@ private:
|
||||||
#ifndef DISABLE_LAUNCHERDISPLAY_GRID
|
#ifndef DISABLE_LAUNCHERDISPLAY_GRID
|
||||||
class LauncherGrid : public LauncherDialog {
|
class LauncherGrid : public LauncherDialog {
|
||||||
public:
|
public:
|
||||||
LauncherGrid(const Common::U32String &title);
|
LauncherGrid(const Common::String &title);
|
||||||
|
|
||||||
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
|
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
|
||||||
void handleKeyDown(Common::KeyState state) override;
|
void handleKeyDown(Common::KeyState state) override;
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "common/language.h"
|
#include "common/language.h"
|
||||||
#include "common/platform.h"
|
#include "common/platform.h"
|
||||||
#include "common/tokenizer.h"
|
#include "common/tokenizer.h"
|
||||||
|
#include "common/translation.h"
|
||||||
|
|
||||||
#include "gui/gui-manager.h"
|
#include "gui/gui-manager.h"
|
||||||
#include "gui/widgets/grid.h"
|
#include "gui/widgets/grid.h"
|
||||||
|
@ -215,13 +216,13 @@ GridItemTray::GridItemTray(GuiObject *boss, int x, int y, int w, int h, int entr
|
||||||
|
|
||||||
_playButton = new PicButtonWidget(this, trayPaddingX, trayPaddingY,
|
_playButton = new PicButtonWidget(this, trayPaddingX, trayPaddingY,
|
||||||
2 * buttonWidth + buttonSpacingX, buttonHeight,
|
2 * buttonWidth + buttonSpacingX, buttonHeight,
|
||||||
Common::U32String("Play"), kPlayButtonCmd);
|
_("Play"), kPlayButtonCmd);
|
||||||
_loadButton = new PicButtonWidget(this, trayPaddingX, trayPaddingY + buttonHeight + buttonSpacingY,
|
_loadButton = new PicButtonWidget(this, trayPaddingX, trayPaddingY + buttonHeight + buttonSpacingY,
|
||||||
buttonWidth, buttonHeight,
|
buttonWidth, buttonHeight,
|
||||||
Common::U32String("Saves"), kLoadButtonCmd);
|
_("Saves"), kLoadButtonCmd);
|
||||||
_editButton = new PicButtonWidget(this, trayPaddingX + buttonWidth + buttonSpacingX, trayPaddingY + buttonHeight + buttonSpacingY,
|
_editButton = new PicButtonWidget(this, trayPaddingX + buttonWidth + buttonSpacingX, trayPaddingY + buttonHeight + buttonSpacingY,
|
||||||
buttonWidth, buttonHeight,
|
buttonWidth, buttonHeight,
|
||||||
Common::U32String("Edit"), kEditButtonCmd);
|
_("Edit"), kEditButtonCmd);
|
||||||
|
|
||||||
_playButton->useThemeTransparency(true);
|
_playButton->useThemeTransparency(true);
|
||||||
_loadButton->useThemeTransparency(true);
|
_loadButton->useThemeTransparency(true);
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "common/system.h"
|
#include "common/system.h"
|
||||||
#include "common/frac.h"
|
#include "common/frac.h"
|
||||||
#include "common/tokenizer.h"
|
#include "common/tokenizer.h"
|
||||||
|
#include "common/translation.h"
|
||||||
|
|
||||||
#include "gui/widgets/groupedlist.h"
|
#include "gui/widgets/groupedlist.h"
|
||||||
#include "gui/widgets/scrollbar.h"
|
#include "gui/widgets/scrollbar.h"
|
||||||
|
@ -118,7 +119,8 @@ void GroupedListWidget::groupByAttribute() {
|
||||||
|
|
||||||
if (_attributeValues.empty()) {
|
if (_attributeValues.empty()) {
|
||||||
_groupExpanded.push_back(true);
|
_groupExpanded.push_back(true);
|
||||||
_groupHeaders.push_back(Common::String("All"));
|
// I18N: Group for All items
|
||||||
|
_groupHeaders.push_back(_("All"));
|
||||||
_groupValueIndex.setVal(Common::String("All"), 0);
|
_groupValueIndex.setVal(Common::String("All"), 0);
|
||||||
for (uint i = 0; i < _dataList.size(); ++i) {
|
for (uint i = 0; i < _dataList.size(); ++i) {
|
||||||
_itemsInGroup[0].push_back(i);
|
_itemsInGroup[0].push_back(i);
|
||||||
|
|
|
@ -23,6 +23,8 @@ gui/ThemeEngine.cpp
|
||||||
gui/unknown-game-dialog.cpp
|
gui/unknown-game-dialog.cpp
|
||||||
gui/updates-dialog.cpp
|
gui/updates-dialog.cpp
|
||||||
gui/widget.cpp
|
gui/widget.cpp
|
||||||
|
gui/widget/grid.cpp
|
||||||
|
gui/widget/groupedlist.cpp
|
||||||
|
|
||||||
base/main.cpp
|
base/main.cpp
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue