Skip to main content

Add Locale Options to Login Page of Aras Innovator

Aras Innovator supports multilingual user interface and will automatically determine locale preference by browser's language configuration.
But it is not convenient if user want to change locale quickly due to user may not know or do not want to change browser's settings.
Allow users determine the locale with login data by themselves should be an alternative way to solve the problem. Follow below steps to implement.

Add Inline Code

  1. Open "\Innovator\Client\scripts\login.aspx".
  2. Move to line 131 and add below code with embedded code block.

Dim objLocales As XmlNodeList = ApplicationXML.SelectNodes("/Innovator/Locale-Option[@id and @text]")

If objLocales.Count>0 Then
 Dim objLocale As XmlElement
 
 Dim strDefault As String = Request.ServerVariables.Item("HTTP_ACCEPT_LANGUAGE").SubString(0,5)
 Dim strID As String
 Dim strText As String
 
 Response.Write("<div class=""database"">")
 Response.Write("<select required id=""locale_select"" name=""locale"" onchange=""parent.aras.setCommonPropertyValue('systemInfo_CurrentLocale',this.options[this.selectedIndex].value);"">")
 
 For Each objLocale In objLocales
  strID = objLocale.GetAttribute("id")
  strText = objLocale.GetAttribute("text")
  
  Response.Write("<option value=""" & strID & """" & If(strID=strDefault," selected","") & ">" & strText & "</option>")
 Next
 
 Response.Write("</select>")
 Response.Write("<span></span>")
 Response.Write("</div>")
End If

Define Locale Options

  1. Open "InnovatorServerConfig.xml".
  2. Append new tag with below format.

<Locale-Option id="en-US" text="English" />
  • id - the option value with language tag (see Language Localisation).
  • text - the option text to show in select box.

Result

An additional select box for locale should be displayed in login page. In contrast, select box will hide if there is no any locale option.
And now, users are able to login with specified locale without changing browser's settings.



※Please note, language packs still need to be imported manually, this article only introduces an alternative solution for choosing locale at login page.

Comments

  1. Excellent idea! Tried it in a test database with English and German locals. Language selections works fine, but I unfortunately didn´t notice any change of language. It sticked to the previous default langage. Also decimal marks and ItemType names didn´t change. Tested your code with Aras SP11, not sure if this one conflicts.

    ReplyDelete
    Replies
    1. Thanks for your feedback.
      I checked in SP9 and SP12 with German seems OK, including decimal marks.
      ItemType names will not change due to they are not multilingual.
      It sounds like you did not import German language.

      Delete
  2. Thanks for the hint with the ItemType names! I actually do not use the complete German language pack, just a few parts to display the correct date format.
    During my tests I just changed the ItemTypes names and used some custom xml files. With this settings, I always got the German locals. But I assume your example will require the complete language pack to work, just as you said. I will try it again when I have the possibility.

    ReplyDelete
  3. can't run at SP15
    how to fix it?

    ReplyDelete
    Replies
    1. Thanks for your feedback.
      Aras Innovator 11 SP15 is not open release, so I cannot test on that version.
      Maybe you can describe more details about the problem you met.

      Delete
  4. Hi, according to the grammar, I also need to add Google reCaptcha in login.aspx, which causes the login window to look too small. where can I set height or RWD the login popup window to make it more suitable for the needs? thanks~~~

    ReplyDelete
    Replies
    1. Sorry, I haven't tried that. But I believe customize window size by yourself is possible.

      Delete

Post a Comment

Popular posts from this blog

aras.uiShowItemEx Method (aras Object)

aras.uiShowItemEx Method Shows Item with Item node. Syntax aras.uiShowItem( itemNd , viewMode , isOpenInTearOff ) Parameters Name Type Description itemNd Object Required. Item node. viewMode String Optional. Unknown purpose but only supports the following values: tab view (Default) openFile new ※Each supported value will get same result. Therefore, call method and pass undefined for this parameter is OK. isOpenInTearOff Boolean Optional. Specifies whether show Item with tear-off window. true - open in a tear-off window. false - open in a tab. (Default) Return Value An AsyncResult object or a Boolean. Returns AsyncResult object if the Item winodw is opened successfully, otherwise returns false. See Also aras Object Aras Innovator Client Framework

aras.uiShowItem Method (aras Object)

aras.uiShowItem Method Gets Item by Item ID and then shows the Item. Syntax aras.uiShowItem( itemTypeName , itemID , viewMode ) Parameters Name Type Description itemTypeName String Required. Name of the ItemType. itemID String Required. ID of the Item. viewMode String Optional. Unknown purpose but only supports the following values: tab view - This is default. openFile new ※Each supported value will get same result. Therefore, call method without this parameter is OK. Return Value An AsyncResult object or a Boolean. Returns AsyncResult object if the Item winodw is opened successfully, otherwise returns false. See Also aras Object Aras Innovator Client Framework

window.handleItemChange Method (Instance Window Object)

window.handleItemChange Method Changes current Item's property value. If Item is not locked, the function will do nothing. Syntax window.handleItemChange( propNm , propVal , dataType , datePattern ) Parameters Name Type Description propNm String Required. Property name. propVal String Required. Property value. dataType String Optional. Property data type. If the data type is "date", this parameter is required, otherwise it is not necessary to pass. datePattern String Optional. Date pattern, supports the following values: short_date (Default) short_date_time long_date long_date_time See Also Instance Window Object Aras Innovator Client Framework