Slighty improved locale checking, see http://unix.stackexchange.com/questions/69125/how-would-a-script-know-when-running-locale-gen-is-necessary