network: clients should send localisation to host - for localised messages
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
widelands |
Confirmed
|
Medium
|
Unassigned |
Bug Description
Currently messages by the host are translated on host side using the hosts localisation.
First i thought we should create a table with id's an messages so the host would only send the id and the clients would read the matching message from the list and translate it. Anyway this has two disadvantages:
1. The code gets less readable and you would have to search through the list every time you want to check what kind of message the host sends at a specific place
2. If host and client use a different version (might be even if only slightly), the list may be incomplete and therefor some messages would not be translateable - e.g. if a new "sorry you use a different version, you can not play on this server" message would be added ... ;)
Therefor it's perhaps a good idea to save the localisation of all clients on host side, translate the messages (if possible) on host side and send the translated messages to the clients. if the clients use different localisation and a message is system wide, the host should keep the message in english.
Regarding 1, using enumeration might help. You would still have a table of messages, but the source code would look something like send_message( player_ joined) instead of send_message(3). It doesn't solve problem 2, though.
Have we discussed this issue before in another bug report or something? (It seems familiar for some reason)