Jump to content

Language layout


fairyoggy

Recommended Posts

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 by slapz0r
Link to comment
  • Scripting Moderators
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
  • Moderators

 

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
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
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
  • Moderators
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...