Moved locale setting out of the library