From f15b0c15132eadbd9142b7c0109d07ba89cb08e9 Mon Sep 17 00:00:00 2001 From: Ilya Zverev Date: Fri, 1 Jul 2016 16:40:48 +0300 Subject: [PATCH] Fix English grammar in changeset comments --- editor/changeset_wrapper.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/editor/changeset_wrapper.cpp b/editor/changeset_wrapper.cpp index 467d3dd6d6..22b6000b24 100644 --- a/editor/changeset_wrapper.cpp +++ b/editor/changeset_wrapper.cpp @@ -49,6 +49,9 @@ string GetTypeForFeature(XMLFeature const & node) return key; else if (key == "shop" || key == "office" || key == "building" || key == "entrance") return value + " " + key; // "convenience shop" + else if (!value.empty() && value.back() == 's') + // Remove 's' from the tail: "toilets" -> "toilet". + return value.substr(0, value.size() - 1); else return value; } @@ -301,10 +304,22 @@ string ChangesetWrapper::TypeCountToString(TTypeCount const & typeCount) // Format a count: "a shop" for single shop, "4 shops" for multiple. if (currentPair.second == 1) - ss << "a "; + { + switch (currentPair.first.front()) + { + case 'a': + case 'e': + case 'i': + case 'y': + case 'o': ss << "an"; break; + default: ss << "a"; + } + } else - ss << currentPair.second << ' '; - ss << currentPair.first; + { + ss << currentPair.second; + } + ss << ' ' << currentPair.first; if (currentPair.second > 1) ss << 's'; }