Improve localization of server messages
- Dominant language
- Python
- Stars
- 72
- Forks
- 84
- Avg merge
- 5h 11m
- Merged PRs (30d)
- 1
Description
The server sends a number of messages as strings in English. It would be better to send only command representations or maybe localization keys. In some cases the messages might even be moved completely to the client and not sent by the server at all.
For instance if a user is banned, the server will send the client a message like this:
```python
{
'command': 'notice',
'style': 'error',
'text': 'You have been banned from FAF...'
}
```
However it would be better if the server sent something like this and let the client do the localization:
```python
{
'command': 'authentication_failed',
'context': 'ban',
'expiry_date': '2019-06-06 17:13:24.422804'
}
```
Some examples of messages which might be removed completely can be found in `LadderService.inform_player`. The server will send a lengthy explanation of the matchmaker to new players. This message could probably be moved entirely to the client, and not need a server trigger at all.
## Messages
Here are some messages which I suggest we localize in the client:
### High priority:
https://github.com/FAForever/server/blob/51847b7c2f61d1c6e78492b22e3d8b7f798ad1c3/server/lobbyconnection.py#L418
https://github.com/FAForever/server/blob/51847b7c2f61d1c6e78492b22e3d8b7f798ad1c3/server/lobbyconnection.py#L557
https://github.com/FAForever/server/blob/51847b7c2f61d1c6e78492b22e3d8b7f798ad1c3/server/lobbyconnection.py#L631
https://github.com/FAForever/server/blob/51847b7c2f61d1c6e78492b22e3d8b7f798ad1c3/server/lobbyconnection.py#L636
https://github.com/FAForever/server/blob/51847b7c2f61d1c6e78492b22e3d8b7f798ad1c3/server/lobbyconnection.py#L712
Java server code: `119`
https://github.com/FAForever/server/blob/51847b7c2f61d1c6e78492b22e3d8b7f798ad1c3/server/lobbyconnection.py#L716
https://github.com/FAForever/server/blob/51847b7c2f61d1c6e78492b22e3d8b7f798ad1c3/server/lobbyconnection.py#L722
https://github.com/FAForever/server/blob/51847b7c2f61d1c6e78492b22e3d8b7f798ad1c3/server/lobbyconnection.py#L778
### Medium priority:
Java server code: `100`
https://github.com/FAForever/server/blob/51847b7c2f61d1c6e78492b22e3d8b7f798ad1c3/server/lobbyconnection.py#L397
Java server code: `131, 132`
https://github.com/FAForever/server/blob/51847b7c2f61d1c6e78492b22e3d8b7f798ad1c3/server/lobbyconnection.py#L411
Java server code: `107, 108, 126`
All messages in this function:
https://github.com/FAForever/server/blob/51847b7c2f61d1c6e78492b22e3d8b7f798ad1c3/server/lobbyconnection.py#L457
### Low priority:
https://github.com/FAForever/server/blob/51847b7c2f61d1c6e78492b22e3d8b7f798ad1c3/server/lobbyconnection.py#L314
https://github.com/FAForever/server/blob/51847b7c2f61d1c6e78492b22e3d8b7f798ad1c3/server/lobbyconnection.py#L323
https://github.com/FAForever/server/blob/51847b7c2f61d1c6e78492b22e3d8b7f798ad1c3/server/lobbyconnection.py#L692
https://github.com/FAForever/server/blob/51847b7c2f61d1c6e78492b22e3d8b7f798ad1c3/server/lobbyconnection.py#L891
Contributor guide
Assessment
This issue has not been assessed yet.