In the course of #5387, this patch groups all ingame chat in separate classes, removing all chat globals and localizing functions, defragmenting code.
It moves all JS code from XML files to JS.
It uses JS to register the global hotkeys instead of XML mock objects using rP22851/D2260.
Communication between the different classes is performed by using a simple subscription system similar to the one in rP22985/D2310.
This way mods can insert event handlers and thus have a greater chance of not having to overwrite / modify existing code but adding a hook instead.
Also it means that there is stronger separation of concerns, since one class doesnt have to hardcode logic of some other area of code.
For example when the filter or addressee dropdown selection changes, it doesnt have to hardcode which other GUI obejcts have to be updated.
The chat messages are split into several classes, so that the classes can have their own helper functions and helper objects storing strings without resorting to globals.
Notice that "/team" chat was deleted due to lack of a use case.
The hotkey already directs to /allies since last-man-standing mode integration, and the dropdown item isnt present in the current code either.
Notice that this code now supports changing the language during the game by using markForTranslation in the JS objects storing strings that are initialized only once.