---
schema_version: "1"
id: 420fe366864711a6b0030444a37700e7f622f6784d6b2132d3dd42c43dee4969
title: GetUserLanguages
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-programmatic-content/ssjs_platformHTTPPropertyGetUserLanguages.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_platformHTTPPropertyGetUserLanguages.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: c43acab358ff2c494ec6ec99f045738b8628dbde7c603685d7ed933cf965cb8b
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# 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.

**note:** This function doesn’t work with CloudPages. To retrieve language information for CloudPages, use the [Platform.Request.GetRequestHeader()](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_platformHTTPPropertyGetRequestHeader.md) function to retrieve the `Accept-Language` header.

## Syntax

`Platform.Request.GetUserLanguages()`

## Usage

To execute this function, call it without any parameters.

<!-- prettier-ignore -->
```javascript
<script runat="server">
  var langs = Platform.Request.GetUserLanguages(); 
  
  var defaultLangs = langs[0];
</script>
```

The code example returns a locale code derived from the user’s browser headers.

```
en-US
```
