Autodetection from gettext

The locales directory always caused a warning about using gnu extensions to make for me. While trying to fix that I found a TODO: autodetection  of gettext.
This I knew how to do but I didn't find a way to do so without switching to the standard directory structure so a few file moves have been necessary.