adding support for switch-locale to dynamically change the locale