Locales

List Locales

GET /api/v2/locales.json

This lists the translation locales that are available for the account.

Allowed For:
  • Anyone
Using curl
curl https://{subdomain}.zendesk.com/api/v2/locales.json \
   -v -u {email_address}:{password}
Example Response
Status: 200 OK

{
  "locales": [
    {
      "id":         1,
      "url":        "https://company.zendesk.com/api/v2/locales/1.json",
      "locale":     "en-US",
      "name":       "English",
      "created_at": "2009-07-20T22:55:29Z",
      "updated_at": "2011-05-05T10:38:52Z"
    },
    {
      "id":         8,
      "url":        "https://company.zendesk.com/api/v2/locales/8.json",
      "locale":     "de",
      "name":       "Deutsch",
      "created_at": "2010-12-23T12:45:22Z",
      "updated_at": "2012-04-01T10:44:12Z"
    }
  ]
}

List Available Public Locales

GET /api/v2/locales/public.json

This lists the translation locales that are available to all accounts.

Allowed For:
  • Anyone
Using curl
curl https://{subdomain}.zendesk.com/api/v2/locales/public.json \
   -v -u {email_address}:{password}
Example Response
Status: 200 OK

{
  "locales": [
    {
      "id":         1,
      "url":        "https://company.zendesk.com/api/v2/locales/1.json",
      "locale":     "en-US",
      "name":       "English",
      "created_at": "2009-07-20T22:55:29Z",
      "updated_at": "2011-05-05T10:38:52Z"
    },
    {
      "id":         8,
      "url":        "https://company.zendesk.com/api/v2/locales/8.json",
      "locale":     "de",
      "name":       "Deutsch",
      "created_at": "2010-12-23T12:45:22Z",
      "updated_at": "2012-04-01T10:44:12Z"
    }
  ]
}

List Locales for Agent

GET /api/v2/locales/agent.json

This lists the translation locales that have been localized for agents on a specific account.

Allowed For:
  • Anyone
Using curl
curl https://{subdomain}.zendesk.com/api/v2/locales/agent.json \
   -v -u {email_address}:{password}
Example Response
Status: 200 OK

{
  "locales": [
    {
      "id":         1,
      "url":        "https://company.zendesk.com/api/v2/locales/1.json",
      "locale":     "en-US",
      "name":       "English",
      "created_at": "2009-07-20T22:55:29Z",
      "updated_at": "2011-05-05T10:38:52Z"
    },
    {
      "id":         8,
      "url":        "https://company.zendesk.com/api/v2/locales/8.json",
      "locale":     "de",
      "name":       "Deutsch",
      "created_at": "2010-12-23T12:45:22Z",
      "updated_at": "2012-04-01T10:44:12Z"
    }
  ]
}

Show Locale

GET /api/v2/locales/{id}.json

Allowed For
  • Anyone
Using curl
curl https://{subdomain}.zendesk.com/api/v2/locales/{id}.json \
  -v -u {email_address}:{password}
Request parameters
Name Type Description
id string Either the ID or the bcp-47 code of the locale (es-419, en-us, pr-br)
bidi_chars boolean Wrap translations with unicode directional characters indicating a rendering direction according to the locale
fallback boolean This will prevent a fallback value for translations from being provided. The default value is true. When it is set to false, translations missing a value will be returned as an empty string.
include string This is the standard Zendesk side-load query parameter. The only option accepted here is translations
packages string This allows you to specify a package, or list of packages (comma separated), to scope the response to when translations are side-loaded.
raw boolean This will prevent HTML from being sanitized when translations are side-loaded. The default value is false.
Example Response
Status: 200 OK

{
  "locale": {
    "id":         8,
    "url":        "https://company.zendesk.com/api/v2/locales/8.json",
    "locale":     "de",
    "name":       "Deutsch",
    "created_at": "2010-12-23T12:45:22Z",
    "updated_at": "2012-04-01T10:44:12Z",
  }
}

Show Current Locale

GET /api/v2/locales/current.json

This works exactly like show, but instead of taking an id as argument, it renders the locale of the user performing the request.

Detect best language for user

GET /api/v2/locales/detect_best_locale.json

Allowed For
  • Anyone
Using curl
curl https://{subdomain}.zendesk.com/api/v2/locales/detect_best_locale.json \
  -v -u {email_address}:{password} \
  -H "Content-Type: application/json" -X PUT \
  -d '{"available_locales":["es", "ja", "en-uk"]}'
Example Response
Status: 200 OK

{
  "locale": {
    "id":         1,
    "url":        "https://company.zendesk.com/api/v2/locales/1.json",
    "locale":     "en",
    "name":       "English",
    "created_at": "2010-12-23T12:45:22Z",
    "updated_at": "2012-04-01T10:44:12Z",
  }
}