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?

1
  • Hello Robert, any idea how I can implement this? Commented Mar 4, 2015 at 22:32

1 Answer 1

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/

1
  • 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. Commented May 27, 2014 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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