Jump to content

getLocalization()


MAB

Recommended Posts

Posted

getLocalization

code : The language code (eg. "en_US" for "English (United States)" or "ar" for "Arabic").

name : The name of the language (eg. "English (United States)" or "Arabic").

This function gets the MTA general language on the player's PC?

How i know these language codes or name? am i magician?

and what does ["code"] mean?

local languageCode = getLocalization()["code"] 

You can find me here.

  • Moderators
Posted

Calling/executing the function getLocalization will return a table.

A table is an object that can hold multiple data.

To get data from a table you must index a table. This means searching inside the table using a value/object/something else, which leads or doesn't lead to data inside the table.

This is how you search inside a table[key]. Between those brackets you give the index/key of the data you want to receive. They key in your example is the string "code".

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

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...