Bug: HelixAPI's `Search Categories` and `Get Games`'s `name` field only partially comply Accept-Language header

HelixAPI’s Search Categories’s name field doesn’t comply Accept-Language header.

When using the api with Accept-Language, box_art_url field will be changed as desired language’s one.
But name field doesn’t changed and it always returns en version of name.
And also, search query matching was mixed, both language’s matching was happen (it might be desired.)

for example:

When calling “Get Games” api as

curl -s "https://api.twitch.tv/helix/games?id=21779&id=32982&id=509658" \
  -H "Authorization: Bearer <token>" \
  -H "Client-Id: <client-id>" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "Accept-Language: ja"

this will returns

{
    "data": [
        {
            "id": "3290",
            "name": "Dragon Quest VIII: Journey of the Cursed King",
            "box_art_url":
"https://static-cdn.jtvnw.net/ttv-boxart/3290_IGDB_ja-jp-{width}x{height}.jpg",
            "igdb_id": "1819"
        },
        {
            "id": "18994872",
            "name": "Dragon Quest",
            "box_art_url":
"https://static-cdn.jtvnw.net/ttv-boxart/18994872_IGDB-{width}x{height}.jpg",
            "igdb_id": "239185"
        },
        {
            "id": "467499896",
            "name": "Dragon Quest III HD-2D Remake",
            "box_art_url":
"https://static-cdn.jtvnw.net/ttv-boxart/467499896_IGDB_ja-jp-{width}x{height}.jpg",
            "igdb_id": "149980"
        }
    ]
}

Also, When calling “Search Categories” api as

curl -s "https://api.twitch.tv/helix/categories?query=ドラゴンクエスト&first=3" \
  -H "Authorization: Bearer <token>" \
  -H "Client-Id: <client-id>" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "Accept-Language: ja"

this will returns

{
    "data": [
        {
            "box_art_url": "https://static-cdn.jtvnw.net/ttv-boxart/19704_IGDB-52x72.jpg",
            "id": "19704",
            "name": "Itadaki Street Special"
        },
        {
            "box_art_url": "https://static-cdn.jtvnw.net/ttv-boxart/26970_IGDB-52x72.jpg",
            "id": "26970",
            "name": "Dragon Quest Monsters: Joker 2"
        },
        {
            "box_art_url": "https://static-cdn.jtvnw.net/ttv-boxart/488153_IGDB_ja-jp-52x72.jpg",
            "id": "488153",
            "name": "Dragon Warrior IV"
        }
    ],
    "pagination": {
        "cursor": "MjA="
    }
}

Point is box_art_url and name field.

We can see the accept-language header correctly accepted at box_art_url.
In this field, the url was changed as japanese language version. i.e. from 3290_IGDB_{width}x{height}.jpg" to 3290_IGDB_ja-jp-{width}x{height}.jpg".
But name is just english text(= Dragon Warrior IV) yet. This should be changed as ドラゴンクエストIV 導かれし者たち in ja.

2 Likes

I have migrated this bug onto github: HelixAPI only partially comply Accept-Language header · Issue #1149 · twitchdev/issues · GitHub

1 Like

For ref it’s not documented as supporting it, so you’ve stumbled across a “happy accident” I guess?

The other thing to consider is that not all games will have their translated names and/or box art together, and I don’t know how much if at all Twitch ingests translation data from IGDB at all

Cross reference agaisnt the data sorurce IGDB

1 Like