Currently, the "exception handling" in to_currency() replaces "...eins " by "...ein " which is correct for Euro, Dollar, Franken, cents, Pfennig, but it must be "...eine " for Mark (DEM, other Marks?) and for ital. Lira (ITL), maybe others ("Sesterze" doesn't exist any more, but....)?
See.
Fixes issue #462 reported by @rillig and patch #469 of the test cases.
Changes proposed in this pull request:
replace "eins " by "eine " if currency is feminine (DEM, also: ITL, TRY...) or "ein " (as it is done now unconditionnally, but "ein" is only correct for masculine currencies like Dollar, Euro, Franc, ...) otherwise.
Status
[X] READY
[ ] HOLD
[ ] WIP (Work-In-Progress)
How to verify this change
Run test cases, or manually
to_currency(value = 1.00, lang = "de", currency = "DEM) # must yield "eine Mark"
-- correctly produced by patched code of course only provided that patch #469 by @m-f-h is included !!
see there for more info
Additional notes
See also issue #462 reported by @rillig
For the moment I "hard-wired" DEM and ITL (Italian Lira) which are feminine and therefore require "eine", not "ein" in German.
Maybe one could use if currency in FEMININE_CURRENCIES and define a set or tuple `FEMININE_CURRENCIES = {"DEM","ITL"}, esp. if there are more to come.
Currently, the "exception handling" in to_currency() replaces "...eins " by "...ein " which is correct for Euro, Dollar, Franken, cents, Pfennig, but it must be "...eine " for Mark (DEM, other Marks?) and for ital. Lira (ITL), maybe others ("Sesterze" doesn't exist any more, but....)? See.
Fixes issue #462 reported by @rillig and patch #469 of the test cases.
Changes proposed in this pull request:
replace "eins " by "eine " if currency is feminine (DEM, also: ITL, TRY...) or "ein " (as it is done now unconditionnally, but "ein" is only correct for masculine currencies like Dollar, Euro, Franc, ...) otherwise.
Status
[X] READY
[ ] HOLD
[ ] WIP (Work-In-Progress)
How to verify this change
Run test cases, or manually to_currency(value = 1.00, lang = "de", currency = "DEM) # must yield "eine Mark" -- correctly produced by patched code of course only provided that patch #469 by @m-f-h is included !! see there for more info
Additional notes
See also issue #462 reported by @rillig
For the moment I "hard-wired" DEM and ITL (Italian Lira) which are feminine and therefore require "eine", not "ein" in German. Maybe one could use
if currency in FEMININE_CURRENCIES
and define a set or tuple `FEMININE_CURRENCIES = {"DEM","ITL"}, esp. if there are more to come.