Add available attribute to compile locales

Also, fix an issue with ubuntu's locale-gen and move helpers to the
appropriate place