Use imprecise quantity words in dirty plugin messages.

Instead of exact numbers, since they change (generally increasing) with
TES5Edit updates. Closes #412.
This commit is contained in:
Oliver Hamlet
2015-03-16 22:00:41 +00:00
parent 87994d7477
commit f1a7ca2288
3 changed files with 26 additions and 7 deletions
+16
View File
@@ -164,6 +164,22 @@ namespace loot {
return out;
}
//Turns a positive integer into a more qualitative description of its value (eg. "few", "many").
std::string IntToVagueString(const unsigned int i) {
if (i < 10) {
return boost::locale::translate("a few");
}
else if (i < 100) {
return boost::locale::translate("several");
}
else if (i < 1000) {
return boost::locale::translate("a lot of");
}
else {
return boost::locale::translate("a plethora of");
}
}
#ifdef _WIN32
//Get registry subkey value string.
string RegKeyStringValue(const std::string& keyStr, const std::string& subkey, const std::string& value) {
+3
View File
@@ -50,6 +50,9 @@ namespace loot {
//Converts an integer to a hex string using BOOST's Spirit.Karma. Faster than a stringstream conversion.
std::string IntToHexString(const int n);
//Turns a positive integer into a more qualitative description of its value (eg. "few", "many").
std::string IntToVagueString(const unsigned int i);
#ifdef _WIN32
//Get registry subkey value string.
std::string RegKeyStringValue(const std::string& keyStr, const std::string& subkey, const std::string& value);
+7 -7
View File
@@ -908,24 +908,24 @@ namespace loot {
for (const auto &element : _dirtyInfo) {
boost::format f;
if (element.ITMs() > 0 && element.DeletedRefs() > 0 && element.DeletedNavmeshes() > 0)
f = boost::format(boost::locale::translate("Contains %1% ITM records, %2% deleted references and %3% deleted navmeshes. Clean with %4%.")) % element.ITMs() % element.DeletedRefs() % element.DeletedNavmeshes() % element.CleaningUtility();
f = boost::format(boost::locale::translate("Contains %1% ITM records, %2% deleted references and %3% deleted navmeshes. Clean with %4%.")) % IntToVagueString(element.ITMs()) % IntToVagueString(element.DeletedRefs()) % IntToVagueString(element.DeletedNavmeshes()) % element.CleaningUtility();
else if (element.ITMs() == 0 && element.DeletedRefs() == 0 && element.DeletedNavmeshes() == 0)
f = boost::format(boost::locale::translate("Clean with %1%.")) % element.CleaningUtility();
else if (element.ITMs() == 0 && element.DeletedRefs() > 0 && element.DeletedNavmeshes() > 0)
f = boost::format(boost::locale::translate("Contains %1% deleted references and %2% deleted navmeshes. Clean with %3%.")) % element.DeletedRefs() % element.DeletedNavmeshes() % element.CleaningUtility();
f = boost::format(boost::locale::translate("Contains %1% deleted references and %2% deleted navmeshes. Clean with %3%.")) % IntToVagueString(element.DeletedRefs()) % IntToVagueString(element.DeletedNavmeshes()) % element.CleaningUtility();
else if (element.ITMs() == 0 && element.DeletedRefs() == 0 && element.DeletedNavmeshes() > 0)
f = boost::format(boost::locale::translate("Contains %1% deleted navmeshes. Clean with %2%.")) % element.DeletedNavmeshes() % element.CleaningUtility();
f = boost::format(boost::locale::translate("Contains %1% deleted navmeshes. Clean with %2%.")) % IntToVagueString(element.DeletedNavmeshes()) % element.CleaningUtility();
else if (element.ITMs() == 0 && element.DeletedRefs() > 0 && element.DeletedNavmeshes() == 0)
f = boost::format(boost::locale::translate("Contains %1% deleted references. Clean with %2%.")) % element.DeletedRefs() % element.CleaningUtility();
f = boost::format(boost::locale::translate("Contains %1% deleted references. Clean with %2%.")) % IntToVagueString(element.DeletedRefs()) % element.CleaningUtility();
else if (element.ITMs() > 0 && element.DeletedRefs() == 0 && element.DeletedNavmeshes() > 0)
f = boost::format(boost::locale::translate("Contains %1% ITM records and %2% deleted navmeshes. Clean with %3%.")) % element.ITMs() % element.DeletedNavmeshes() % element.CleaningUtility();
f = boost::format(boost::locale::translate("Contains %1% ITM records and %2% deleted navmeshes. Clean with %3%.")) % IntToVagueString(element.ITMs()) % IntToVagueString(element.DeletedNavmeshes()) % element.CleaningUtility();
else if (element.ITMs() > 0 && element.DeletedRefs() == 0 && element.DeletedNavmeshes() == 0)
f = boost::format(boost::locale::translate("Contains %1% ITM records. Clean with %2%.")) % element.ITMs() % element.CleaningUtility();
f = boost::format(boost::locale::translate("Contains %1% ITM records. Clean with %2%.")) % IntToVagueString(element.ITMs()) % element.CleaningUtility();
else if (element.ITMs() > 0 && element.DeletedRefs() > 0 && element.DeletedNavmeshes() == 0)
f = boost::format(boost::locale::translate("Contains %1% ITM records and %2% deleted references. Clean with %3%.")) % element.ITMs() % element.DeletedRefs() % element.CleaningUtility();
f = boost::format(boost::locale::translate("Contains %1% ITM records and %2% deleted references. Clean with %3%.")) % IntToVagueString(element.ITMs()) % IntToVagueString(element.DeletedRefs()) % element.CleaningUtility();
messages.push_back(loot::Message(loot::Message::warn, f.str()));
isDirty = true;