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:

{
  "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.

Troubleshooting tip: On completing your setup, if 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.

Language setting

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

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:

Select New:

Set your location/language codes as described below:

  • Select Location type: Profile Profile/User value option

  • 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.

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:

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:

"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)

Last updated