Localization

Traditionally the WoW Community API has handled localization by the consumer requesting a specific locale in a query paramater and the response containing localized strings in the request localization.

In the Game Data / Profile APIs the localization strategy for WoW has chaanges in some ways:

All Locales Returned by Default

When a resource is requested without referencing a specific locale, the documents will be returned with all localized key values as an object whos keys match a localization identifier.

{
  ...
  "faction": {
      "id": 1,
      "type": "HORDE",
      "name": {
          "en_US": "Horde",
          "es_MX": "Horda",
          "pt_BR": "Horda",
          "de_DE": "Horde",
          "es_ES": "Horda",
          "fr_FR": "Horde",
          "it_IT": "Orda",
          "pt_PT": "Horda",
          "ru_RU": "Орда",
          "ko_KR": "호드",
          "zh_TW": "部落",
          "zh_CN": "部落"
      }
  }
  ...
}

Differing JSON Structures

When a resource is requested with a specific locale requested through a locale query paramater, the documents will be returned with all localized key values as strings that are appropriate for the request localization.

Request:

?locale=ko_KR

Response:

{
  ...
  "faction": {
      "id": 1,
      "type": "HORDE",
      "name": "호드"
  }
  ...
}

Document Links

As described in the Game Data APIs overview the World of Warcraft Game Data APIs attempt to increase discoverability by providing an object called a link, in addition to any provided numerical ids or string slugs.

These links will often be structured as an object referenced by a property named "key" that contains an href property that is a url to a related resource, however links may also contain other commonly referenced data such as localized strings.

Example with localization:

{
  "dungeons": [
    {
      "key": {
        "href": "http://us.api.battle.net/data/wow/zone/:id"
      },
      "name": {
        "en_US": "Deadmines",
        "es_MX": "Minas de la Muerte",
        "pt_BR": "Minas Mortas",
        "de_DE": "Todesminen",
        "es_ES": "Minas de la Muerte",
        "fr_FR": "Mortemines",
        "it_IT": "Miniere della Morte",
        "pt_PT": "Minas Mortas",
        "ru_RU": "Мертвые копи",
        "ko_KR": "죽음의 폐광",
        "zh_TW": "死亡礦坑",
        "zh_CN": "死亡矿井"
      }
    }
  ]
}