JanKy Posted April 7, 2017 Share Posted April 7, 2017 Hi guys. I just opened a MTA DayZ Server ( In my language ) and i want to make a setting for english. ( i mean i have translated the inventory and everything ) Any ideas how to implement this script to translate everything? I think about adding a function in every script, for example, in the dayz inventory : if someone choosed english language, the inventory is shown in english, and so on for every script. Any ideas? Thanks in advance ^^ Link to comment
Bananovy Posted April 7, 2017 Share Posted April 7, 2017 I guess everytime when you have to use outputChatBox there should be an "if" to check player's chosen language. if language = "English" then outputChatBox("Something in English") elseif language == "Russian" then outputChatBox("Rush B") end You might also use some tables like this: Language = {} Language.quit = { "You left", -- English has value 1 "Wyszedłeś", -- Second language with value 2 "Any other language"} -- etc. function leaving () outputChatBox(Language.quit[getElementData(localPlayer, "Language")]) end But you have to keep the texts in correct order Link to comment
JanKy Posted April 7, 2017 Author Share Posted April 7, 2017 Umm yea, that's a great idea, ill do it but, is there any script for the language menu? it would be a great start for me Link to comment
Simple0x47 Posted April 7, 2017 Share Posted April 7, 2017 If you wanna do a server with unique systems, don't base yourself with already existing one's. Link to comment
3aGl3 Posted April 7, 2017 Share Posted April 7, 2017 You wont need a language menu, you can use the getLocalization function to get the players selected language. Of course you can also have a language menu but considering you just need a window with a combo box and a text telling the player to select his language... Also, I recommend extending the table with a language key so you can't confuse the order e.g.: language = {} language.en_US.quit = "Quit" language.de_DE.quit = "Verlassen" To get the correct language you probably want to write a wrapper function that handles falling back to English if the players selected language isn't available as well as any string:format stuff. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now