From ff091a9d83124eae92e2a02000fcb8370107b8c9 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 31 Aug 2024 13:04:17 +0200 Subject: [PATCH] Added translations for the automatic collection names when used as theme system variables --- es-app/src/SystemData.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/es-app/src/SystemData.cpp b/es-app/src/SystemData.cpp index a1b12e422..93bec4d3c 100644 --- a/es-app/src/SystemData.cpp +++ b/es-app/src/SystemData.cpp @@ -1604,14 +1604,18 @@ void SystemData::loadTheme(ThemeTriggers::TriggerType trigger) // to the variables that are not applicable. This will be used in ThemeData to make sure // unpopulated system variables do not lead to theme loading errors. std::map sysData; + std::string fullName {getFullName()}; + // Always translate fullName for the automatic collections. + if (isCollection() && !isCustomCollection()) + fullName = _(fullName.c_str()); sysData.insert(std::pair("system.name", getName())); sysData.insert(std::pair("system.theme", getThemeFolder())); - sysData.insert(std::pair("system.fullName", getFullName())); + sysData.insert(std::pair("system.fullName", fullName)); if (isCollection() && isCustomCollection()) { sysData.insert( std::pair("system.name.customCollections", getName())); - sysData.insert(std::pair("system.fullName.customCollections", - getFullName())); + sysData.insert( + std::pair("system.fullName.customCollections", fullName)); sysData.insert(std::pair("system.theme.customCollections", getThemeFolder())); sysData.insert( @@ -1628,8 +1632,8 @@ void SystemData::loadTheme(ThemeTriggers::TriggerType trigger) else if (isCollection()) { sysData.insert( std::pair("system.name.autoCollections", getName())); - sysData.insert(std::pair("system.fullName.autoCollections", - getFullName())); + sysData.insert( + std::pair("system.fullName.autoCollections", fullName)); sysData.insert(std::pair("system.theme.autoCollections", getThemeFolder())); sysData.insert( @@ -1646,8 +1650,8 @@ void SystemData::loadTheme(ThemeTriggers::TriggerType trigger) else { sysData.insert( std::pair("system.name.noCollections", getName())); - sysData.insert(std::pair("system.fullName.noCollections", - getFullName())); + sysData.insert( + std::pair("system.fullName.noCollections", fullName)); sysData.insert(std::pair("system.theme.noCollections", getThemeFolder())); sysData.insert(