Translatable Compatibility Status (#2304)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / linux-qt-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions

* qt_gui: Made compatibility status translatable

* Translations: Added English and Spanish translation for compatibility status
This commit is contained in:
pdaloxd 2025-02-01 10:58:05 +01:00 committed by GitHub
parent 84c27eea2a
commit 83671ebf76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 75 additions and 8 deletions

View file

@ -260,3 +260,22 @@ void CompatibilityInfoClass::ExtractCompatibilityInfo(QByteArray response) {
return;
}
const QString CompatibilityInfoClass::GetCompatStatusString(const CompatibilityStatus status) {
switch (status) {
case CompatibilityStatus::Unknown:
return tr("Unknown");
case CompatibilityStatus::Nothing:
return tr("Nothing");
case CompatibilityStatus::Boots:
return tr("Boots");
case CompatibilityStatus::Menus:
return tr("Menus");
case CompatibilityStatus::Ingame:
return tr("Ingame");
case CompatibilityStatus::Playable:
return tr("Playable");
default:
return tr("Unknown");
}
}

View file

@ -69,13 +69,6 @@ public:
{QStringLiteral("os-windows"), OSType::Win32},
};
inline static const std::unordered_map<CompatibilityStatus, QString> CompatStatusToString = {
{CompatibilityStatus::Unknown, QStringLiteral("Unknown")},
{CompatibilityStatus::Nothing, QStringLiteral("Nothing")},
{CompatibilityStatus::Boots, QStringLiteral("Boots")},
{CompatibilityStatus::Menus, QStringLiteral("Menus")},
{CompatibilityStatus::Ingame, QStringLiteral("Ingame")},
{CompatibilityStatus::Playable, QStringLiteral("Playable")}};
inline static const std::unordered_map<OSType, QString> OSTypeToString = {
{OSType::Linux, QStringLiteral("os-linux")},
{OSType::macOS, QStringLiteral("os-macOS")},
@ -87,6 +80,7 @@ public:
void UpdateCompatibilityDatabase(QWidget* parent = nullptr, bool forced = false);
bool LoadCompatibilityFile();
CompatibilityEntry GetCompatibilityInfo(const std::string& serial);
const QString GetCompatStatusString(const CompatibilityStatus status);
void ExtractCompatibilityInfo(QByteArray response);
static bool WaitForReply(QNetworkReply* reply);
QNetworkReply* FetchPage(int page_num);

View file

@ -289,7 +289,7 @@ void GameListFrame::SetCompatibilityItem(int row, int column, CompatibilityEntry
QLabel* dotLabel = new QLabel("", widget);
dotLabel->setPixmap(circle_pixmap);
QLabel* label = new QLabel(m_compat_info->CompatStatusToString.at(entry.status), widget);
QLabel* label = new QLabel(m_compat_info->GetCompatStatusString(entry.status), widget);
label->setStyleSheet("color: white; font-size: 16px; font-weight: bold;");

View file

@ -1414,4 +1414,31 @@
<translation>TB</translation>
</message>
</context>
<context>
<name>CompatibilityInfoClass</name>
<message>
<source>Unknown</source>
<translation>Unknown</translation>
</message>
<message>
<source>Nothing</source>
<translation>Nothing</translation>
</message>
<message>
<source>Boots</source>
<translation>Boots</translation>
</message>
<message>
<source>Menus</source>
<translation>Menus</translation>
</message>
<message>
<source>Ingame</source>
<translation>Ingame</translation>
</message>
<message>
<source>Playable</source>
<translation>Playable</translation>
</message>
</context>
</TS>

View file

@ -1405,4 +1405,31 @@
<translation>TB</translation>
</message>
</context>
<context>
<name>CompatibilityInfoClass</name>
<message>
<source>Unknown</source>
<translation>Desconocido</translation>
</message>
<message>
<source>Nothing</source>
<translation>Nada</translation>
</message>
<message>
<source>Boots</source>
<translation>Inicia</translation>
</message>
<message>
<source>Menus</source>
<translation>Menús</translation>
</message>
<message>
<source>Ingame</source>
<translation>En el juego</translation>
</message>
<message>
<source>Playable</source>
<translation>Jugable</translation>
</message>
</context>
</TS>