add plains as exception to english_singular and english_plural

This commit is contained in:
GenevensiS
2025-04-15 22:33:08 +02:00
parent 5c8d481066
commit 5907163f59
2 changed files with 21 additions and 19 deletions
+18 -18
View File
@@ -1,5 +1,23 @@
{
"configurations": [
{
"name": "x64-Release-static",
"generator": "Ninja",
"configurationType": "Release",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x64-windows-static",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": [
{
"name": "VCPKG_MANIFEST_FEATURES",
"value": "fonts",
"type": "STRING"
}
]
},
{
"name": "x86-Debug",
"generator": "Ninja",
@@ -54,24 +72,6 @@
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x86" ]
},
{
"name": "x64-Release-static",
"generator": "Ninja",
"configurationType": "Release",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "-DVCPKG_TARGET_TRIPLET=x64-windows-static",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": [
{
"name": "VCPKG_MANIFEST_FEATURES",
"value": "fonts",
"type": "STRING"
}
]
}
]
}
+3 -1
View File
@@ -152,7 +152,8 @@ SCRIPT_FUNCTION(english_number_ordinal) {
// ----------------------------------------------------------------------------- : Singular/plural
String english_singular(const String& str) {
String english_singular(const String& str) {
if (str.Lower() == _("plains")) return str;
if (str.size() > 3 && is_substr(str, str.size()-3, _("ies"))) {
return str.substr(0, str.size() - 3) + _("y");
} else if (str.size() > 3 && is_substr(str, str.size()-3, _("oes"))) {
@@ -174,6 +175,7 @@ String english_singular(const String& str) {
}
}
String english_plural(const String& str) {
if (str.Lower() == _("plains")) return str;
if (str.size() > 2) {
Char a = str.GetChar(str.size() - 2);
Char b = str.GetChar(str.size() - 1);