OpenXbox / xbox-webapi-python

A python library to authenticate with Xbox Live via your Microsoft Account and provides Xbox related Web-API.
https://pypi.python.org/pypi/xbox-webapi
MIT License
177 stars 45 forks source link

Add support for achievement languages #104

Open Landcross opened 6 months ago

Landcross commented 6 months ago

When creating an XboxLiveClient, it's possible to add a language. However, this language is not taken into account when retrieving achievement information. Per Microsoft's documentation, the endpoints can take into account the Accept-Language header parameter and it'll try to load the achievements in that language, if possible:

List of desired locales and fallbacks (e.g., fr-FR, fr, en-GB, en-WW, en-US). The Achievements service will work through the list until it finds matching localized strings. If none are found, it attempts to match the location defined in the user token, which comes from the user's IP address. If still no matching localized strings are found, it uses the default strings provided by the title developer/publisher.

It would be nice if support can be added to retrieve achievement info in a specific language.