The previous version of this code was supporting only locales using the
format "<language>_<territory>.<charset>". But all the locales that
doesn't have this format were not installable (such as "fr_FR" or
"fr_FR@euro").
Also, if an invalid locales was provided, the module kept sending a
"changed" status.
Now :
* if the user provides an invalid locales, the module failed. Locales
are verified using /etc/locale.gen or /usr/share/i18n/SUPPORTED if
Ubuntu
* Every types of valid locales are now supported.
* The locale module was not working on Archlinux, as there's no space
between the "#" and the locale. This is now supported. Credits goes
to danderson189, this is his code.
This module was tested on debian jessie, ubuntu 14 LTS and last
Archlinux.