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.
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.
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
- Open "\Innovator\Client\scripts\login.aspx".
- 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
- Open "InnovatorServerConfig.xml".
- 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.
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.
ReplyDeleteThanks for your feedback.
DeleteI 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.
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.
ReplyDeleteDuring 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.
can't run at SP15
ReplyDeletehow to fix it?
Thanks for your feedback.
DeleteAras 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.
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~~~
ReplyDeleteSorry, I haven't tried that. But I believe customize window size by yourself is possible.
Delete