[FIX] rewrite locale

[FIX] if locale parameter is empty, then is overwritten by the system default.