1. Would not it be possible to make several variable ( all languages available) everything ets send variable in config and it would be enough to put right or wrong on only one language , the one that have desire and this result has the config lang folder change different language ?
    I am student in programing I'm only on C and C ++ commenced on so it may be impossible with the API rust but here is an idea x )
     
  2. Wulf

    Wulf Community Admin

    Just register it like you would English, passing the language code as variable instead of assuming the default.

    Don't quite understand all of what you're saying there, but you can generate as many language files as you want already.
     
  3. It is not possible to make bool variable available for each language and having to true only that which one desires , so I imagine it's work for not much seen people used to translate of themselves
     
  4. Wulf

    Wulf Community Admin

    I have no idea what you are saying there.
     
  5. I just need take idea for @Austinv900 so i think i told stupidity x) so in global idea, generate variable on config file eng fr ita etc etc and you can choose true only one language for the plugins use only this lang (I think my "English" is better than transalate for this ^^)
     
  6. Wulf

    Wulf Community Admin

    You can generate language files via the plugin or make them manually, then set which language to use via the server or per player.
     
  7. Yes, but if I understand Austinv900 he wanted a plugin that automatically generates the language use or leave the servers then change the language of plugins with a variable I do not know
     
  8. Wulf

    Wulf Community Admin

    Each plugin can already do that, that's already how it is setup.
     
  9. @Austinv900 you have your ask now x)
     
  10. oops. Fell asleep.

    anyways for example @Wulf
    Code:
            #region Localization        void LoadDefaultMessages()
            {
                lang.RegisterMessages(new Dictionary<string, string>
                {
                    ["Online"] = "<color=#a100ab>{0}</color> has come <color=#00c30d>{1}</color>",
                    ["Offline"] = "<color=#a100ab>{0}</color> has just went <color=#C90000>{1}</color>"
                }, this);
            }        #endregion
    I know this generates an en lang file. How would I make it so when my plugin loads it generates a en and lets say a fr also? I don't believe oxide auto translates. Or are the lang files not used they way I think they are. (Giving players a translation based on location)
     
  11. Wulf

    Wulf Community Admin

    Code:
            #region Localization        void LoadDefaultMessages()
            {
                lang.RegisterMessages(new Dictionary<string, string>
                {
                    ["Online"] = "<color=#a100ab>{0}</color> has come <color=#00c30d>{1}</color>",
                    ["Offline"] = "<color=#a100ab>{0}</color> has just went <color=#C90000>{1}</color>"
                }, this, "fr");
            }        #endregion
    Translation is handled by developers or users. You could easily make a plugin that sets their language automatically based on the assumption that they speak the language where their IP is from, otherwise players can select using the /lang chat commmand.
     
  12. So I gave that a test

    Code:
    void LoadDefaultMessages()
            {
                lang.RegisterMessages(new Dictionary<string, string>
                {
                    ["Online"] = "<color=#a100ab>{0}</color> has come <color=#00c30d>{1}</color>",
                    ["Offline"] = "<color=#a100ab>{0}</color> has just went <color=#C90000>{1}</color>",
                    ["Connected"] = "<color=#00c30d>Online</color>",
                    ["Disconnected"] = "<color=#C90000>Offline</color>"
                }, this, "en");            lang.RegisterMessages(new Dictionary<string, string>
                {
                    ["Online"] = "<color=#a100ab>{0}</color> llegó <color=#00c30d>{1}</color>",
                    ["Offline"] = "<color=#a100ab>{0}</color> Se acaba de ir <color=#C90000>{1}</color>",
                    ["Connected"] = "<color=#00c30d>conectado</color>",
                    ["Disconnected"] = "<color=#C90000>Desconectado</color>"
                }, this, "es");
            }
    then I had my players change their /lang setting and they are still seeing it in english any thoughts?
     
  13. @Cataclysme Ill add french support now if you want to translate the message is
    Code:
    PLAYERNAME has come OnlineandPLAYERNAME has just went Offline
     
  14. This is sentence do not want to say much hcose in French with translation corecte , I know not what you mean exactly in this sentence , but if not there , playername Just connect from COUNTRY (PLAYERNAME Vient de se connecter depuis COUNTRY)
     
  15. So Hey @Wulf I cant seem to make it work.

    I mean its not really that important right now just thought it would be nice

    Code:
           void LoadDefaultMessages()
            {
                lang.RegisterMessages(new Dictionary<string, string>
                {
                    ["Online"] = "<color=#a100ab>{0}</color> has come <color=#00c30d>{1}</color>",
                    ["Offline"] = "<color=#a100ab>{0}</color> has just went <color=#C90000>{1}</color>",
                    ["Connected"] = "<color=#00c30d>Online</color>",
                    ["Disconnected"] = "<color=#C90000>Offline</color>"
                }, this, "en");            lang.RegisterMessages(new Dictionary<string, string>
                {
                    ["Online"] = "<color=#a100ab>{0}</color> se ha <color=#00c30d>{1}</color>",
                    ["Offline"] = "<color=#a100ab>{0}</color> Se acaba de <color=#C90000>{1}</color>",
                    ["Connected"] = "<color=#00c30d>conectado</color>",
                    ["Disconnected"] = "<color=#C90000>Desconectado</color>"
                }, this, "es");
            }        [Command("testlang")]
            void cmdTestlang(IPlayer player, string command, string[] args)
            {
                //server.Broadcast(Lang("Online", null, player.Name, Lang("Connected")));
                player.Reply(Lang("Online", null, player.Name, Lang("Connected")));
            }
     
  16. Nevermind @Wulf I figured it out. Silly me wasn't running the player through lang.

    Thanks @LaserHydra
     
  17. Hi !

    I want to do the translation of plugins in French but i have some questions:

    -If i change the lang file to XXX.fr.json it's ok or not ?
    -What can i do for select fr.json or en.json ?
    -If i have the both files, they can use together ?
    -How players can select his prefer lang ?

    I think that's all...

    Thanks, and sorry for the last time talking in french in the forum with FR members idk it's prohibed
     
  18. Wulf

    Wulf Community Admin

    Merged your thread with the last one from when you asked previously.
    1. Don't rename the .en.json file, make a new .fr.json file instead
    2. You can set the server-forced language using the 'lang xx' (xx being the country code)' console command
    3. Only the language you set is used if it is available, not both
    4. Players can select their own language preference using the '/lang xx' (xx being the country code)' chat command
     
  19. Ohwww the last thead was cretaed by mc olleague and i'm alone now, so.

    Oh ok so if i understand, each players can play with a different lang file if i do the translation of X language ?

    It's... wonderful xD

    Good job for that :O , so, now, for the translation i will share lang.fr.json and not lang.en...
    The last question: Idk if you see an exemple of my work, but for the config file i add a lot of comment for each function a plugin can have. eg: You can set the multiplier between 0 and 1 and use decimals eg 0.2 (it's just an exemple)

    It's normal but for compile, the config file will be transform for the default config file
    Maybe you have an idea for deativated this (maybe xD) or modify my comment:

    Code:
    "Exemple": [ //Ceci est une variable
       "This is an exemple", // Ceci est le contenu d'une variable
    ]
    Thanks you :D
     
  20. Wulf

    Wulf Community Admin

    You can't add comments in the config file like that.