From 5e3d07bb56e2c152426be5d38697ed648c0fd0ed Mon Sep 17 00:00:00 2001 From: Leon Styhre <leon@leonstyhre.com> Date: Tue, 16 Jul 2024 12:15:29 +0200 Subject: [PATCH] Fixed an issue where some localization changes led to crashes --- es-app/src/CollectionSystemsManager.cpp | 18 +++++++++++++----- .../src/guis/GuiCollectionSystemsOptions.cpp | 4 ++-- locale/es-de.pot | 13 +++++++++++-- locale/po/en_US.po | 17 +++++++++++++---- locale/po/sv_SE.po | 17 +++++++++++++---- 5 files changed, 52 insertions(+), 17 deletions(-) diff --git a/es-app/src/CollectionSystemsManager.cpp b/es-app/src/CollectionSystemsManager.cpp index 62307936f..13d0de17f 100644 --- a/es-app/src/CollectionSystemsManager.cpp +++ b/es-app/src/CollectionSystemsManager.cpp @@ -47,14 +47,22 @@ CollectionSystemsManager::CollectionSystemsManager() noexcept { // clang-format off CollectionSystemDecl systemDecls[] { - // Type Name Long name Theme folder isCustom - {AUTO_ALL_GAMES, "all", _("ALL GAMES"), "auto-allgames", false}, - {AUTO_LAST_PLAYED, "recent", _("LAST PLAYED"), "auto-lastplayed", false}, - {AUTO_FAVORITES, "favorites", _("FAVORITES"), "auto-favorites", false}, - {CUSTOM_COLLECTION, myCollectionsName, _("COLLECTIONS"), "custom-collections", true } + // Type Name Long name Theme folder isCustom + {AUTO_ALL_GAMES, "all", "all games", "auto-allgames", false}, + {AUTO_LAST_PLAYED, "recent", "last played", "auto-lastplayed", false}, + {AUTO_FAVORITES, "favorites", "favorites", "auto-favorites", false}, + {CUSTOM_COLLECTION, myCollectionsName, "collections", "custom-collections", true } }; // clang-format on +#if defined(GETTEXT_DUMMY_ENTRIES) + // This is just to get gettext msgid entries added to the PO message catalog files. + _("all games"); + _("last played"); + _("favorites"); + _("collections"); +#endif + // Create a map of the collections. std::vector<CollectionSystemDecl> tempSystemDecl {std::vector<CollectionSystemDecl>( systemDecls, systemDecls + sizeof(systemDecls) / sizeof(systemDecls[0]))}; diff --git a/es-app/src/guis/GuiCollectionSystemsOptions.cpp b/es-app/src/guis/GuiCollectionSystemsOptions.cpp index 2cf127307..ef1ec8225 100644 --- a/es-app/src/guis/GuiCollectionSystemsOptions.cpp +++ b/es-app/src/guis/GuiCollectionSystemsOptions.cpp @@ -54,8 +54,8 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(std::string title) for (std::map<std::string, CollectionSystemData, StringComparator>::const_iterator it = autoSystems.cbegin(); it != autoSystems.cend(); ++it) - mCollectionSystemsAuto->add(it->second.decl.fullName, it->second.decl.name, - it->second.isEnabled); + mCollectionSystemsAuto->add(Utils::String::toUpper(_(it->second.decl.fullName.c_str())), + it->second.decl.name, it->second.isEnabled); addWithLabel(_("AUTOMATIC GAME COLLECTIONS"), mCollectionSystemsAuto); addSaveFunc([this, autoSystems] { std::string autoSystemsSelected {Utils::String::vectorToDelimitedString( diff --git a/locale/es-de.pot b/locale/es-de.pot index d627f6650..634e2150c 100644 --- a/locale/es-de.pot +++ b/locale/es-de.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ES-DE Frontend\n" "Report-Msgid-Bugs-To: info@es-de.org\n" -"POT-Creation-Date: 2024-07-16 11:23+0200\n" +"POT-Creation-Date: 2024-07-16 12:11+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <info@es-de.org>\n" @@ -1685,7 +1685,16 @@ msgstr "" msgid "quit application" msgstr "" -msgid "FAVORITES" +msgid "all games" +msgstr "" + +msgid "last played" +msgstr "" + +msgid "favorites" +msgstr "" + +msgid "collections" msgstr "" msgid "name, ascending" diff --git a/locale/po/en_US.po b/locale/po/en_US.po index be5d4292a..b34913db7 100644 --- a/locale/po/en_US.po +++ b/locale/po/en_US.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: ES-DE Frontend\n" "Report-Msgid-Bugs-To: info@es-de.org\n" -"POT-Creation-Date: 2024-07-16 11:23+0200\n" -"PO-Revision-Date: 2024-07-16 11:23+0200\n" +"POT-Creation-Date: 2024-07-16 12:11+0200\n" +"PO-Revision-Date: 2024-07-16 12:10+0200\n" "Last-Translator: Northwestern Software <info@es-de.org>\n" "Language-Team: English <info@es-de.org>\n" "Language: en_US\n" @@ -1739,8 +1739,17 @@ msgstr "Find the detailed changelog at" msgid "quit application" msgstr "quit application" -msgid "FAVORITES" -msgstr "FAVORITES" +msgid "all games" +msgstr "all games" + +msgid "last played" +msgstr "last played" + +msgid "favorites" +msgstr "favorites" + +msgid "collections" +msgstr "collections" msgid "name, ascending" msgstr "name, ascending" diff --git a/locale/po/sv_SE.po b/locale/po/sv_SE.po index 86b73d8b0..6a39e6c40 100644 --- a/locale/po/sv_SE.po +++ b/locale/po/sv_SE.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: ES-DE Frontend\n" "Report-Msgid-Bugs-To: info@es-de.org\n" -"POT-Creation-Date: 2024-07-16 11:23+0200\n" -"PO-Revision-Date: 2024-07-16 11:23+0200\n" +"POT-Creation-Date: 2024-07-16 12:11+0200\n" +"PO-Revision-Date: 2024-07-16 12:10+0200\n" "Last-Translator: Northwestern Software <info@es-de.org>\n" "Language-Team: Swedish <info@es-de.org>\n" "Language: sv_SE\n" @@ -1742,8 +1742,17 @@ msgstr "Se den detaljerade ändringsloggen på" msgid "quit application" msgstr "avsluta applikationen" -msgid "FAVORITES" -msgstr "FAVORITER" +msgid "all games" +msgstr "alla spel" + +msgid "last played" +msgstr "senast spelat" + +msgid "favorites" +msgstr "favoriter" + +msgid "collections" +msgstr "spelsamlingar" msgid "name, ascending" msgstr "namn, stigande"