Hello. I am having trouble with my game. I am trying to make a system that changes the language of my game to the users country or selected language on the roblox website. How do I do this?
Get the id with local lnID = game:GetService("LocalizationService").RobloxLocaleId and then just perform a simple check to see if InID is “en-us” and that means the user’s language is English.
local lnID = game:GetService("LocalizationService").RobloxLocaleId
local content = english
if lnID == "en-us" then
content = english -- or perform other function
end
In the top you see the language, but in the bottom there is the location which you can set to any country you want. Is it possible to also get that? I kind of want to use this stuff to make my game different depending on language/country.
Also can I change this to any language, for example it changes a TextLabel to the language?
Yes, you can change the textlabel’s text. Also I think in this case it works for the both Language/Location.
Read out more here: LocalizationService | Roblox Creator Documentation
Please help me with this. How do I make it so it prints the country of the user?
Just use print(lnID) for this.
Edit: for the country, you need to use GetCountryRegionForPlayerAsync.
Language: LocaleID
Country: LocalizationService | Roblox Creator Documentation LocalizationService:GetCountryRegionForPlayerAsync(player)
