# Setting a default statement language

### Some context

The Language Code field in xAPI statements, such as `"en-US"` for English (United States) or `"en-GB"` for English (United Kingdom), is important because it ensures that the xAPI data and content are correctly interpreted according to the learning environment's adopted language and the language/dialect expected from inbound xAPI statements.

Here's an example of language codes being used in an xAPI statement:

```json
{
  "actor": {
    "name": "Jane Doe",
    "mbox": "mailto:jane.doe@example.com"
  },
  "verb": {
    "id": "http://adlnet.gov/expapi/verbs/completed",
    "display": {
      "en-US": "completed"
    }
  },
  "object": {
    "id": "http://example.com/courses/actuarial-course",
    "definition": {
      "name": {
        "en-US": "Science Course",
        "fr-FR": "Cours de science"
      },
      "description": {
        "en-US": "An advanced course on science principles.",
        "fr-FR": "Un cours avancé sur les principes de la science."
      }
    }
  },
  "result": {
    "completion": true,
    "success": true,
    "score": {
      "scaled": 0.95
    }
  },
  "context": {
    "language": "en-US"
  }
}
```

* The `display` field in the `verb` element uses `"en-US"` to specify the language of the verb ("completed").
* The `name` and `description` fields in the `object` element include both `"en-US"` and `"fr-FR"` versions, showing how the course name and description can be presented in different languages.
* The `context` field's `language` attribute is set to `"en-US"`, indicating that the overall statement is processed in U.S. English.

{% hint style="warning" %}
**Troubleshooting tip:** On completing your setup, **i**f inbound xAPI Statements are incomplete (e.g there is no "Verb" data displaying) this may be due to an unexpected language in the xAPI statement structure. Setting default language(s) according to your expectations may resolve any issues.
{% endhint %}

### Language setting

From the Salesforce **Setup** screen, use **Quick Find** to locate “**Custom Settings**”.

<figure><img src="https://1749012385-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcTyQ05dv9UTW8n6ypeAM%2Fuploads%2F3Oz4eCPvKZAf8vZ2TTIP%2FScreenshot%202024-08-30%20at%2009.00.38.png?alt=media&#x26;token=4f48b976-fb4d-4fbd-a55d-c0c69d4417a1" alt="" width="270"><figcaption></figcaption></figure>

Open **Custom Settings**. Note that your browser will need to accept cross-domain cookies, otherwise you will need to view this page in "Salesforce Classic".

Locate the entry for **xAPI Actions Settings** and select the **Manage** link:

<figure><img src="https://1749012385-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcTyQ05dv9UTW8n6ypeAM%2Fuploads%2FKnRDBKrwSKGzNAPcK3VY%2FScreenshot%202024-08-30%20at%2009.03.59.png?alt=media&#x26;token=2daa82e4-17ee-4b63-a7b2-05231d139b99" alt="" width="375"><figcaption></figcaption></figure>

Select **New:**

<figure><img src="https://1749012385-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcTyQ05dv9UTW8n6ypeAM%2Fuploads%2FXQMQi2IFqId4klf1OmeG%2FScreenshot%202024-08-30%20at%2009.05.23.png?alt=media&#x26;token=42b49154-7b7d-4eb4-b058-d7ddee1100f7" alt="" width="375"><figcaption></figcaption></figure>

Set your **location/language codes** as described below:

<figure><img src="https://1749012385-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcTyQ05dv9UTW8n6ypeAM%2Fuploads%2FGJRapfyDMMH88X9ZEYYR%2FScreenshot%202024-08-30%20at%2009.07.32.png?alt=media&#x26;token=bc7e902b-0965-41bc-bb54-7ae5141efc84" alt="" width="375"><figcaption></figcaption></figure>

* Select **Location** type: Profile <mark style="color:purple;">Profile/User value option</mark>
* Enter the default language in the **Language Codes** field, for example `"en-US"`
  * To enter multiple language codes use comma separation, for example `"en-US","en-GB","fr-CA"` etc.
  * Only up to 2 languges are currently supported.

**Save** the setting.

### **Code reference**

Here’s a reference list of commonly used language codes. These language codes follow the ISO 639-1 standard for language codes, often combined with a country code (ISO 3166-1 alpha-2) to specify the regional dialect.&#x20;

**English Variants:**

`"en-US"`: English (United States)

`"en-GB"`: English (United Kingdom)

`"en-AU"`: English (Australia)

`"en-CA"`: English (Canada)

`"en-IN"`: English (India)

`"en-NZ"`: English (New Zealand)

**Spanish Variants:**

`"es-ES"`: Spanish (Spain)

`"es-MX"`: Spanish (Mexico)

`"es-AR"`: Spanish (Argentina)

`"es-CO"`: Spanish (Colombia)

`"es-CL"`: Spanish (Chile)

**French Variants:**&#x20;

`fr-FR"`: French (France)

`"fr-CA"`: French (Canada)

`"fr-BE"`: French (Belgium)

`"fr-CH"`: French (Switzerland)

**German Variants:**

`"de-DE"`: German (Germany)

`"de-AT"`: German (Austria)

`"de-CH"`: German (Switzerland)

**Portuguese Variants:**

`"pt-PT"`: Portuguese (Portugal)

`"pt-BR"`: Portuguese (Brazil)

**Chinese Variants:**

`"zh-CN"`: Chinese (Simplified, China)

`"zh-TW"`: Chinese (Traditional, Taiwan)

`"zh-HK"`: Chinese (Traditional, Hong Kong)

**Arabic Variants:**

`"ar-SA"`: Arabic (Saudi Arabia)

`"ar-EG"`: Arabic (Egypt)

`"ar-AE"`: Arabic (United Arab Emirates)

`"ar-MA"`: Arabic (Morocco)

**Russian:**

`"ru-RU"`: Russian (Russia)

**Japanese:**&#x20;

`"ja-JP"`: Japanese (Japan)

**Korean:**

`"ko-KR"`: Korean (South Korea)

**Italian:**

`"it-IT"`: Italian (Italy)

`"it-CH"`: Italian (Switzerland)

**Dutch Variants:**

`"nl-NL"`: Dutch (Netherlands)

`"nl-BE"`: Dutch (Belgium)

**Swedish:**

`"sv-SE"`: Swedish (Sweden)

**Norwegian:**

`"no-NO"`: Norwegian (Norway)

**Danish:**

`"da-DK"`: Danish (Denmark)

**Finnish:**

`"fi-FI"`: Finnish (Finland)

**Polish:**

`"pl-PL"`: Polish (Poland)

**Turkish:**

`"tr-TR"`: Turkish (Turkey)
