Let’s say I have prerecorded voices for a characters in my game (this is something I plan), is there a way to detect what someone has put as preferred language on the website trough a script? My point is that if someone has example selected Spanish on the website I would locally replace the voices for the characters into Spanish. If this is possible, how?
I checked and through the use of localization service you can see what language the player selected to be used from the website
print(game:GetService(“LocalizationService”).RobloxLocaleId)
fr-fr
edit: to be more specific, that was an example that used something else other than the default english language, and from further checking, if the player does not restart the game client after selecting another change, the language seen as chosen will not refresh
As Altair said, use game:GetService(“LocalizationService”).RobloxLocaleId
Here’s a list of locale codes for different countries
Thank you both for fast response, we can consider the question as solved.
I need a website like that to get all the language codes. Can you send a link?
I got the screenshot from here, however the table only contains the 5 languages currently supported by Roblox.
http://robloxdev.com/articles/Roblox-Localization-Tools
Edit: I also found this, it might be useful for you. Language Code Table
Aww, I was hoping it would get any language from your pc. Thanks for the table.
I had the genius idea of using a person’s language to determine their location and put a flag next to their name.
An example below is that there are different language codes depending on your location.
If roblox only supports 5 then it looks like this isn’t do-able.
It is possible, they still show what you “belong to”, as seen in studio. Hold on and I’ll give an example.
There’s also this property:
This returns the locale-id of the operating system. It probably works for other locale ids that aren’t supported by roblox.
Then you could use the second table I posted before (Language Code Table)
As you see here
It says “SystemLocaleId nb-no” as I’m Norwegian. So it’s just that you’ll have to figure out how to find it in a game.
I changed my system’s language to canadian english and it works
https://gyazo.com/ac50edc7cdc74306dff5ecf5bf64bd5b
Looks like I’m doing flags.
You can do this through the use of localization services seen above, or in similar manner and probably simpler have the player select their preferred language from an in game popup and save it in their data stores.
Off-topic, but you should make sure not to do this without their explicit consent, since that is privacy-sensitive. Also check the terms of service / rules of conduct to see if you are even allowed to do this.
The TOS is a LONG read, and idk what to specifically look for, but hey look at the table of flags I support so far!
I’ve quickly read trough the TOS to see if @ChuckXZ does anything wrong, and I can’t find anything against it. I mean yeah it’s unfair for some people that want it private but then they can simple just don’t play the game.
Yeah the TOS is really long who would read all of it anyways .
I really like your idea it’s genius!
Just to make your game more comfortable for people who want privacy just make a Setting that they can toggle the Flag On/Off.
If we can get the client’s system language, can we possibly see a future feature to get their location they set on their PC?
Well, I honestly don’t think that’ll be a feature because Roblox value the player’s privacy, and I can promise that if it was a feature it would be abused.
Language settings can be abused in the same way for that reason.
Well, some people choose to have it on English etc, and there’s often more than one country talking a language.