From c158e23e2453a7e852fc234a47eec925097efab5 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 12 Dec 2022 19:15:08 -0800 Subject: [PATCH] (Tests) Switch es_MX examples to use lower-case month names There is a discrepancy in how month-names are capitalized, depending on the source of translation. `ts()` tends toward uppercase, and `IntlDateFormatter` tends toward lowercase. Since I don't know the capitalization rules for `es_MX`, I checked two sources: * Asked a bilingual speaker (native `es_MX`), and she went back-and-forth. Her first reaction was uppercase, but (after searching) she settled on lowercase. * Asked `translate.google.com` for a few phrases ("John was born on the first Thursday of March." and "Today is July 2nd" and "September is the best month."). `Spanish` seemed to work like `French` -- using the lowercase for month and day-of-week (except when handling the first-word-of-sentence). It seems like lowercase is better for `es_MX`, so this patch switches the examples to lowercase. Incidentally, the `es_MX` examples now resemeble the `fr_FR` examples, and they match `IntlDateFormatter`. --- tests/phpunit/CRM/Utils/DateTest.php | 2 +- tests/phpunit/Civi/Token/TokenProcessorTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/CRM/Utils/DateTest.php b/tests/phpunit/CRM/Utils/DateTest.php index d66f60def0..dd7bc091bd 100644 --- a/tests/phpunit/CRM/Utils/DateTest.php +++ b/tests/phpunit/CRM/Utils/DateTest.php @@ -2617,7 +2617,7 @@ class CRM_Utils_DateTest extends CiviUnitTestCase { public function testLocalizeConsts() { $expect['en_US'] = ['Jan', 'Tue', 'March', 'Thursday']; $expect['fr_FR'] = ['janv.', 'mar.', 'mars', 'jeudi']; - $expect['es_MX'] = ['ene.', 'mar.', 'Marzo', 'jueves']; + $expect['es_MX'] = ['ene.', 'mar.', 'marzo', 'jueves']; foreach ($expect as $lang => $expectNames) { $useLocale = CRM_Utils_AutoClean::swapLocale($lang); diff --git a/tests/phpunit/Civi/Token/TokenProcessorTest.php b/tests/phpunit/Civi/Token/TokenProcessorTest.php index c4b2c90da0..ba90ef4fb8 100644 --- a/tests/phpunit/Civi/Token/TokenProcessorTest.php +++ b/tests/phpunit/Civi/Token/TokenProcessorTest.php @@ -212,7 +212,7 @@ class TokenProcessorTest extends \CiviUnitTestCase { $expectText = [ 'Yes No April', 'Oui Non avril', - 'Sí No Abril', + 'Sí No abril', ]; $rowCount = 0; -- 2.25.1