1. Code:
    lang.RegisterMessages(new Dictionary<string, string>
                {
                    {"RaidBlock_NoPerm","No permission."},
                    {"RaidBlock_BeingRaided","Estás a ser raidado por {RaidPlayerName}! "},
                }, this, "pt");
    When I set my game for portuguese language and I join the server, this message still showing in default language (English). I got it for "nl" and "pl" also and it works, just doesn't work for "pt" ..
     
  2. Wulf

    Wulf Community Admin

    The way the Lang API system works in Oxide:
    • A player sets a "language", which can be anything such as kmdwajdkawjdkawdawljdakw
    • The plugins or server owner create language files under oxide/lang that match the "languages" used, such as kmdwajdkawjdkawdawljdakw
    • When a key is called, Oxide searches for that key under each player's language, such as kmdwajdkawjdkawdawljdakw
    • If "kmdwajdkawjdkawdawljdakw" is a folder under oxide/lang with that matching key, then that key is used
    There is no discrimination, Oxide simply looks for a matching folder name. A folder could be named anything and would be used by any players with that folder name set as their language.
     
  3. So its only can be set manually?
    [DOUBLEPOST=1519602516][/DOUBLEPOST]I did how you said, so when I type /o.lang pt should be showing messages under "pt" key, but its still showing default ones (en). Should I restart the server or something?
     
  4. Wulf

    Wulf Community Admin

    How were the "pt" language files installed and when? The "key" would be what you have IN the language file for each plugin. The folder would be named "pt", ex. oxide/lang/pt.
     
  5. Code:
            protected override void LoadDefaultMessages()
            {
                // English
                lang.RegisterMessages(new Dictionary<string, string>
                {
                    {"RaidBlock_NoPerm","No permission."},
                    {"RaidBlock_BeingRaided","You are being raided by {RaidPlayerName}! "}
                }, this, "en");
                
                // Portuguese
                lang.RegisterMessages(new Dictionary<string, string>
                {
                    {"RaidBlock_NoPerm","Sem permissões."},
                    {"RaidBlock_BeingRaided","Estás a ser raidado por {RaidPlayerName}! "}
                }, this, "pt");
                
                // Dutch
                lang.RegisterMessages(new Dictionary<string, string>
                {
                    {"RaidBlock_NoPerm","No permission."},
                    {"RaidBlock_BeingRaided","You are being raided by {RaidPlayerName}! "}
                }, this, "nl");
            }
            #endregion Lang Messages
            
            void Loaded()
            {
                LoadDefaultMessages();
            }
    Yes, pt folder is being created at Oxide/lang, and I type o.lang pt but its still showing in english.
     
  6. Wulf

    Wulf Community Admin

    What do you have the server language set to?
     
  7. English I think
    [DOUBLEPOST=1519604448][/DOUBLEPOST]How I can check it?