1. Hi all,

    I have started making a menu mod, but this will add a lot of Lang files and to make it easier on users I would like to be able to separate it out into separate files, is this possible or would I have to make it a standalone mode to achieve this?

    Regards

    Alpha
     
  2. Wulf

    Wulf Community Admin

    Yes, the Lang API is made for multiple language files, so if you're globing them all together, you're using them wrong. ;)

    Take a look at pretty much any of my recent plugin updates such as Slap, PlayerList, etc.
    Resources from Wulf | Oxide
     
  3. Thanks Wulf, I think you might have misunderstood what I was asking, I am looking to see if Lang can be structured to something similar with Datafiles, I ask as my menu will have lines allowing for customer text entry and I wanted to know if I can store it in a separate file (like my data files), or event just separate it internally like example below.
    Code:
    {
        menu{
            message1: bla
            message2: bla
            message3: bla
        }
        chat{
            message1: bla
            message2: bla
            message3: bla
        }
    }
     
  4. Wulf

    Wulf Community Admin

    I don't think you can nest, it uses keys only. Just give the keys descriptive names.
     
  5. All language files created/maintained/used by the Lang API use a Dictionary<string, string> so nesting isn't possible, you can however just alter the names of your keys to something like this:
    Code:
    {
        "menu-msg1": "bla",
        "menu-msg2": "bla",
        "menu-msg3": "bla",
        "chat-msg1": "bla",
        "chat-msg2": "bla",
        "chat-msg3": "bla",
    }
     
  6. Thanks Mughisi, I thought I might have to do that. :)