Added support for new locale logic and DEFAULT_LOCALE constant