GetUserLanguages

Returns a string array of language locale codes for the user’s browser. You can use this information to send language- and country-appropriate to a microsite.

This function doesn’t work with CloudPages. To retrieve language information for CloudPages, use the Platform.Request.GetRequestHeader() function to retrieve the Accept-Language header.

Note

Syntax 

Platform.Request.GetUserLanguages()

Usage 

To execute this function, call it without any parameters.

1<script runat="server">
2  var langs = Platform.Request.GetUserLanguages(); 
3  
4  var defaultLangs = langs[0];
5</script>

The code example returns a locale code derived from the user’s browser headers.

1en-US