ppy / osu

rhythm is just a *click* away!
https://osu.ppy.sh
MIT License
15.32k stars 2.28k forks source link

Errors returned from API use language chosen on web rather than client's #14662

Closed Gabixel closed 1 year ago

Gabixel commented 3 years ago

Describe the bug: The "You have too many favourited beatmaps" notification seems to ignore the selected in-game language. I guess the message is retrieved from the request to favourite a beatmap, which uses the website language for the response (edit: confirmed after checking the network.log file). It's not really an issue, but seeing two different languages at the same time might seem wrong.

In the example below, both notifications were triggered while the language in-game was English.

At the moment I don't remember if there are other similar requests/notifications, so I'll just keep the scope of this issue on this specific case.

Screenshots or videos showing encountered issue:

image

osu!lazer version: 2021.907.0

bdach commented 3 years ago

The error message does indeed come from web and will indeed use the language chosen web-side. Not sure how to proceed here, maybe the client language and the website language should sync up at some point.

This won't be specific to this one case either, I imagine this will happen every time that user-readable errors from web are displayed on the client UI.

frenzibyte commented 3 years ago

Or, alternatively, let osu!web provide the key to the localisable string for the client to identify. Might be easier if feasible.

bdach commented 3 years ago

Actually I forgot that a somewhat typical method to do something like this is sending an Accept-Language header from the client and letting web handle it to return the proper translated message.

peppy commented 3 years ago

Agree that is the easiest / best direction initially.