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
Organizing/nesting lang files?
Discussion in 'Rust Development' started by Alphawar, Nov 20, 2016.
-
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 -
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 } } -
Wulf Community Admin
I don't think you can nest, it uses keys only. Just give the keys descriptive names. -
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", } -
Thanks Mughisi, I thought I might have to do that.
