aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhowie-f <rftc@gmx.de>2020-11-13 16:53:16 +0000
committerhowie-f <rftc@gmx.de>2020-11-14 10:00:25 +0000
commit978d76f816b213032b9bca4f35c958215b008f7c (patch)
treed24ff47261bb2a668a619c4f04feb02859e4bcea
parentd3e900034f6b0c3213c14e71a723fdd13578a3d8 (diff)
[addons] improve ShowDependencyList dialog label creation
-rw-r--r--addons/resource.language.en_gb/resources/strings.po24
-rw-r--r--xbmc/addons/gui/GUIDialogAddonInfo.cpp29
2 files changed, 28 insertions, 25 deletions
diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po
index 0ce12b7d56..dc73e73828 100644
--- a/addons/resource.language.en_gb/resources/strings.po
+++ b/addons/resource.language.en_gb/resources/strings.po
@@ -15838,27 +15838,41 @@ msgstr ""
#24171-24179 reserved for future use of lifecycle state name (to have continuous chain of GUI)
+#. The minimum version a dependency must meet. This is set in the <requires> tag of the dependee
+#. {3:s} reserved for an empty string or the " (optional)" optional string. see #24184
#: xbmc/addons/GUIDialogAddonInfo.cpp
msgctxt "#24180"
-msgid "Minimum: {0:s}"
+msgid "Minimum: {0:s}{3:s}"
msgstr ""
+#. The minimum version, plus the version going to be installed
+#. {3:s} reserved for an empty string or the " (optional)" optional string. see #24184
#: xbmc/addons/gui/GUIDialogAddonInfo.cpp
msgctxt "#24181"
-msgid " => Install: {0:s}"
+msgid "Minimum: {0:s} => Install: {2:s}{3:s}"
msgstr ""
+#. The minimum version, plus the currently installed version
+#. {3:s} reserved for an empty string or the " (optional)" optional string. see #24184
#: xbmc/addons/gui/GUIDialogAddonInfo.cpp
msgctxt "#24182"
-msgid " / Installed: {0:s}"
+msgid "Minimum: {0:s} / Installed: {1:s}{3:s}"
msgstr ""
+#. The minimum version, the currently installed, plus the updated version we're going to install
+#. {3:s} reserved for an empty string or the " (optional)" optional string. see #24184
#: xbmc/addons/gui/GUIDialogAddonInfo.cpp
msgctxt "#24183"
-msgid " => Update to: {0:s}"
+msgid "Minimum: {0:s} / Installed: {1:s} => Update to: {2:s}{3:s}"
msgstr ""
-#empty strings from id 24184 to 24990
+#. used in #24180 - #24183 as {3:s}
+#: xbmc/addons/gui/GUIDialogAddonInfo.cpp
+msgctxt "#24184"
+msgid " (optional)"
+msgstr ""
+
+#empty strings from id 24185 to 24990
#. Used as error message in add-on browser when add-on repository data could not be downloaded
#: xbmc/filesystem/AddonsDirectory.cpp
diff --git a/xbmc/addons/gui/GUIDialogAddonInfo.cpp b/xbmc/addons/gui/GUIDialogAddonInfo.cpp
index 5f13eb301f..9fe4a0d66e 100644
--- a/xbmc/addons/gui/GUIDialogAddonInfo.cpp
+++ b/xbmc/addons/gui/GUIDialogAddonInfo.cpp
@@ -616,43 +616,32 @@ bool CGUIDialogAddonInfo::ShowDependencyList(Reactivate reactivate, EntryPoint e
(entryPoint == EntryPoint::UPDATE && !it.m_isInstalledUpToDate()))
{
const CFileItemPtr item = std::make_shared<CFileItem>(infoAddon->Name());
- std::stringstream str;
-
- str << StringUtils::Format(g_localizeStrings.Get(24180).c_str(),
- it.m_depInfo.versionMin.asString().c_str()); // min: x.y.z
+ int messageId = 24180; // minversion only
// dep not installed locally, but it is available from a repo!
if (!it.m_installed)
{
if (entryPoint != EntryPoint::SHOW_DEPENDENCIES)
{
- str << StringUtils::Format(
- g_localizeStrings.Get(24181).c_str(),
- it.m_available->Version().asString().c_str()); // => install
+ messageId = 24181; // => install
}
}
else // dep is installed locally
{
- str << StringUtils::Format(
- g_localizeStrings.Get(24182).c_str(),
- it.m_installed->Version().asString().c_str()); // => installed
+ messageId = 24182; // => installed
if (!it.m_isInstalledUpToDate())
{
- str << StringUtils::Format(
- g_localizeStrings.Get(24183).c_str(),
- it.m_available->Version().asString().c_str()); // => update to
+ messageId = 24183; // => update to
}
}
- if (it.m_depInfo.optional)
- {
- str << " "
- << StringUtils::Format(g_localizeStrings.Get(39022).c_str(),
- g_localizeStrings.Get(39018).c_str()); // (optional)
- }
+ item->SetLabel2(StringUtils::Format(
+ g_localizeStrings.Get(messageId).c_str(), it.m_depInfo.versionMin.asString().c_str(),
+ it.m_installed ? it.m_installed->Version().asString().c_str() : "",
+ it.m_available ? it.m_available->Version().asString().c_str() : "",
+ it.m_depInfo.optional ? g_localizeStrings.Get(24184).c_str() : ""));
- item->SetLabel2(str.str());
item->SetArt("icon", infoAddon->Icon());
item->SetProperty("addon_id", it.m_depInfo.id);
items.Add(item);