Closed yunruse closed 11 months ago
This is really only a case of "customary US" or "imperial UK" for a very limited set of (mostly volume) units. I've added a UNITS_customary
(default True).
This functionality (and I did half-implement it!) is a little overkill for a relatively minor problem, IMO.
Imperial units will stay issue #1 for a long time to come I imagine. However, the whole idea is that this calculator refuses to let you trip over pesky unit confusions. It should not let you blithely go "I'll have a pint" and then cheat you out of 20%.
UNITS_country
should by default be set to'auto'
, requiring explicit setting; whenever needed, the PC language can be a nice heuristic.Whenever an ambiguous unit is fetched, it should explicitly always provide
AmbiguousUnitWarning: Assuming {unit_with_country_code} due to {reason}. To suppress this warning please explicitly import {unit_with_country_code}.
wherereason
is either"PC language"
or"config"
.A
UNITS_country_suppress_ambiguous_warning
can suppress this warning if and only ifUNITS_country
is not "auto".