Modified the logic to determine locale. Strip out the country part of
the locale.