How can I implement a relay state that defines a specific locale?

Answer

A relay state is basically just a token to select a redirect target after successful authentication (i.e., after the SAML/consume URL is called).

The name of the relay state is arbitrary and can be anything (it should contain only letters, no whitespaces).

If a relay state is not found or none is declared, it uses the default target which is:

/app/modules/?triggerLogin=true&username=USERNAME&partition=PARTITION

 

So you could set up states like:

localeDE : /app/?locale=de&uiLanguage=de