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 )
Solved Translating plugin messages?
Discussion in 'Rust Discussion' started by Cataclysme, Jul 7, 2016.
-
Wulf Community Admin
-
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
-
Wulf Community Admin
-
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 ^^)
-
Wulf Community Admin
-
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
-
Wulf Community Admin
-
-
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
-
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
-
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"); }
-
Code:PLAYERNAME has come OnlineandPLAYERNAME has just went Offline
-
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)
-
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"))); }
-
Nevermind @Wulf I figured it out. Silly me wasn't running the player through lang.
Thanks @LaserHydra -
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 -
Wulf Community Admin
- Don't rename the .en.json file, make a new .fr.json file instead
- You can set the server-forced language using the 'lang xx' (xx being the country code)' console command
- Only the language you set is used if it is available, not both
- Players can select their own language preference using the '/lang xx' (xx being the country code)' chat command
-
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 ]
-
Wulf Community Admin