fix: /help, /me, and /p commands can't work in non-English languages
When TShock runs in a non-English language, vanilla commands prefix will be localized.
eg.(Chinese) /help (English command prefix) => /帮助 (Chinese command prefix)
TShock.OnChat cannot correctly handle vanilla command prefixes
e.g.(Chinese) When a player use /help, TShock will execute /帮助 (causing the command to not be found).
Invalid command entered. Type /help for a list of valid commands.
This PR add EnglishLanguage.GetCommandPrefixByName to get English vanilla command prefix.
Solve #2914
Could someone review this PR?
Can someone else look at this too?
This is requesting the enUS locale as set earlier https://github.com/Pryaxis/TShock/blob/0b6bf9ef4050f39f468d6782ea2992d8ce82e8bb/TShockAPI/Localization/EnglishLanguage.cs#L50
I guess the Clear was done for similar reason like my implementation (but I did set the _localizedCommands back after)
https://github.com/sgkoishi/yaaiomni/blob/debf82951dd84bd307fc7bce06a1c03160479976/Core/Enhancements.cs#L129
Can someone else look at this too?
I would, but I don't understand the issue very well.. Can you ELI5 what is wrong?
Can someone else look at this too?
I would, but I don't understand the issue very well.. Can you ELI5 what is wrong?
Terraria will translate chat commands into command id. TShock translate them back to keep the command working.
However, when the server and the client have different locale, a enUS player send /help will be sent as CommandId: Help and a deDE server will translate it back to /hilfe, thus the command is broken.