From f910adb51b7c0fb0925d32dcac90e600ae067264 Mon Sep 17 00:00:00 2001 From: Juris Date: Sat, 19 Dec 2020 18:59:39 +0200 Subject: [PATCH] Bugfix - pounds in Latvian are feminine. --- src/languages/Latvian.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/languages/Latvian.php b/src/languages/Latvian.php index fa84b17..074951c 100644 --- a/src/languages/Latvian.php +++ b/src/languages/Latvian.php @@ -118,9 +118,13 @@ private function spellSingle(int $digit, bool $isDecimalPart, string $currency): 9 => 'deviņas', ]; - if ($isDecimalPart && ($currency === Speller::CURRENCY_RUSSIAN_ROUBLE)) + $feminineCurrencies = [ + Speller::CURRENCY_RUSSIAN_ROUBLE => $isDecimalPart, // Russian kopeks (but not rubles) + Speller::CURRENCY_BRITISH_POUND => !$isDecimalPart, // British pounds (but not pennies) + ]; + + if (!empty($feminineCurrencies[$currency])) { - // russian kopek nouns are feminine gender in Latvian return $singlesFeminine[$digit]; }