5

I want to have 2 buttons, one En and the other Es, to change the display language for current user in SharePoint 2013, I have seen some articles talking about OnSelectionChange, but it doesn't work anymore.

Any way to change display language using JavaScript in 2013?

  • Hello Robert, any idea how I can implement this? – SharePoint Freak Mar 4 '15 at 22:32
1

You can use following code :

<script type ="text/javascript"> 
function OnSelectionChange(value)
{ 
var today = new Date();
var oneYear = new Date(today.getTime() + 365 * 24 * 60 * 60 * 1000);
var url = window.location.href;
document.cookie = "lcid=" + value + ";path=/;expires=" + oneYear.toGMTString();
window.location.href = url;
}
</script>

<a href="javascript:OnSelectionChange(1031)">German</a>
<a href="javascript:OnSelectionChange(1033)">English</a>

You can also refer: Change Sharepoint language with a link? http://www.n8d.at/blog/change-language-of-ui-using-custom-control/ http://thebitsthatbyte.com/switch-sharepoint-2013-page-language-to-user-preferred-language-using-javascriptjquery/

  • 3
    Hi Aanchal, I want a solution for SharePoint 2013 as you may have noticed, this solution works only for 2010, please read my question or test the solution you have posted before answering. Even the blog you have posted is for 2010. – SharePoint Freak May 27 '14 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.