locked
MUI Language Switcher in SP 2013 RRS feed

  • Question

  • Dear All-

    I need to develop a custom web part in SP 2013 to allow the user to switch the language using the MUI approach, ans as you know the link which was in SP 2010 has been removed from 2013

    The portal language doesn't changed with me excpet in one case: when changing the browser language settings only !!

    I tried to use the below code whihc I used before on SP 2010 but it doesn't work in 2013 anymore

    Can you please guide me how let this code work under new 2013 design ?

    <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=/;domain=' + window.location.host + ';expires=' + oneYear.toGMTString();
            window.location.href = url;
        }
     function ChangeMUI() {
            lcid = _spPageContextInfo.currentLanguage;
            if (lcid == 1033) { //en
                OnSelectionChange(1025)
            }
            else //ar
                OnSelectionChange(1033)
        }
     </script>

    Saturday, April 6, 2013 3:50 PM

Answers