Improve Ukrainian support and minor fixes in CZ, KZ, LT, LV, PL, RU, SR languages (#400)

* Fix English char 'i' in Ukrainian words

* Fix the feminine currency processing for UAH in lang_UK.py

* Fix test_ua.py

* Fix the feminine currency processing for UAH in lang_RU.py

* Add tests for UAH in test_ru.py

* Add world currencies to lang_UK.py; Add test cases to test_uk.py for world currencies

* Fix incorrect handling of zeros after decimal point for CZ, KZ, LT, LV, PL, RU, SR and UK languages

* Add ukrainian ordinal numbers

* Fix too long lines of code

* Add test for negative cardinal number
This commit is contained in:
Rostyslav Ivanyk
2021-06-30 20:23:46 +03:00
committed by GitHub
parent 8061cf3b20
commit 40ab739f6c
17 changed files with 4192 additions and 156 deletions

View File

@@ -257,6 +257,9 @@ class Num2Word_Base(object):
"""
raise NotImplementedError
def _money_verbose(self, number, currency):
return self.to_cardinal(number)
def _cents_verbose(self, number, currency):
return self.to_cardinal(number)
@@ -290,12 +293,13 @@ class Num2Word_Base(object):
cr1 = prefix_currency(self.CURRENCY_ADJECTIVES[currency], cr1)
minus_str = "%s " % self.negword if is_negative else ""
money_str = self._money_verbose(left, currency)
cents_str = self._cents_verbose(right, currency) \
if cents else self._cents_terse(right, currency)
return u'%s%s %s%s %s %s' % (
minus_str,
self.to_cardinal(left),
money_str,
self.pluralize(left, cr1),
separator,
cents_str,