1. +1 here.
    Was the same problem some time ago.... Fixed itself after few restarts o_O
    Also, I can confirm that it's not wild spread - over plugin on my server was changing fine, and this one in particular was changing find on another server, so.... I think it's bug that almost impossible to trace...
     
  2. When it will be fixed, Wolf? With every change in lang file I should restart the server, wtf?!
     
  3. Wulf

    Wulf Community Admin

    When it can be reproduce by us and a fix found.
     
  4. It's global problem. This can be confirmed by any rust server administrator.
     
  5. Wulf

    Wulf Community Admin

    Just tested, no issues. Made a change to one of the lang files in a plugin, reloaded the plugin, tested the message and it showed just what I changed it to.
     
  6. To all who have this issue, how does the plugin load the language file?
    As in, what hook do you use for the reloading? And please give some full examples, not those cryptic ones.. :p
     
  7. Wulf

    Wulf Community Admin

    Hooks aren't used for reloading, so I'm not sure what you're asking there.

    If a plugin uses the Lang API, they generally would register the default messages which then Oxide would use that to create the file for the languages they have set in the plugin. Default would be en, but other languages can be added via the plugin's code or by a user manually. I've tested both default generated languages as well as manually added languages and haven't reproduced the issue.
     
  8. Perhaps I worded it wrongly.
    What I meant is, how do they load strings from disk? I assume they use a hook to initiate the loading of language strings.
     
  9. Wulf

    Wulf Community Admin

    No, Oxide handles the loading of messages for a plugin. All plugins do is register default messages, but even that isn't a requirement. Generally default messages a registered in English (en), and then other languages are added manually (not from within the plugin) in addition to the default.
     
  10. Makes sense.
    Got confused by some implementations I have seen. :)
    Building a little shitty test now to see if I experience the same.
     
  11. Wulf

    Wulf Community Admin

    You could register messages inside of any hook, so that’s one thing that varies that you may have seen. Some developers have their own setup for how it looks in the plugin too, but it still registers them the same way in the end.
     
  12. I've seen some weird-ass json monstrosities etc.
    Nothing really as simple as this (Until today)
     
  13. I seem to not have the issue on my side.
    The only issue I noticed is that, when I update the json files, I need to reload the plugin.

    Snippet used:
    Code:
    using System.Collections.Generic;namespace Oxide.Plugins
    {
        [Info("LangTest", "ThibmoRozier", "1.0.0")]
        [Description("A shitty test")]
        class LangTest : RustPlugin
        {
            void Loaded()
            {
                lang.RegisterMessages(new Dictionary<string, string> {
                    ["Test One"] = "This is a text",
                    ["Test Two"] = "This is another text",
                    ["Test Three"] = "This is yet another text" // First test was without this var
                }, this, "en");
            }        [ConsoleCommand("showlang")]
            void ShowLangCallback(ConsoleSystem.Arg arg)
            {
                string origLang = lang.GetServerLanguage();
                string msg1, msg2, msg3;            lang.SetServerLanguage("en");
                msg1 = lang.GetMessage("Test One", this);
                msg2 = lang.GetMessage("Test Two", this);
                msg3 = lang.GetMessage("Test Three", this);
                Puts($"Eng:\r\nmsg1 = {msg1}\r\nmsg2 = {msg2}\r\nmsg3 = {msg3}\r\n");            lang.SetServerLanguage("ru");
                msg1 = lang.GetMessage("Test One", this);
                msg2 = lang.GetMessage("Test Two", this);
                msg3 = lang.GetMessage("Test Three", this);
                Puts($"Rus:\r\nmsg1 = {msg1}\r\nmsg2 = {msg2}\r\nmsg3 = {msg3}\r\n");            lang.SetServerLanguage("lt");
                msg1 = lang.GetMessage("Test One", this);
                msg2 = lang.GetMessage("Test Two", this);
                msg3 = lang.GetMessage("Test Three", this);
                Puts($"Lit:\r\nmsg1 = {msg1}\r\nmsg2 = {msg2}\r\nmsg3 = {msg3}\r\n");            lang.SetServerLanguage(origLang);
            }
        }
    }
    
    Result:
    SC_NoIssue_Lang.png
     
    Last edited by a moderator: Dec 20, 2017
  14. Wulf

    Wulf Community Admin

    That’s as designed. The messages would have to be reloaded.
     
  15. I have the same problem if i change something in lang/en/*.json.

    But only with chat messages. Text in UI change after Plugin reload immediately. Text in chat messages change only after server restart.
     
  16. Could you provide more info? :)
     
  17. Unfortunately not. I can only say that everything that is changed in /lang/en is taken over after a plugin restart directly at the CUI. Everything that is played in the chat is only updated after a server restart. I have no errors in the console or in the logs.

    I will continue to try to narrow down the errors.
     
  18. Maybe there is a difference in how the plugin retrieves those messages? (Loads them to a field/fields)
     
  19. Wulf

    Wulf Community Admin

    Oxide loads the messages, but the messages are the same for every plugin in how they get called.
     
  20. Getting them to share some code for reference would be useful.. :I
    But I understand what you mean, @Wulf. I was just thinking that it might be the plugins themselves that are screwing up here, not Oxide.