From 5907163f59c8c03ca3db28355ec1845429e3fa6a Mon Sep 17 00:00:00 2001 From: GenevensiS <66968533+G-e-n-e-v-e-n-s-i-S@users.noreply.github.com> Date: Tue, 15 Apr 2025 22:33:08 +0200 Subject: [PATCH] add plains as exception to english_singular and english_plural --- CMakeSettings.json | 36 ++++++++++++++++---------------- src/script/functions/english.cpp | 4 +++- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/CMakeSettings.json b/CMakeSettings.json index 6dd8ced6..b91aaa91 100644 --- a/CMakeSettings.json +++ b/CMakeSettings.json @@ -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" - } - ] } ] } diff --git a/src/script/functions/english.cpp b/src/script/functions/english.cpp index 94db14c4..d70cf8d5 100644 --- a/src/script/functions/english.cpp +++ b/src/script/functions/english.cpp @@ -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);