Implemented smart locale setting