Try to get the primary locale of the system

I am working on replacing an old plugin which uses deprecated API. In case the user did not set any preferences for his locale

UserProfileService.getUser(context).getLocale()

returns NULL. The old code is

if (locale == null) {
locale = AdministrationService.getSiteLocaleSettings().getPrimaryLocale();
}

Now the AdministrationService is deprecated. How do I get the system locale using current API calls? I did not find anything in the API docs.

OriginalPostID-241441

  Discussion posts and replies are publicly visible