Retrieve alternative languages in SharePoint using JavaScript

This JSOM tutorial, will discuss, how to retrieve alternative languages from language settings in SharePoint Online using JavaScript object model (jsom). In the same way, we can get alternative languages in SharePoint 2013/2016 using JavaScript.

If you want to retrieve alternative languages in SharePoint using Rest API, then you can follow this article.

Retrieve alternative languages in SharePoint using JavaScript

You can see the alternative languages from Site settings -> language settings that are under Site Administration. It shows like below:

Retrieve alternative languages in SharePoint using JavaScript

For this particular post, I have added the below code inside a script editor web part on a SharePoint web part page.

Remember it will display like for the English language it will return 1033.

<input type="button" id="btnGetLanguages" value="Click Here"/>
<script src=""></script>

var web;
function GetLanguages(){
var clientContext = new SP.ClientContext();
clientContext.executeQueryAsync(Function.createDelegate(this, this.onSuccess),
Function.createDelegate(this, this.onFailure));

function onSuccess() {
var supportedlanguage = web.get_supportedUILanguageIds();
for (var i = 0; i < supportedlanguage.length; i++) {
var languageName = supportedlanguage[i].toString();
function onFailure(sender, args) {
alert(‘Error Occurred. ‘ + args.get_message());

You may like following SharePoint JSOM tutorials:

This SharePoint jsom tutorial, we learned how to get alternative languages in SharePoint Online or SharePoint 2013/2016 using the JavaScript object model (jsom).

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

  • Hi Sir, I created language link English|Arabic on master page right corner of sharepoint team site. bydefaut site language is English. When user click on Arabic langauge then complete site should show in Arabic language. Please help me how to complete this task.

  • >