Added translations for the name and fullname systemdata properties for the text element

This commit is contained in:
Leon Styhre 2024-09-01 12:27:23 +02:00
parent 6672aee6c5
commit 9a18a5c816

View file

@ -797,25 +797,56 @@ void SystemView::populate()
if (mGrid != nullptr) if (mGrid != nullptr)
mGrid->calculateLayout(); mGrid->calculateLayout();
#if defined(GETTEXT_DUMMY_ENTRIES)
_p("theme", "all");
_p("theme", "all games");
_p("theme", "recent");
_p("theme", "last played");
_p("theme", "favorites");
_p("theme", "collections");
#endif
for (auto& elements : mSystemElements) { for (auto& elements : mSystemElements) {
for (auto& text : elements.textComponents) { for (auto& text : elements.textComponents) {
if (text->getThemeSystemdata() != "") { if (text->getThemeSystemdata() != "") {
if (text->getThemeSystemdata() == "name") const bool translate {elements.system->isCollection() &&
text->setValue(elements.name); !elements.system->isCustomCollection()};
else if (text->getThemeSystemdata() == "fullname") if (text->getThemeSystemdata() == "name") {
text->setValue(elements.fullName); if (translate)
else text->setValue(_p("theme", elements.name.c_str()));
else
text->setValue(elements.name);
}
else if (text->getThemeSystemdata() == "fullname") {
if (translate)
text->setValue(_p("theme", elements.fullName.c_str()));
else
text->setValue(elements.fullName);
}
else {
text->setValue(text->getThemeSystemdata()); text->setValue(text->getThemeSystemdata());
}
} }
} }
for (auto& containerText : elements.containerTextComponents) { for (auto& containerText : elements.containerTextComponents) {
if (containerText->getThemeSystemdata() != "") { if (containerText->getThemeSystemdata() != "") {
if (containerText->getThemeSystemdata() == "name") const bool translate {elements.system->isCollection() &&
containerText->setValue(elements.name); !elements.system->isCustomCollection()};
else if (containerText->getThemeSystemdata() == "fullname") if (containerText->getThemeSystemdata() == "name") {
containerText->setValue(elements.fullName); if (translate)
else containerText->setValue(_p("theme", elements.name.c_str()));
else
containerText->setValue(elements.name);
}
else if (containerText->getThemeSystemdata() == "fullname") {
if (translate)
containerText->setValue(_p("theme", elements.fullName.c_str()));
else
containerText->setValue(elements.fullName);
}
else {
containerText->setValue(containerText->getThemeSystemdata()); containerText->setValue(containerText->getThemeSystemdata());
}
} }
} }
} }