FAForever / server

The servercode for the Forged Alliance Forever lobby
http://www.faforever.com
GNU General Public License v3.0
67 stars 62 forks source link

Add localization key to notice messages #1000

Open Askaholic opened 7 months ago

Askaholic commented 7 months ago

Notice messages should also include a localization key so that the client can translate the messages into the correct language. This key should be optional and the client should always be able to fall back to the English text field if it receives a notice message with no localization key.

{
    "command": "notice",
    "style": "info",
    "text": "This is some text",
    "i18n_key": "some.text.key"
}

It probably doesn't make sense to add these keys to the notice messages generated by a ClientError as those messages aren't 'supposed to' ever make it to a correctly implemented client. (In practice the protocol isn't quite at the point where that is possible so maybe we want to add this in the future, but lets just start with non ClientErrors for now.