From 2c21b0818963c4e82cc150c74871706b5cf2551f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marciniak?= Date: Thu, 14 Nov 2024 16:47:21 +0100 Subject: [PATCH 1/3] I18N: Mark messages in "dnf search" output for a translation --- libdnf5-cli/output/search.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libdnf5-cli/output/search.cpp b/libdnf5-cli/output/search.cpp index 59bec76ea..eb5859c91 100644 --- a/libdnf5-cli/output/search.cpp +++ b/libdnf5-cli/output/search.cpp @@ -41,7 +41,7 @@ std::string key_to_string(const matched_key_pair & key_pair) { if (key_match == SearchKeyMatch::PARTIAL) { return key; } else { - return key + " (exact)"; + return key + _(" (exact)"); } } @@ -86,7 +86,7 @@ std::string construct_highlight_regex_format() { void print_search_results(const SearchResults & results) { if (results.group_results.empty()) { - std::cout << "No matches found." << std::endl; + std::cout << _("No matches found.") << std::endl; return; } @@ -97,7 +97,7 @@ void print_search_results(const SearchResults & results) { }; for (auto const & result : results.group_results) { - std::cout << bold << "Matched fields: " << reset << construct_keys_string(result.matched_keys) << std::endl; + std::cout << bold << _("Matched fields: ") << reset << construct_keys_string(result.matched_keys) << std::endl; for (auto const & package : result.matched_packages.packages) { std::cout << " "; From 4bdac45917312705bdb0c48cb57f048124891d86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marciniak?= Date: Thu, 14 Nov 2024 17:21:14 +0100 Subject: [PATCH 2/3] add missing include --- libdnf5-cli/output/search.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libdnf5-cli/output/search.cpp b/libdnf5-cli/output/search.cpp index eb5859c91..ccac4d550 100644 --- a/libdnf5-cli/output/search.cpp +++ b/libdnf5-cli/output/search.cpp @@ -24,6 +24,8 @@ along with libdnf. If not, see . #include +#include + #include #include #include From 61b7d5baab2e2ff65c8005e5adb4581297f0ddef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marciniak?= Date: Mon, 18 Nov 2024 14:52:11 +0100 Subject: [PATCH 3/3] reformatting to meet clang-format requirements --- libdnf5-cli/output/search.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libdnf5-cli/output/search.cpp b/libdnf5-cli/output/search.cpp index ccac4d550..f5a36c2e0 100644 --- a/libdnf5-cli/output/search.cpp +++ b/libdnf5-cli/output/search.cpp @@ -22,9 +22,8 @@ along with libdnf. If not, see . #include "libdnf5-cli/tty.hpp" -#include - #include +#include #include #include