I made a couple of minor changes to the script (attached). Those changes would improve it a bit IMO, if going back to the old script is considered 'too much'. Especially they would prevent that a command like
sudo locale-gen en_US.UTF-8
or
sudo locale-gen --purge
results in a broken locale without the user being aware of what happened. The modified script also allows multiple (valid) language code arguments, so
sudo locale-gen en ja
generates the English and Japanese locales, and not only the Japanese.
I made a couple of minor changes to the script (attached). Those changes would improve it a bit IMO, if going back to the old script is considered 'too much'. Especially they would prevent that a command like
sudo locale-gen en_US.UTF-8
or
sudo locale-gen --purge
results in a broken locale without the user being aware of what happened. The modified script also allows multiple (valid) language code arguments, so
sudo locale-gen en ja
generates the English and Japanese locales, and not only the Japanese.