1

How can I make dropdown menu for site language selection in SharePoint 2013 so that users can choose what language they prefer?

icedkacang
  • 11
  • 1

2 Answers2

0
  1. You need to have the language pack installed for all the language options which you want to show in your dropdown menu.
  2. Now you can create a html dropdown list and place it anywhere , like inside masterpage or in a CEWP etc etc.
  3. Now SharePoint 2013 UI language is the default browser language and to override that you can set a cookie 'lcid' to the dropdown selected value.

Below is the JavaScript code for that:

<script type ="text/javascript"> 

function ChangeUILanguage(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>

Call this JavaScript method onchange event of the drop down list.

Unnie
  • 8,819
  • 1
  • 22
  • 36
  • will this code get users to choose what language they want to use in online SharePoint 2013? what i want to know is the steps on how external users can choose the language on the site based on drop down list menu. please help. thank you – icedkacang Sep 03 '15 at 06:17
0

or if you want to keep it clean and not code stuff you simply change the browser language.

Example:

settings --> internet settings --> languages and change the language to the one you need.

This requires that you have downloaded language packs for your browser ofc.

Cherubel
  • 563
  • 1
  • 5
  • 26