From 38e28b398507108ed4ab2ff1e510efba6d8923b7 Mon Sep 17 00:00:00 2001 From: Jan Kupec Date: Wed, 12 Sep 2007 12:17:19 +0000 Subject: [PATCH] - display localized resolvable kind --- src/zypper-info.cc | 7 +++++-- src/zypper-misc.cc | 47 ++++++++++--------------------------------- src/zypper-search.h | 7 +++++-- src/zypper-source-callbacks.h | 5 +++-- src/zypper-utils.cc | 30 +++++++++++++++++++++++++++ src/zypper-utils.h | 4 ++++ 6 files changed, 58 insertions(+), 42 deletions(-) diff --git a/src/zypper-info.cc b/src/zypper-info.cc index 0ff8a1a..3ae1c74 100644 --- a/src/zypper-info.cc +++ b/src/zypper-info.cc @@ -9,6 +9,7 @@ #include #include "zypper.h" +#include "zypper-utils.h" #include "zypper-misc.h" using namespace std; @@ -49,13 +50,15 @@ void printInfo(const ZypperCommand & command, const vector & arguments) if (!installer.item) { // TranslatorExplanation E.g. "package zypper not found." - cout << "\n" << format(_("%s %s not found.")) % kind.asString() % *nameit + cout << "\n" << format(_("%s %s not found.")) + % kind_to_string_localized(kind, 1) % *nameit << endl; } else { // print info // TranslatorExplanation E.g. "Information for package zypper:" - cout << endl << format(_("Information for %s %s:")) % kind.asString() % *nameit; + cout << endl << format(_("Information for %s %s:")) + % kind_to_string_localized(kind, 1) % *nameit; cout << endl << endl; diff --git a/src/zypper-misc.cc b/src/zypper-misc.cc index 0586d26..d264cbb 100644 --- a/src/zypper-misc.cc +++ b/src/zypper-misc.cc @@ -20,6 +20,7 @@ #include #include "zypper.h" +#include "zypper-utils.h" #include "zypper-getopt.h" #include "zypper-misc.h" #include "zypper-callbacks.h" @@ -77,35 +78,6 @@ ResObject::Kind string_to_kind (const string &skind) return empty; } -string kind_to_string_localized(const KindOf & kind, unsigned long count) -{ - if (kind == ResTraits::kind.asString()) - return _PL("package", "packages", count); - if (kind == ResTraits::kind.asString()) - return _PL("selection", "selections", count); - if (kind == ResTraits::kind.asString()) - return _PL("pattern", "patterns", count); - if (kind == ResTraits::kind.asString()) - return _PL("product", "product", count); - if (kind == ResTraits::kind.asString()) - return _PL("patch", "patches", count); - if (kind == ResTraits