Auto-dectect languages in locales directory instead of hardcoded.