TShock
TShock copied to clipboard
Soft coded strings
Suggestion from Newy on Slack: user strings should be customizable in a config file so that we don't have language debates like in https://github.com/NyxStudios/TShock/commit/c4cf2d496ddd1dc871be77a861a793d78dd77da2.
I support this. Even with Orion, we're going to still have a shit load of soft coded strings of some form or another sitting in TShock. I think it's within scope.
Comments from @WhiteXZ:
Use a resources file. They exist for a reason Do it properly if at all
Disclaimer: I don't know what he's saying/how to do/etc.
Issue has also been made for Orion. More details about resource files: https://msdn.microsoft.com/en-us/library/7k989cfy(v=vs.90).aspx
x-link https://github.com/NyxStudios/Orion/issues/39
I'd like to stress that the original suggestion was for user configurable strings. If resx files aren't user configurable we have two issues here and need to split them up.
professorx [10:05 AM]
Yea I know. Tho as stated earlier those files aren't that readable People will most likely get lost somehow
(on resx files)
If the goal of this issue is to make files user configurable only, then there is no problem. Resx are modifiable, no issues there either. There are no other issues @nicatronTg, you only got confused a bit by the misunderstanding that happened in Slack, sorry about that. I see you already mentioned what I said, so the only thing I'd like to discuss further is the implementation. Whether we will stick to resx, use a JSON file etc. Cc @WhiteXZ
Marking this as blocked because it's a major project that should be re-raised when there's less important thinks that need work
I'm always eager for this as i born in a non-english speaking country. Any implementation is ok, they are same in essence and effect. I'm willing to do this but the hardest part for me is the keywords of strings. My english level is far from the requirement of naming them well.
@AxeelAnder happy for this to go ahead - probably via a json key/value store. if you're willing to champion it then we can organise assistance with keywords
I converted almost every string concatenation into format for the convenience of next step.
Is it ok to modify il instructions to achieve the goal? It's relative easy compared to soft coded string(no need to make keys and replace hardcoded strings with it).
I can maintain a repo that contains all strings need to customize, everybody can use a patcher to generate a customized version.
Preference would be for a json keystore simply so the end user is able to modify on the fly with ease