Determine Locale from Other Source than Browser Language

Hi,

we build a larger system where Camunda Cockpit is just a part of. We offer our users global language settings applying to all apps. The settings are stored in a separate microservice and should be applied to Camunda Cockpit as well. I added the translations for Camunda Cockpit and it works fine when changing browser language. But now I need to get the locale from my custom microservice.

Is there a possibility to tell Camunda WebApps explicitely which language to use?

We use the Spring Boot Starter and I thought of writing a custom LocaleResolver.
I tried as a proof a concept a LocaleResolver which always resolves to German:

public class CustomLocaleResolver extends SessionLocaleResolver {
	@Override
	public Locale resolveLocale(HttpServletRequest request) {	  
	    // resolve by calling microservice
        return Locale.GERMAN;
	}
}

and of course I register it:

@Bean
public LocaleResolver localeResolver() {
    CustomLocaleResolver localeResolver = new CustomLocaleResolver();
    return localeResolver;
}

However, Camunda Cockpit always shows up in the browser language.

What else is necessary to tell Camunda Cockpit the desired locale?

After studying the Camunda source code, I have some more insight, but still can not solve my problem.
I found out that the language selection is hard-coded in the AngularJS code (link to source code).

My conclusions:

  1. It’s useless to manipulate the Spring Boot locale as I tried in my first post. The AngularJS code does the job independent of the Spring Boot app.
  2. The AngularJS code directly asks the browser about the user’s preferred language. Thus manipulating the request header (Accept-Language) won’t help neither.
  3. I tried overwriting the language selection by adding a script as a Cockpit plugin. However, it seems that Camunda’s original code is loaded before the plugins, so my code had no effect.

Maybe somebody of Camunda can comment if there is a way to custom language selection?