Multilingual Auto-Sense in Sitefinity 6.0
If I have my Sitefinity 6.0 home page translated into two languages, such as English and Turkish, how do I enable auto-sensing? For example, how do I get someone who has a Turkish language in their web browser to automatically go to the Turkish URL to the Turkish version of my home page instead of the default English home page? Is this something that also needs to be set in the web.config? Apparently if you try toGoogle.com with Turkish language in your browser for example you will automatically be directed to the www.google.com.tr site. So I am looking for something similiar.
There's apparently a feature request for what I am asking for from February 2013
http://www.telerik.com/support/pits.aspx#/details/Issue=14175
It looks like this feature used to work in version 3.7.
Does anyone from the Sitefinity team have an update on when this will be implemented for version 6.0? Is there a way I can implement this using my project's web.config file or custom coding?
Hi James,
As a standard Asp.Net application you will be able to achieve this through the Global.asax file. Use the following in the Session_Start() method of the Global.asax (if you do not have one in your project you need to create it) to get the client's default language and redirect to your needs:
var lang = Request.ServerVariables[
"HTTP_ACCEPT_LANGUAGE"
];
if
(lang.StartsWith(
"tr"
))
Response.Redirect(
"~/myTurkishHome"
);
else
Response.Redirect(
"~/myEnglishHome"
);
I hope this helps.
Regards,Hi Pavel,
Are there any plans to have this ability done automatically in a future version of Sitefinity?
Also, if I were to add an additional page in Turkish, like an "About Us", would I need to make additional entries in the global.asax?
-James
Hello James,
What else you can try is to use the Personalization tool and specify user characteristics on the home page. You can specify the users by Location property and thus display the desired page to them if they fit the criteria.
Regards,Hi Pavel,
I have the Standard Edition license, so I don't have this feature. So back to my original two questions:
Are there any plans to have this ability done automatically in a future version of Sitefinity?
Also, if I were to add an additional page in Turkish, like an "About Us", would I need to make additional entries in the global.asax?
Please let me know if you can answer these two questions.
Hello James,
As the functionality you require is achievable with the Personalization module I would suggest to take a look at our Pricing and Licensing list and consider changing the type of license you are currently using. If that is not an option you could still work with the Global.asax solution I have previously provided.
As the code executes in the Session_Start() method the redirect will be made when the user tries to access the site. After he is been redirected to the proper homepage he can then access the other pages based on the current cultuer (English or respectively Turkish). What this means is that you do not have to place any additional code in the Global.asax file for any new pages you add to your project. It is only important to redirect the user when he first accesses the site to the proper culture (which is already done with the provided solution).