Changed how the current locale is retrieved