fairyoggy Posted August 20, 2019 Share Posted August 20, 2019 (edited) How do i get player current language layout? For example, a player has an English layout: A message will appear in the chat - English layout If the player switches to another language layout, A message will appear in the chat - other layout Edited August 20, 2019 by slapz0r Link to comment
Scripting Moderators ds1-e Posted August 20, 2019 Scripting Moderators Share Posted August 20, 2019 16 minutes ago, slapz0r said: How do i get player current language layout? For example, a player has an English layout: A message will appear in the chat - English layout If the player switches to another language layout, A message will appear in the chat - other layout Check that. https://wiki.multitheftauto.com/wiki/GetLocalization Link to comment
fairyoggy Posted August 20, 2019 Author Share Posted August 20, 2019 1 hour ago, majqq said: Check that. https://wiki.multitheftauto.com/wiki/GetLocalization but how to get the current language in the user's language layout? Link to comment
Moderators IIYAMA Posted August 20, 2019 Moderators Share Posted August 20, 2019 local messages = { en = { ["welcome"] = "Hi" }, nl = { ["welcome"] = "hoi" } } function getMessageTextById(id, language) return messages[language] and messages[language][id] or messages["eng"][id] or "" end How about you create a global language system? @slapz0r iprint(getMessageTextById("welcome", "nl")) Link to comment
fairyoggy Posted August 20, 2019 Author Share Posted August 20, 2019 7 minutes ago, IIYAMA said: local messages = { en = { ["welcome"] = "Hi" }, nl = { ["welcome"] = "hoi" } } function getMessageTextById(id, language) return messages[language] and messages[language][id] or messages["eng"][id] or "" end How about you create a global language system? @slapz0r iprint(getMessageTextById("welcome", "nl")) I just need to check the current language of the player in his windows(Language bar in windows) For example, initially the user has English - a message will appear - English As soon as you switch to another language, another message will appear Link to comment
Moderators IIYAMA Posted August 20, 2019 Moderators Share Posted August 20, 2019 3 hours ago, slapz0r said: I just need to check the current language of the player in his windows(Language bar in windows) For example, initially the user has English - a message will appear - English As soon as you switch to another language, another message will appear That is more or less a privacy breach. Link to comment
fairyoggy Posted August 20, 2019 Author Share Posted August 20, 2019 36 minutes ago, IIYAMA said: That is more or less a privacy breach. I just tried to make for login panel, for input fields,label which would determine which language is selected in the Windows language bar Link to comment
Moderators IIYAMA Posted August 20, 2019 Moderators Share Posted August 20, 2019 8 minutes ago, slapz0r said: I just tried to make for login panel, for input fields,label which would determine which language is selected in the Windows language bar Yes, I can understand that. But it is not ethical for MTA to implement such a privacy sensitive feature, so I doubt they will add something like that. 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