{
string msg;
- string affected_str = "";
- if (affected())
- affected_str = affected()->name();
-
- string other_str = "";
- if (other())
- other_str = other()->name();
+ string affected_str = ResolverInfo::toString(affected());
switch (type()) {
// Translator: %s = name of package,patch,...
msg = str::form (_("Can't install %s, since %s is already marked as needing to be installed"),
affected_str.c_str(),
- other_str.c_str());
+ toString (other()).c_str());
}
break;
// TranslatorExample: Updating foo-1.1 to foo-1.2
// TranslatorExplanation: Just a progress indicator that something is scheduled for upgrade
msg = str::form (_("Updating %s to %s"),
- other_str.c_str(),
+ ResolverInfo::toString (other()).c_str(),
affected_str.c_str());
}
break;
// TranslatorExample: Upgrade to foo to avoid removing bar is not possible
// TranslatorExplanation: bar requires something from foo
msg = str::form (_("Upgrade to %s to avoid removing %s is not possible."),
- other_str.c_str(),
+ ResolverInfo::toString (other()).c_str(),
affected_str.c_str());
}
break;
// Translator: 1.%s = name of package,patch,...; 2.%s = dependency;
msg = str::form (_("%s provides %s, but is scheduled to be uninstalled."),
- other_str.c_str(),
+ ResolverInfo::toString (other()).c_str(),
ResolverInfo::toString (_capability).c_str());
}
break;
// Translator: 1.%s = name of package,patch,...; 2.%s = dependency; 3.%s type (package, patch, ...)
msg = str::form (_("%s provides %s, but another version of that %s is already installed."),
- other_str.c_str(),
+ other()->name().c_str(),
ResolverInfo::toString (_capability).c_str(),
translateResTraits(other()->kind()).c_str());
}
// Translator: 1.%s = name of package,patch,...; 2.%s = dependency;
msg = str::form (_("%s provides %s, but it is uninstallable. Try installing it on its own for more details."),
- other_str.c_str(),
+ other()->name().c_str(),
ResolverInfo::toString (_capability).c_str());
}
break;
// Translator: 1.%s = name of package,patch,...; 2.%s = dependency;
msg = str::form (_("%s provides %s, but it is locked."),
- other_str.c_str(),
+ other()->name().c_str(),
ResolverInfo::toString (_capability).c_str());
}
break;
// TranslatorExample: foo is required by other to-be-installed resolvable, so it won't be unlinked.
// TranslatorExplanation: Cant uninstall foo since it is required by an to-be-installed resolvable
msg = str::form (_("%s is required by other to-be-installed resolvable, so it won't be unlinked."),
- affected_str.c_str());
+ affected()->name().c_str());
}
break;
// TranslatorExample: foo is required by other installed resolvable, so it won't be unlinked.
// TranslatorExplanation: Cant uninstall foo since it is required by an installed resolvable
msg = str::form (_("%s is required by other installed resolvable, so it won't be unlinked."),
- affected_str.c_str());
+ affected()->name().c_str());
}
break;
// TranslatorExample: foo is locked and cannot be uninstalled.
// TranslatorExplanation: foo is to-be-uninstalled but it is locked
msg = str::form (_("%s is locked and cannot be uninstalled."),
- affected_str.c_str());
+ affected()->name().c_str());
}
break;