foxfriends / root

Play Root online with friends. Original board game by Cole Wehrle, with art by Kyle Ferrin
6 stars 1 forks source link

Localized errors #13

Open foxfriends opened 3 years ago

foxfriends commented 3 years ago

Errors sent from the server look like { code: string, message: string }. Currently when an error is received, the message is toasted to the player. We should instead use the code to look up a localization, and include in the error message any parameters required to fill in the blanks of that localized error message. The existing data property of the response could be used for this purpose ({ error: { code: string, message: string }, data: { ... } })