achievements-app/psn-api

HeaderOverride for lang

Closed this issue · 2 comments

I have seen in the documentation that it is possible to overwrite the header to send the language ISO, how can I do it?

@c-peiron For the sake of someone who stumbles upon this issue, did you manage to resolve this?

Sorry, I completely forgot to leave the solution here. For those who want to get the descriptions and titles of the translated trophies, you must also send the following:

const { trophies: titleTrophies } = await getTitleTrophies(
    authorization,
    gameId,
    "all",
    {
      npServiceName: trophyTitlePlatform !== "PS5" ? "trophy" : undefined,
      headerOverrides: {"Accept-Language":  'Es-es'}
    }
  );