Skip to content

Commit

Permalink
Merge pull request #16 from jurchiks/bugfix/pounds-lv-feminine
Browse files Browse the repository at this point in the history
Bugfix - pounds in Latvian are feminine.
  • Loading branch information
jurchiks authored Dec 19, 2020
2 parents 9fb67db + f910adb commit 8178bec
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/languages/Latvian.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down

0 comments on commit 8178bec

Please sign in to comment.