REST request locale should be either from Accept-Language or user's language

Hi

I don’t know if it’s already implemented in the last version, but at least in 6.6.4 when making a REST request, the locale used for setting the UserInvocationContext is either the Accept-Language header (and that’s fine), OR the default one.

Before using the default one, it should be taken in consideration the language set in the user property of the current UserSession.
Given that in 99% of the time we are working with authenticated requests on behalf of a user, what makes more sense to me is using the locale (and timezone) the user has chosen, instead of falling back to a default one.

So the search for the request language should be:

  • the value of Accept-Language header
  • the value of UserSession.getUser().getLanguage()
  • the default locale

PS: for all readers, the UserInvocationContext is used as the first source of truth for determining the UserSession locale and timezone. If not found in the context, the value stored in the session is used.

Thanks,
Paolo

Thanks, Paolo

The issue: https://youtrack.cuba-platform.com/issue/PL-10002