Please consider merging branch locale
of repo https://git.spwhitton.name/propellor
It adds the following properties:
Locale.selectedFor
to choose a locale for a locale variableLocale.available
, used byLocale.selectedFor
to ensure a locale is generated
Example usage (I'm British but I live in the US):
& "en_GB.UTF-8" `Locale.selectedFor` ["LANG", "LANGUAGE"]
& "en_US.UTF-8" `Locale.selectedFor` ["LC_PAPER"]
Pretty sure I've got the indentation right this time too
The types here don't tell me much about what values it expects.
selectedFor :: String -> [String] -> Property NoInfo
Function needs either some examples in its haddock, or better types.
Also, the
available
property incorrectly succeeds if the locale passed to it is not listed in locale.gen.(It would be nice for these properties to be revertable but that's just a thought.)