Deihim007 Posted July 5, 2017 Share Posted July 5, 2017 Hi people I've been looking for a way to make a Multilingual Resource that you could assign certain dialogs to for example a number. Let's say this a dialog in an external resource: triggerClientEvent(source, "makeMessage", root, "Your username/password was incorrect.", "Login Error") Now i want to assign a ID to this dialog "Your username/password was incorrect." that could be used to call it from Lang Resource. This is all i could figure out , i would really appreciate a solution. with regards Link to comment
Rataj Posted July 5, 2017 Share Posted July 5, 2017 (edited) You can replace string with function, that will return string. Then with use of exports, conditions and tables you can make very reliable multi-language system. Or you can use only tables and identify language by key. Example of second method (using only tables): -- you have to define table with all strings in all supported languages language_strings = { ['EN'] = { "Your username/password was incorrect.", "Login Error", }, ['CZ'] = { "Tvé jméno/heslo je neplatné.", "Chyba při přihlášení", } } -- then you can do this in your function, after you get "lang" variable for example from getElementData triggerClientEvent(source, "makeMessage", root, language_strings[lang][1], language_strings[lang][2]) Edited July 5, 2017 by Rataj Added example 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