I want to get the current site language as I am implementing a custom module that will depend on web language. I am new to SharePoint and the company is using multi language site or site collection.
//Current Language console.log(_spPageContextInfo.currentCultureName); console.log(_spPageContextInfo.currentLanguage); console.log(_spPageContextInfo.webLanguage); console.log(SP.Res.lcid); var currentLocale = "<%= SPContext.Current.Web.Language %>"; var globalLocale = "<%= SPContext.Current.Web.Language %>"; document.getElementsByTagName('html').getAttribute('lang');
You can try below code:
SPContext.Current.RegionalSettings.LocaleId - Gets the regional settings object of the current HTTP context in Microsoft SharePoint Foundation.
Also you could load language from current web
SPContext.Current.Web.Language - Gets the locale identifier (LCID) for the default language of the website.
To Use Java Script:
var lcid =_spPageContextInfo.currentLanguage;
var lcid = SP.Res.lcid;
It will give you the language ID, in English it's 1033. You have to know ID for each language you want and that's it.