Here is my code:
protected override void LoadDefaultMessages()
{
lang.RegisterMessages(new Dictionary<string, string>
{
["First"] = "Easy",
["Second"] = "Medium",
["Third"] = "Hard",
}, this);
}
private string Lang(string key, BasePlayer player = null, params object[] args)
{
try
{
return string.Format(lang.GetMessage(key, this, player?.UserIDString), args);
}
catch (Exception ex)
{
PrintError($"Lang Key '{key}' threw exception\n:{ex}");
throw;
}
}When I start playing with phrases in lang file, like edit them several times, adding new ones etc. At some point I have like "cashed state". If I change file like this for example:
protected override void LoadDefaultMessages()
{
lang.RegisterMessages(new Dictionary<string, string>
{
["First"] = "EZ-PZ",
["Second"] = "Not very hard",
["Third"] = "Hard? Huh",
["Extended"] = "Are you really ready for this one?",
}, this);
}I will still have old "Easy"/"Medium"/"Hard" values and all new added phrases displayed like keys ("Extended" instead of phrase itself).
I have tried to remove the old file, unload, reload plugin, it creates new file with new phrases, but still prints old cached ones. Unloading plugin and waiting for some amount of time (not sure what the actual amount is) like an hour maybe more resolves the issue. Figure it out when unloaded trying to fix it and then got some other stuff to do and then came back to test and cache were gone. But not for long, several changes and still same behaviour.
How do I prevent this "caching" at least on develop-test server? It's annoying af to restart it every 5-6 changes I-made to lang phrase...