Blame SOURCES/oscap-anaconda-addon-2.0.1-fix_strings-PR_207.patch

833630
From 1b96504a8bbc198cce11647a0c3a65e1a3ffaba1 Mon Sep 17 00:00:00 2001
833630
From: Matej Tyc <matyc@redhat.com>
833630
Date: Fri, 13 May 2022 14:44:45 +0200
833630
Subject: [PATCH] Fix strings for translations
833630
833630
The input of the _() function has to be a static string,
833630
and it was in those cases a formatted one,
833630
which didn't match the translation data.
833630
---
833630
 org_fedora_oscap/rule_handling.py | 20 ++++++++++----------
833630
 1 file changed, 10 insertions(+), 10 deletions(-)
833630
833630
diff --git a/org_fedora_oscap/rule_handling.py b/org_fedora_oscap/rule_handling.py
833630
index 244aac8..635446e 100644
833630
--- a/org_fedora_oscap/rule_handling.py
833630
+++ b/org_fedora_oscap/rule_handling.py
833630
@@ -707,10 +707,11 @@ def eval_rules(self, ksdata, storage, report_only=False):
833630
         messages = []
833630
         packages_data = get_packages_data()
833630
 
833630
+        msg_installed_template = _(
833630
+            "package '%s' has been added to the list of to be installed packages")
833630
         # add messages for the already added packages
833630
         for pkg in self._added_pkgs:
833630
-            msg = _("package '%s' has been added to the list of to be installed "
833630
-                    "packages" % pkg)
833630
+            msg = msg_installed_template % pkg
833630
             messages.append(RuleMessage(self.__class__,
833630
                                         common.MESSAGE_TYPE_INFO, msg))
833630
 
833630
@@ -724,11 +725,12 @@ def eval_rules(self, ksdata, storage, report_only=False):
833630
                 self._added_pkgs.add(pkg)
833630
                 packages_data.packages.append(pkg)
833630
 
833630
-            msg = _("package '%s' has been added to the list of to be installed "
833630
-                    "packages" % pkg)
833630
+            msg = msg_installed_template % pkg
833630
             messages.append(RuleMessage(self.__class__,
833630
                                         common.MESSAGE_TYPE_INFO, msg))
833630
 
833630
+        msg_excluded_template = _(
833630
+            "package '%s' has been added to the list of excluded packages")
833630
         # now do the same for the packages that should be excluded
833630
         # add messages for the already excluded packages
833630
         for pkg in self._removed_pkgs:
833630
@@ -736,13 +738,12 @@ def eval_rules(self, ksdata, storage, report_only=False):
833630
                 msg = _(
833630
                     "package '{package}' has been added to the list "
833630
                     "of excluded packages, but it can't be removed "
833630
-                    "from the current software selection without breaking the installation."
833630
-                    .format(package=pkg))
833630
+                    "from the current software selection without breaking the installation.")
833630
+                msg = msg.format(package=pkg)
833630
                 messages.append(RuleMessage(self.__class__,
833630
                                             common.MESSAGE_TYPE_FATAL, msg))
833630
             else:
833630
-                msg = _("package '%s' has been added to the list of excluded "
833630
-                        "packages" % pkg)
833630
+                msg = msg_excluded_template % pkg
833630
                 messages.append(RuleMessage(self.__class__,
833630
                                             common.MESSAGE_TYPE_INFO, msg))
833630
 
833630
@@ -756,8 +757,7 @@ def eval_rules(self, ksdata, storage, report_only=False):
833630
                 self._removed_pkgs.add(pkg)
833630
                 packages_data.excluded_packages.append(pkg)
833630
 
833630
-            msg = _("package '%s' has been added to the list of excluded "
833630
-                    "packages" % pkg)
833630
+            msg = msg_excluded_template % pkg
833630
             messages.append(RuleMessage(self.__class__,
833630
                                         common.MESSAGE_TYPE_INFO, msg))
833630