ezzzyxs Posted December 30, 2018 Share Posted December 30, 2018 Good day and sorry for my english. Suppose, I want to be able to choose a language if Freeroam. For example: I choose English and all the buttons are in English. I choose another language, the become another. How to do it? Tell me or show, please Link to comment
Moderators Patrick Posted December 31, 2018 Moderators Share Posted December 31, 2018 You need to store translations in a table, like this. -- shared script (You can use this table both on client and server side) languages = { ["exampleTranslateID"] = { ["en"] = "The text.", -- English translate ["de"] = "Der Text.", -- German translate ["hu"] = "A szöveg.", -- Hungarian translate }, } function getTranslate(translateID, languageID) if languages[translateID] and languages[translateID][languageID] then return languages[translateID][languageID] end return "#ERROR" end outputChatBox(getTranslate("exampleTranslateID", "en")) Link to comment
Scripting Moderators thisdp Posted January 1, 2019 Scripting Moderators Share Posted January 1, 2019 (edited) dgs has built-in multi language support This makes it easier for developer to script multilanguage gui with dgs Edited January 1, 2019 by thisdp Link to comment
ezzzyxs Posted January 1, 2019 Author Share Posted January 1, 2019 (edited) 9 hours ago, thisdp said: dgs has built-in multi language support This makes it easier for developer to script multilanguage gui with dgs What the dgs? On 31/12/2018 at 19:06, Patrick2562 said: You need to store translations in a table, like this. -- shared script (You can use this table both on client and server side) languages = { ["exampleTranslateID"] = { ["en"] = "The text.", -- English translate ["de"] = "Der Text.", -- German translate ["hu"] = "A szöveg.", -- Hungarian translate }, } function getTranslate(translateID, languageID) if languages[translateID] and languages[translateID][languageID] then return languages[translateID][languageID] end return "#ERROR" end outputChatBox(getTranslate("exampleTranslateID", "en")) And how can I make a choice of language in freeroam using the example code? Edited January 1, 2019 by ezzzyxs 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