{
virtual bool askUserToAcceptUnsignedFile( const std::string &file )
{
- cout << CLEARLN << file << " is unsigned, continue? [y/n]: " << flush;
+ cout << CLEARLN << file << _(" is unsigned, continue?") << " [y/n]: " << flush;
return readBoolAnswer();
}
if ( geteuid() != 0 )
return false;
- cout << CLEARLN << "Import key " << key.id() << " in trusted keyring? [y/n]: " << flush;
+ cout << CLEARLN << _("Import key ") << key.id() << _(" to trusted keyring?") << " [y/n]: " << flush;
return readBoolAnswer();
}
#endif
virtual bool askUserToAcceptUnknownKey( const std::string &file, const std::string &id )
#endif
{
- cout << CLEARLN << file << " is signed with an unknown key id: " << id << ", continue? [y/n]: " << flush;
+ cout << CLEARLN << file << _(" is signed with an unknown key id: ") << id << ", " << _("continue?") << " [y/n]: " << flush;
return readBoolAnswer();
}
const std::string& keyid = key.id(), keyname = key.name(),
fingerprint = key.fingerprint();
#endif
- cout << CLEARLN << "Do you want to trust key id " << keyid << " " << keyname << " fingerprint:" << fingerprint << " ? [y/n]: " << flush;
+ cout << CLEARLN << _("Do you want to trust key id ") << keyid << " " << keyname << _(" fingerprint:") << fingerprint << " ? [y/n]: " << flush;
return readBoolAnswer();
}
const std::string& keyid = key.id(), keyname = key.name(),
fingerprint = key.fingerprint();
#endif
- cout << file << "Signature verification for " << file
- << " with public key id " << keyid << " " << keyname << " fingerprint:" << fingerprint << " failed, THIS IS RISKY!. continue? [y/n]: " << endl;
- return readBoolAnswer();
+ cout << file << _("Signature verification for ") << file
+ << _(" with public key id ") << keyid << " " << keyname << _(" fingerprint:") << fingerprint << _(" failed, THIS IS RISKY!") << ". " << _("continue?") << " [y/n]: " << endl;
+ return readBoolAnswer(); // TODO do this with format()
}
};
{
virtual bool askUserToAcceptNoDigest( const zypp::Pathname &file )
{
- cout << CLEARLN << "No digest for " << file
- << ", continue [y/n]" << flush;
+ cout << CLEARLN << _("No digest for ") << file
+ << ", " << _("continue?") << " [y/n]" << flush;
return readBoolAnswer();
}
virtual bool askUserToAccepUnknownDigest( const Pathname &file, const std::string &name )
{
- cout << CLEARLN << "Unknown digest " << name << " for " << file
- << ", continue [y/n]" << flush;
+ cout << CLEARLN << _("Unknown digest ") << name << _(" for ") << file
+ << ", " << _("continue?") << " [y/n]" << flush;
return readBoolAnswer();
}
virtual bool askUserToAcceptWrongDigest( const Pathname &file, const std::string &requested, const std::string &found )
{
- cout << CLEARLN << "Digest verification failed for " << file
- << ", expected " << requested << " found " << found
- << ", continue [y/n]" << flush;
+ cout << CLEARLN << _("Digest verification failed for ") << file
+ << _(", expected ") << requested << _(" found ") << found
+ << ", " << _("continue?") << " [y/n]" << flush;
return readBoolAnswer();
}
};
static bool done = false;
if (!done) {
#ifdef LIBZYPP_1xx
- cerr_v << "Initializing Target (old way)" << endl;
+ cerr_v << _("Initializing Target") << _(" (old way)") << endl;
God->initTarget("/", true);
#else
- cerr_v << "Initializing Target" << endl;
+ cerr_v << _("Initializing Target") << endl;
God->initializeTarget("/");
#endif
done = true;
);
cerr_vv << "... done" << endl;
if (!installer.item) {
- cerr << kind << " '" << name << "' not found" << endl;
+ cerr << kind << " '" << name << "' " << _("not found") << endl;
return; //error?
}
if (installer.installed_item &&
installer.installed_item.resolvable()->edition() == installer.item.resolvable()->edition() &&
installer.installed_item.resolvable()->arch() == installer.item.resolvable()->arch()) {
- cout << "skipping " << kind.asString() << " '" << name << "' (already installed)" << endl;
+ cout << _("skipping ") << kind.asString() << " '" << name << "' " << _("(already installed)") << endl;
}
else {
// TODO don't use setToBeInstalled for this purpose but higher level solver API
bool result = installer.item.status().setToBeInstalled( zypp::ResStatus::USER );
if (!result) {
- cerr << "Failed to add '" << name <<
- "' to the list of packages to be installed." << endl;
+ cerr << format(_("Failed to add '%s' to the list of packages to be installed.")) % name << endl;
}
}
}
cerr_vv << "Marking for deletion: " << provider << endl;
bool result = provider.status().setToBeUninstalled( zypp::ResStatus::USER );
if (!result) {
- cerr << "Failed" << endl;
+ cerr << _("Failed") << endl;
}
return true; // get all of them
}
);
cerr_vv << "... done" << endl;
if (!deleter.found) {
- cerr << "Not found" << endl;
+ cerr << _("Not found") << endl;
return; //error?
}
}
e = rproblems.end (),
i;
if (b != e) {
- cerr << "Problems:" << endl;
+ cerr << _("Problems:") << endl;
}
for (i = b; i != e; ++i) {
- stm << "PROB " << (*i)->description () << endl;
+ stm << _("PROB ") << (*i)->description () << endl;
stm << ": " << (*i)->details () << endl;
ProblemSolutionList solutions = (*i)->solutions ();
ee = solutions.end (),
ii;
for (ii = bb; ii != ee; ++ii) {
- stm << " SOL " << (*ii)->description () << endl;
+ stm << _(" SOL ") << (*ii)->description () << endl;
stm << " : " << (*ii)->details () << endl;
}
}
{
int retv = -1; // nothing to do;
- cerr << "Summary:" << endl;
+ cerr << _("Summary:") << endl;
MIL << "Pool contains " << God->pool().size() << " items." << std::endl;
for ( ResPool::const_iterator it = God->pool().begin(); it != God->pool().end(); ++it )
}
if ( it->status().isToBeInstalled() )
- cerr << "<install> ";
+ cerr << _("<install> ");
if ( it->status().isToBeUninstalled() )
- cerr << "<uninstall> ";
+ cerr << _("<uninstall> ");
cerr << *res << endl;
}
}
if (retv == -1)
- cerr << "Nothing to do." << endl;
+ cerr << _("Nothing to do.") << endl;
return retv;
}
void load_target()
{
- cerr << "Parsing RPM database..." << endl;
+ cerr << _("Parsing RPM database...") << endl;
ResStore tgt_resolvables(God->target()->resolvables());
- cerr_v << " " << tgt_resolvables.size() << " resolvables." << endl;
+ cerr_v << " " << tgt_resolvables.size() << _(" resolvables.") << endl;
God->addResolvables(tgt_resolvables, true /*installed*/);
}
if (! it->enabled())
continue; // #217297
- cerr << "Parsing metadata for " << it->alias() << "..." << endl;
+ cerr << _("Parsing metadata for ") << it->alias() << "..." << endl;
ResStore src_resolvables(it->resolvables());
- cerr_v << " " << src_resolvables.size() << " resolvables." << endl;
+ cerr_v << " " << src_resolvables.size() << _(" resolvables.") << endl;
God->addResolvables(src_resolvables);
}
}
void establish ()
{
- cerr_v << "Establishing status of aggregates" << endl;
+ cerr_v << _("Establishing status of aggregates") << endl;
God->resolver()->establishPool();
dump_pool ();
}
void resolve()
{
establish ();
- cerr_v << "Resolving dependencies ..." << endl;
+ cerr_v << _("Resolving dependencies...") << endl;
God->resolver()->resolvePool();
}
}
}
- cout << gData.patches_count << " patches needed. ( " << gData.security_patches_count << " security patches )" << std::endl;
+ cout << gData.patches_count << _(" patches needed") << ". ( " << gData.security_patches_count << _(" security patches") << " )" << std::endl;
}
string string_status (const ResStatus& rs)
{
bool i = rs.isInstalled ();
if (rs.isUndetermined ())
- return i? "Installed": "Uninstalled";
+ return i? _("Installed"): _("Uninstalled");
else if (rs.isEstablishedUneeded ())
- return i? "No Longer Applicable": "Not Applicable";
+ return i? _("No Longer Applicable"): _("Not Applicable");
else if (rs.isEstablishedSatisfied ())
- return i? "Applied": "Not Needed";
+ return i? _("Applied"): _("Not Needed");
else if (rs.isEstablishedIncomplete ())
- return i? "Broken": "Needed";
+ return i? _("Broken"): _("Needed");
// if ResStatus interface changes
- return "error";
+ return _("error");
}
void dump_pool ()
Table tbl;
TableHeader th;
- th << "Catalog" << "Name" << "Version" << "Category" << "Status";
+ th << _("Catalog") << _("Name") << _("Version") << _("Category") << _("Status");
tbl << th;
ResPool::byKind_iterator
TableHeader th;
unsigned cols;
- th << "Catalog" << "Name" << "Version" << "Category" << "Status";
+ th << _("Catalog") << _("Name") << _("Version") << _("Category") << _("Status");
cols = 5;
tbl << th;
pm_tbl << th;
Table tbl;
TableHeader th;
unsigned cols = 5;
- th << "S" << "Catalog";
+ th << _("S") << _("Catalog"); // for translators: S stands for Status
if (gSettings.is_rug_compatible) {
th << "Bundle";
++cols;
}
- th << "Name" << "Version" << "Arch";
+ th << _("Name") << _("Version") << _("Arch");
tbl << th;
Candidates candidates;
int retv = show_summary();
if (retv >= 0) { // there are resolvables to install/uninstall
- cerr << "Continue? [y/n] " << (non_interactive ? "y\n" : "");
+ cerr << _("Continue?") << " [y/n] " << (non_interactive ? "y\n" : "");
if (non_interactive || readBoolAnswer()) {
if (!confirm_licenses(non_interactive)) return ZYPPER_EXIT_OK;
- cerr_v << "committing" << endl;
+ cerr_v << _("committing") << endl;
try {
ZYppCommitResult result = God->commit( ZYppCommitPolicy() );
return;
if ( geteuid() != 0 ) {
- cerr << "Sorry, you need root privileges to use system sources, disabling them..." << endl;
+ cerr << _("Sorry, you need root privileges to use system sources, disabling them...") << endl;
gSettings.disable_system_sources = true;
MIL << "system sources disabled" << endl;
}
manager = SourceManager::sourceManager();
try
{
- cerr << "Restoring system sources..." << endl;
+ cerr << _("Restoring system sources...") << endl;
manager->restore("/");
}
// catch (const SourcesAlreadyRestoredException& excpt) {
{
ZYPP_CAUGHT (excpt_r);
ERR << "Couldn't restore sources" << endl;
- cerr << "Failed to restore sources" << endl;
+ cerr << _("Failed to restore sources") << endl;
exit(-1);
}
}
catch( const Exception & excpt_r )
{
- cerr << "Can't access repository" << endl;
+ cerr << _("Can't access repository") << endl;
ZYPP_CAUGHT( excpt_r );
exit(-1);
}
Table tbl;
TableHeader th;
th << "#";
- if (gSettings.is_rug_compatible) th << "Status";
- else th << "Enabled" << "Refresh";
- th << "Type" << "Name" << "URI";
+ if (gSettings.is_rug_compatible) th << _("Status");
+ else th << _("Enabled") << _("Refresh");
+ th << _("Type") << _("Name") << "URI";
tbl << th;
int i = 1;
if (gSettings.is_rug_compatible)
{
#ifdef LIBZYPP_1xx
- tr << "Active";
+ tr << _("Active");
#else
- tr << (source.enabled() ? "Active" : "Disabled");
+ tr << (source.enabled() ? _("Active") : _("Disabled"));
#endif
}
// zypper status (enabled, autorefresh)
else
{
#ifdef LIBZYPP_1xx
- tr << "Yes";
- tr << (source.autorefresh ? "Yes" : "No");
+ tr << _("Yes");
+ tr << (source.autorefresh ? _("Yes") : _("No"));
#else
- tr << (source.enabled() ? "Yes" : "No");
- tr << (source.autorefresh() ? "Yes" : "No");
+ tr << (source.enabled() ? _("Yes") : _("No"));
+ tr << (source.autorefresh() ? _("Yes") : _("No"));
#endif
}
}
catch ( const Exception &e )
{
- cout << "Error reading system sources: " << e.msg() << std::endl;
+ cout << _("Error reading system sources: ") << e.msg() << std::endl;
exit(-1);
}
else if (regex_search (line, match, r_type)) {
string type = match[1];
if (type != "rpm-md" && type != "yast2") {
- cerr << "Unknown repository type " << type << endl;
+ cerr << _("Unknown repository type ") << type << endl;
return false;
}
}
repo.close ();
if (!have_alias) {
- cerr << "Name not found" << endl;
+ cerr << _("Name not found") << endl;
}
if (!have_url) {
- cerr << "baseurl not found" << endl;
+ cerr << _("baseurl not found") << endl;
}
cerr_vv << "Name: " << alias << endl;
cerr_vv << "URL: " << url << endl;
// we want to delete anyway
ZYPP_CAUGHT (ex);
cerr << ex.asUserString () << endl
- << "Continuing anyway" << endl;
+ << _("Continuing anyway") << endl;
}
SourceManager::SourceId sid = 0;
safe_lexical_cast (anystring, sid);
if (sid > 0) {
- cerr_v << "removing source " << sid << endl;
+ cerr_v << _("removing source ") << sid << endl;
try {
manager->findSource (sid);
}
catch (const Exception & ex) {
ZYPP_CAUGHT (ex);
// boost::format: %s is fine regardless of the actual type :-)
- cerr << format ("Source %s not found.") % sid << endl;
+ cerr << format (_("Source %s not found.")) % sid << endl;
}
manager->removeSource (sid);
}
}
catch ( const Exception & excpt_r ) {
ZYPP_CAUGHT( excpt_r );
- cerr << "URL is invalid: " << excpt_r.asUserString() << endl;
+ cerr << _("URL is invalid: ") << excpt_r.asUserString() << endl;
}
if (url.isValid ()) {
try {
}
catch (const Exception & ex) {
ZYPP_CAUGHT (ex);
- cerr << format ("Source %s not found.") % url.asString() << endl;
+ cerr << format (_("Source %s not found.")) % url.asString() << endl;
}
manager->removeSourceByUrl (url);
}
}
catch (const Exception & ex) {
ZYPP_CAUGHT (ex);
- cerr << format ("Source %s not found.") % anystring << endl;
+ cerr << format (_("Source %s not found.")) % anystring << endl;
}
manager->removeSource (anystring); // by alias
}
catch (const Exception & ex) {
ZYPP_CAUGHT (ex);
// boost::format: %s is fine regardless of the actual type :-)
- cerr << format ("Source %s not found.") % sid << endl;
+ cerr << format (_("Source %s not found.")) % sid << endl;
}
}
else {
}
catch ( const Exception & excpt_r ) {
ZYPP_CAUGHT( excpt_r );
- cerr << "URL is invalid: " << excpt_r.asUserString() << endl;
+ cerr << _("URL is invalid: ") << excpt_r.asUserString() << endl;
}
if (url.isValid ()) {
try {
}
catch (const Exception & ex) {
ZYPP_CAUGHT (ex);
- cerr << format ("Source %s not found.") % url.asString() << endl;
+ cerr << format (_("Source %s not found.")) % url.asString() << endl;
}
}
}
}
catch (const Exception & ex) {
ZYPP_CAUGHT (ex);
- cerr << format ("Source %s not found.") % anystring << endl;
+ cerr << format (_("Source %s not found.")) % anystring << endl;
}
}
}
void refresh_sources()
{
#ifdef LIBZYPP_1xx
- cerr << "Sorry, not implemented yet for libzypp-1.x.x" << endl;
+ cerr << _("Sorry, not implemented yet for libzypp-1.x.x") << endl;
#else
zypp::storage::PersistentStorage store;
std::list<SourceInfo> sources;
false, // base source
true); // autorefresh
// src.refresh();
- cout << "DONE" << endl << endl;
+ cout << _("DONE") << endl << endl;
}
catch ( const zypp::Exception & ex )
{
catch (const Exception & ex) {
ZYPP_CAUGHT (ex);
if (looks_like_url (filename_or_url)) {
- cerr << "Error while fetching " << filename_or_url << " : "
+ cerr << _("Error while fetching ") << filename_or_url << " : "
<< ex << endl;
// ex.dumpOn (cerr); // this suxxz
}
// #217028
void warn_if_zmd () {
if (system ("pgrep -lx zmd") == 0) { // list name, exact match
- cerr << "ZENworks Management Daemon is running." << endl
- << "WARNING: this command will not synchronize changes." << endl
- << "Use rug or yast2 for that." << endl;
+ cerr << _("ZENworks Management Daemon is running.") << endl
+ << _("WARNING: this command will not synchronize changes.") << endl
+ << _("Use rug or yast2 for that.") << endl;
}
}
int read_action_ari () {
// TODO: respect --yes (abort)
while (true) {
- cerr << "(A)bort, (R)etry, (I)gnore?" << endl;
+ cerr << _("(A)bort, (R)etry, (I)gnore?") << endl; // don't translate letters in parentheses!!
char c;
cin >> c;
c = tolower (c);
#include "zypper-getopt.h"
+#include "zmart.h"
#include <iostream>
#include <zypp/base/String.h>
+
using namespace std;
string longopts2optstring (const struct option *longopts) {
switch (optc) {
case '?':
result["_unknown"].push_back("");
- cerr << "Unknown option " << argv[optind - 1] << endl;
+ cerr << _("Unknown option ") << argv[optind - 1] << endl;
break;
case ':':
- cerr << "Missing argument for " << argv[optind - 1] << endl;
+ cerr << _("Missing argument for ") << argv[optind - 1] << endl;
break;
default:
const char *mapidx = optc? short2long[optc] : longopts[option_index].name;
);
if (!installer.item) {
- cout << "\n" << kind.asString() << " " << *nameit << " not found." << endl;
+ cout << "\n" << kind.asString() << " " << *nameit << _(" not found.") << endl;
}
else {
// print info
- cout << "\nInformation for " << kind.asString() << " " << *nameit << ":\n\n";
+ cout << endl << _("Information for ") << kind.asString() << " " << *nameit << ":\n\n";
if (command == "info" || command == "if")
printPkgInfo(installer.item,installed);
*/
void printPkgInfo(const PoolItem & pool_item, const PoolItem & ins_pool_item) {
- cout << "Catalog: " << pool_item.resolvable()->source().alias() << endl;
- cout << "Name: " << pool_item.resolvable()->name() << endl;
- cout << "Version: " << pool_item.resolvable()->edition().asString() << endl;
- cout << "Arch: " << pool_item.resolvable()->arch().asString() << endl;
- cout << "Installed: " << (!ins_pool_item ? "No" : "Yes") << endl;
+ cout << _("Catalog: ") << pool_item.resolvable()->source().alias() << endl;
+ cout << _("Name: ") << pool_item.resolvable()->name() << endl;
+ cout << _("Version: ") << pool_item.resolvable()->edition().asString() << endl;
+ cout << _("Arch: ") << pool_item.resolvable()->arch().asString() << endl;
+ cout << _("Installed: ") << (!ins_pool_item ? "No" : "Yes") << endl;
- cout << "Status: ";
+ cout << _("Status: ");
if (ins_pool_item &&
ins_pool_item.resolvable()->edition() >= pool_item.resolvable()->edition())
- cout << "up-to-date" << endl;
+ cout << _("up-to-date") << endl;
else if (ins_pool_item) {
- cout << "out-of-date (version " << ins_pool_item.resolvable()->edition()
- << " installed) " << endl;
+ cout << _("out-of-date (version ") << ins_pool_item.resolvable()->edition()
+ << _(" installed) ") << endl; // TODO use sformat for this for proper translation
}
else
- cout << "not installed" << endl;
+ cout << _("not installed") << endl;
- cout << "Installed Size: " << pool_item.resolvable()->size().asString() << endl;
- cout << "Summary: " << pool_item.resolvable()->summary() << endl;
- cout << "Description: " << endl;
+ cout << _("Installed Size: ") << pool_item.resolvable()->size().asString() << endl;
+ cout << _("Summary: ") << pool_item.resolvable()->summary() << endl;
+ cout << _("Description: ") << endl;
cout << pool_item.resolvable()->description() << endl;
}
// no sources warning
if (gData.sources.empty()) {
- cerr << "No sources. Zypper currently searches within installation"
- "sources only." << endl;
+ cerr << _("No sources. Zypper currently searches within installation"
+ "sources only.") << endl;
exit(2); // TODO #define zypper error codes?
}
if (_options.kind() != Resolvable::Kind())
_icache.setIncludeKindInKey(false);
- cout_v << "Pre-caching installed resolvables matching given search criteria... " << endl;
+ cout_v << _("Pre-caching installed resolvables matching given search criteria... ") << endl;
ResStore tgt_resolvables(_zypp->target()->resolvables());
invokeOnEachSearched(Match(_reg,_options.searchDescriptions()),
functorRef<bool,const zypp::PoolItem &>(_icache));
- cout_v << _icache.size() << " out of (" << tgt_resolvables.size() << ")"
- "cached." << endl;
+ cout_v << _icache.size() << _(" out of (") << tgt_resolvables.size() << ")"
+ << _("cached.") << endl;
}
/**
}
catch (regex_error & e) {
cerr << "ZyppSearch::setupRegexp(): " << regstr
- << " is not a valid regular expression: \""
+ << _(" is not a valid regular expression: \"")
<< e.what() << "\"" << endl;
- cerr << "This is a bug, please file a bug report against zypper." << endl;
+ cerr << _("This is a bug, please file a bug report against zypper.") << endl;
exit(1);
}
}
}
catch ( const Exception & excpt_r ) {
ZYPP_CAUGHT( excpt_r );
- cerr << "URL is invalid." << endl;
+ cerr << _("URL is invalid.") << endl;
cerr << excpt_r.asUserString() << endl;
}
if (gopts.count("help"))
ghelp = true;
- string help_global_options = " Options:\n"
+ string help_global_options = _(" Options:\n"
"\t--help, -h\t\tHelp\n"
"\t--version, -V\t\tOutput the version number\n"
"\t--verbose, -v\t\tIncrease verbosity\n"
"\t--terse, -t\t\tTerse output for machine consumption\n"
"\t--table-style, -s\tTable style (integer)\n"
- "\t--rug-compatible, -r\tTurn on rug compatibility\n"
+ "\t--rug-compatible, -r\tTurn on rug compatibility\n");
;
if (gopts.count("verbose")) {
gSettings.verbose += gopts["verbose"].size();
- cerr << "verbosity " << gSettings.verbose << endl;
+ cerr << _("verbosity ") << gSettings.verbose << endl;
}
if (gopts.count("table-style")) {
if (s < _End)
Table::defaultStyle = (TableStyle) s;
else
- cerr << "Invalid table style " << s << endl;
+ cerr << _("Invalid table style ") << s << endl;
}
// testing option
if (gopts.count("opt")) {
cerr << endl;
}
else {
- cerr << "Try -h for help" << endl;
+ cerr << _("Try -h for help") << endl;
}
}
struct option *specific_options = &no_options;
string specific_help;
- string help_global_source_options = " Source options:\n"
+ string help_global_source_options = _(
+ " Source options:\n"
"\t--disable-system-sources, -D\t\tDon't read the system sources\n"
"\t--source, -S\t\tRead additional source\n"
- ;
+ );
- string help_global_target_options = " Target options:\n"
+ string help_global_target_options = _(" Target options:\n"
"\t--disable-system-resolvables, -T\t\tDon't read system installed resolvables\n"
- ;
+ );
if (command == "install" || command == "in") {
static struct option install_options[] = {
{0, 0, 0, 0}
};
specific_options = install_options;
- specific_help = " Command options:\n"
+ specific_help = _(
+ " Command options:\n"
"\t--catalog,-c\t\tOnly from this catalog (FIXME)\n"
"\t--type,-t\t\tType of resolvable (default: package)\n"
"\t--no-confirm,-y\tDon't require user confirmation\n"
- ;
+ );
}
else if (command == "remove" || command == "rm") {
static struct option remove_options[] = {
{0, 0, 0, 0}
};
specific_options = remove_options;
- specific_help = " Command options:\n"
+ specific_help = _(
+ " Command options:\n"
"\t--type,-t\t\tType of resolvable (default: package)\n"
"\t--no-confirm,-y\tDon't require user confirmation\n"
- ;
+ );
}
else if (command == "service-add" || command == "sa") {
static struct option service_add_options[] = {
{0, 0, 0, 0}
};
specific_options = service_add_options;
- specific_help = "service-add [options] URI [alias]\n"
+ specific_help = _(
+ "service-add [options] URI [alias]\n"
"\n"
"Add a service (installation source) to the system."
"\n"
"\t--type,-t <TYPE>\tType of repository (YaST, YUM, or Plaindir)\n"
"\t--disabled,-d\t\tAdd the service as disabled\n"
"\t--no-refresh,-n\t\tDo not automatically refresh the metadata\n"
- ;
+ );
}
else if (command == "service-list" || command == "sl") {
static struct option service_list_options[] = {
{0, 0, 0, 0}
};
specific_options = service_list_options;
- specific_help = "service-list\n"
+ specific_help = _(
+ "service-list\n"
"\n"
"List all defined system services (installation sources)."
"\n"
"This command has no options.\n"
- ;
+ );
}
else if (command == "service-delete" || command == "sd") {
static struct option service_delete_options[] = {
{0, 0, 0, 0}
};
specific_options = service_delete_options;
- specific_help = "service-delete [options] <URI|alias>\n"
+ specific_help = _(
+ "service-delete [options] <URI|alias>\n"
"\n"
"Remove service (installation source) from the system."
"\n"
"This command has no options.\n"
- ;
+ );
}
else if (command == "service-rename" || command == "sr") {
static struct option service_rename_options[] = {
{0, 0, 0, 0}
};
specific_options = service_rename_options;
- specific_help = "service-rename [options] <URI|alias> <new-alias>\n"
+ specific_help = _(
+ "service-rename [options] <URI|alias> <new-alias>\n"
"\n"
"Assign new alias to the service specified by URI or current alias."
"\n"
"This command has no options.\n"
- ;
+ );
}
else if (command == "refresh" || command == "ref") {
static struct option refresh_options[] = {
{0, 0, 0, 0}
};
specific_options = refresh_options;
- specific_help = _("zypper refresh\n"
+ specific_help = _(
+ "zypper refresh\n"
"\n"
- "Refresh all installation sources found in system.\n")
- ;
+ "Refresh all installation sources found in system.\n"
+ );
}
else if (command == "list-updates" || command == "lu") {
static struct option list_updates_options[] = {
{0, 0, 0, 0}
};
specific_options = list_updates_options;
- specific_help = "list-updates [options]\n"
+ specific_help = _(
+ "list-updates [options]\n"
"\n"
"List all available updates\n"
"\n"
" Command options:\n"
"\t--type,-t\t\tType of resolvable (default: patch!)\n"
- ;
+ );
}
else if (command == "update" || command == "up") {
static struct option update_options[] = {
{0, 0, 0, 0}
};
specific_options = update_options;
- specific_help = " Command options:\n"
+ specific_help = _(
+ " Command options:\n"
"\t--type,-t\t\tType of resolvable (default: patch!)\n"
"\t--no-confirm,-y\t\tDon't require user confirmation\n"
"\t--skip-interactive\t\tSkip interactive updates\n"
- ;
+ );
}
else if (command == "search" || command == "se") {
static struct option search_options[] = {
{0, 0, 0, 0}
};
specific_options = search_options;
- specific_help =
+ specific_help = _(
"zypper [global-options] search [options] [querystring...]\n"
"\n"
"'search' - Search for packages matching given search strings\n"
" --sort-by-catalog Sort packages by catalog.\n" // ??? catalog/source?
"\n"
"* and ? wildcards can also be used within search strings.\n"
- ;
+ );
}
else if (command == "patch-check" || command == "pchk") {
static struct option patch_check_options[] = {
{0, 0, 0, 0}
};
specific_options = patch_check_options;
- specific_help = "patch-check\n"
+ specific_help = _(
+ "patch-check\n"
"\n"
"Check for available patches\n"
"\n"
"This command has no options.\n"
- ;
+ );
}
else if (command == "patches" || command == "pch") {
static struct option patches_options[] = {
{0, 0, 0, 0}
};
specific_options = patches_options;
- specific_help = "patches\n"
+ specific_help = _(
+ "patches\n"
"\n"
"List all available patches\n"
"\n"
"This command has no options.\n"
- ;
+ );
}
else if (command == "info" || command == "if") {
static struct option info_options[] = {
{0, 0, 0, 0}
};
specific_options = info_options;
- specific_help =
+ specific_help = _(
"zypper [global-options] info [name...]\n"
"\n"
"'info' - Show full information for packages\n"
- ;
+ );
}
else if (command == "patch-info") {
static struct option patch_info_options[] = {
{0, 0, 0, 0}
};
specific_options = patch_info_options;
- specific_help =
+ specific_help = _(
"zypper [global-options] patch-info [patchname...]\n"
"\n"
"'patch-info' - Show detailed information for patches\n"
- ;
+ );
}
else if (command == "moo") {
static struct option moo_options[] = {
{0, 0, 0, 0}
};
specific_options = moo_options;
- specific_help =
+ specific_help = _(
"zypper [global-options] moo\n"
"\n"
"'moo' - Show an animal\n"
- ;
+ );
}
else if (!command.empty()) { // empty command is treated earlier
- cerr << "Unknown command '" << command << "'." << endl << endl;
+ cerr << _("Unknown command") << " '" << command << "'." << endl << endl;
cerr << help_commands;
return ZYPPER_EXIT_ERR_SYNTAX;
}
vector<string> arguments;
if (optind < argc) {
- cerr_v << "non-option ARGV-elements: ";
+ cerr_v << _("non-option ARGV-elements: ");
while (optind < argc) {
string argument = argv[optind++];
cerr_v << argument << ' ';
// === process options ===
if (gopts.count("terse")) {
- cerr_v << "FAKE Terse" << endl;
+ cerr_v << _("FAKE terse") << endl;
}
if (gopts.count("disable-system-sources"))
{
- MIL << "system sources disabled" << endl;
+ MIL << _("system sources disabled") << endl;
gSettings.disable_system_sources = true;
}
else
{
- MIL << "system sources enabled" << endl;
+ MIL << _("system sources enabled") << endl;
}
if (gopts.count("disable-system-resolvables"))
{
- MIL << "system resolvables disabled" << endl;
- cerr << "Ignoring installed resolvables..." << endl;
+ MIL << _("system resolvables disabled") << endl;
+ cerr << _("Ignoring installed resolvables...") << endl;
gSettings.disable_system_resolvables = true;
}
-
+
if (gopts.count("source")) {
list<string> sources = gopts["source"];
for (list<string>::const_iterator it = sources.begin(); it != sources.end(); ++it )
}
catch (Exception & excpt_r) {
ZYPP_CAUGHT (excpt_r);
- ERR << "a ZYpp transaction is already in progress." << endl;
- cerr << "a ZYpp transaction is already in progress." << endl;
+ ERR << _("a ZYpp transaction is already in progress.") << endl;
+ cerr << _("a ZYpp transaction is already in progress.") << endl;
return ZYPPER_EXIT_ERR_ZYPP;
}
if ( geteuid() != 0 )
{
- cerr << "Sorry, you need root privileges to view system sources." << endl;
+ cerr << _("Sorry, you need root privileges to view system sources.") << endl;
return ZYPPER_EXIT_ERR_PRIVILEGES;
}
string type = copts.count("type")? copts["type"].front() : "";
if (type != "" && type != "YaST" && type != "YUM" && type != "Plaindir") {
- cerr << "Warning, unknown metadata type " << type << endl;
+ cerr << _("Warning, unknown metadata type ") << type << endl;
}
string repoalias, repourl;
string skind = copts.count("type")? copts["type"].front() : "package";
kind = string_to_kind (skind);
if (kind == ResObject::Kind ()) {
- cerr << "Unknown resolvable type " << skind << endl;
+ cerr << _("Unknown resolvable type ") << skind << endl;
return ZYPPER_EXIT_ERR_INVALID_ARGS;
}
if ( gData.sources.empty() )
{
- cerr << "Warning! No sources. Operating only over the installed resolvables. You will not be able to install stuff" << endl;
+ cerr << _("Warning! No sources. Operating only over the installed resolvables. You will not be able to install stuff.") << endl;
}
cond_init_target ();
string skind = copts["type"].front();
kind = string_to_kind (skind);
if (kind == ResObject::Kind ()) {
- cerr << "Unknown resolvable type " << skind << endl;
+ cerr << _("Unknown resolvable type ") << skind << endl;
return ZYPPER_EXIT_ERR_INVALID_ARGS;
}
options.setKind(kind);
gSettings.is_rug_compatible? "package" : "patch";
kind = string_to_kind (skind);
if (kind == ResObject::Kind ()) {
- cerr << "Unknown resolvable type " << skind << endl;
+ cerr << _("Unknown resolvable type ") << skind << endl;
return ZYPPER_EXIT_ERR_INVALID_ARGS;
}
gSettings.is_rug_compatible? "package" : "patch";
kind = string_to_kind (skind);
if (kind == ResObject::Kind ()) {
- cerr << "Unknown resolvable type " << skind << endl;
+ cerr << _("Unknown resolvable type ") << skind << endl;
return ZYPPER_EXIT_ERR_INVALID_ARGS;
}