FAForever / downlords-faf-client

Official client for Forged Alliance Forever
https://faforever.com
MIT License
197 stars 121 forks source link

Improve localization of server messages #1292

Open Askaholic opened 5 years ago

Askaholic commented 5 years ago

Client issue for FAForever/server#444.

In an effort to improve localization of server events, we should be sending more json descriptions and less English text. Of course this will require the client to handle such messages appropriately.

See the server issue for more details.

1-alex98 commented 5 years ago

The java server has a number for all server error messages, if you do the same we can someday translate then all by number

Askaholic commented 5 years ago

Hm. IDK if I'm a fan of error code numbers, but I can certainly mention them on the github issue if that helps integrate things on the client side.

Brutus5000 commented 5 years ago

Had a recent talk at work with a frontend developer at work. He said rather than a "random" error number, we should just use a unique translation key, as he wouldn't need to add an additional mapping from magic number to translation key. Same applies to the client here. We should use translation keys inside the message (if required then in addition to the error id).

micheljung commented 4 years ago

@Brutus5000 I disagree: error codes are not only very common but also super easy and 100% fail-safe. The same can't be said about translation keys; they're subject to change, call for a naming convention that will always fall short at some point, they're easy to mess up and once they need to be changed for whatever reason, they're API-breaking. Error codes have none of these issues.