refactored getCurrentLocale function