By: Theodore Sands user 12 Jul 2017 at 8:07 a.m. CDT

5 Responses
Theodore Sands gravatar
I am trying to get the login page (https://<mydomain>/oxauth/login) to use another language other than English. I confirmed the faces-config.xml has the supported locale added. I confirmed the language in the uiLocalesSupported was correct in the oxAuth config page of the Gluu UI. 1. Do I need to pass in a 'locales' parameter on the query string? 2. I've created a DropDown on the login page with supported locales. Is it possible to write an OnSelect or OnChange handler in the xhtml to change the language? 3. Am I missing some functionality that Gluu provides?

By Mohib Zico staff 12 Jul 2017 at 8:39 a.m. CDT

Mohib Zico gravatar
We are going to start this localization in 3.1.0. Screenshot attached. May be you can take a look at that code base and spin a 3.1.0 to compare?

By Theodore Sands user 12 Jul 2017 at 9:43 a.m. CDT

Theodore Sands gravatar
Perhaps this is not the forum for this but, in the /opt/apache-tomcat-7.0.65/webapps/oxauth/login.xhtml, we can access Server Facelet stuff (not certain of the terminology). There is a way I could get the available locales using the ``` FacesContext.getCurrentInstance().getApplication().getSupportedLocales() ``` but I am not sure how to access that within the XHTML page. Then, I could set the locale using ``` FacesContext.getCurrentInstance().getViewRoot().setLocale(LOCALE); ``` and refresh the login.xhtml page.

By Theodore Sands user 13 Jul 2017 at 12:36 p.m. CDT

Theodore Sands gravatar
I was able to partially solve this by sending a ui_locales parameter to the authorize endpoint. This gets stored in the session and the login page then has access to it. If the given string is in the selected, supported language file, it will display appropriately. I got access to the passed locales in the index.xhtml page: ``` <ui:param name="selectedLanguage" value="#{empty sessionAttributes['ui_locales'] ? 'en' : fn:substring(sessionAttributes['ui_locales'],0,2)}"></ui:param> ``` where the _fn_ prefix is set as: ``` xmlns:fn="http://java.sun.com/jsp/jstl/functions" ``` But, this couldn't be modified for postback if the user changes their language while on the login page. So, I did some javascript and HTML tag attribute magic to change language on the fly on the client.

By Denis St-Michel user 25 Sep 2017 at 2:30 p.m. CDT

Denis St-Michel gravatar
I am too struggling with this issue. I just can't sem to make it work "natively". Is there any way to force a locale on the login page? Thank you!

By Theodore Sands user 25 Sep 2017 at 9:38 p.m. CDT

Theodore Sands gravatar
I haven't tried custom login scripts with jython. Nor have I tried version 3.x. I'm still using 2.4.4.