Skip to content

[BUG]: Only planet name is in pecified language, other infos are not #101

@SherkeyXD

Description

@SherkeyXD

Link to faulty endpoint

/api/v1/planets

The name of your client/application

SherkeyXD/helldivers-2-api-python

Request information

class API:
    api_root = "https://api.helldivers2.dev"
    headers = {
        "Accept": "application/json",
        "Accept-Language": "zh-Hans",
        "User-Agent": "SherkeyXD/helldivers-2-api-python",
        "X-Super-Client": "writing.prts.tech",
    }

    @staticmethod
    def __makeRequest(url: str, max_retry: int = 3):
        for _ in range(max_retry):
            res = requests.get(url, headers=API.headers)
            if res.status_code == 200:
                return res.json()
        return None

    @staticmethod
    def GetApiV1Planets(index : int) -> dict:
        """
        Fetches a specific Planet identified by index.
        """
        info = API.__makeRequest(API.api_root + f"/api/v1/planets/{index}")
        return info

Steps to reproduce

Set "Accept-Language": "zh-Hans" in header, then request.

What is expected?

All info should be in Chinese.

What is actually happening?

Only planet name is in Chinese, other infos are still in English.

{
    "index": 79,
    "name": "希斯",
    "sector": "Orion",
    "biome": {
        "name": "Winter", // Should be in Chinese
        "description": "Submerged in eternal winter, this world's frosty peaks glimmer in the light of its too-distant star." // Should be in Chinese
    },
    "hazards": [
        {
            "name": "Extreme Cold", // Should be in Chinese
            "description": "Icy temperatures reduce rate of fire and delay heat buildup in weapons." // Should be in Chinese
        },
        {
            "name": "Blizzards", // Should be in Chinese
            "description": "Intense blizzard reduce mobility and moderately reduce visibility for both enemy and friendly units." // Should be in Chinese
        }
    ],
    // ...
}

System Info

No response

Any additional comments?

Not only zh-Hans meets this problem, all languages are experiencing this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedissue needs more information or input to be picked upbugSomething isn't workingmappingThis issue or it's solution is related to how information is mapped

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions