Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I18N: Mark messages in "dnf search" output for a translation #1861

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions libdnf5-cli/output/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>.

#include <libdnf5/utils/patterns.hpp>

#include <libdnf5/utils/bgettext/bgettext-lib.h>

#include <algorithm>
#include <iostream>
#include <numeric>
Expand All @@ -41,7 +43,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)");
}
}

Expand Down Expand Up @@ -86,7 +88,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;
}

Expand All @@ -97,7 +99,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 << " ";
Expand Down
Loading