How to get the player language (experience language)

Hello, I have a problem:

  1. What do you want to achieve? Keep it simple and clear!

I want to create a variable that return the player’s used language on experience

  1. What is the issue? Include screenshots / videos if possible!

So I tried to search everywhere and didn’t found any answer.

RobloxLocaleId and SystemLocaleId do not have the expected behavior I am looking for.

I want to get the language that the player set to the experience, not his account nor his operating system.

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I tried RobloxLocaleId and SystemLocaleId but they do not have the expected result, none of them return the language used at the experience by the player. Note: I used a script client-side.

Here are the results I got:

I set my experience language to german.

RobloxLocaleId returned “fr-fr”
SystemLocaleId returned “en-us”

I want the script to return me “de-de” or “de” or “deutch” on this particular case.

Is there any way to do it?

3 Likes

Here a screenshot of the setting I am talking about.

1 Like

Use this maybe:

2 Likes

I already tried this page, this do not solve the problem.

2 Likes

Then it’s impossible. I checked UserSettings() documentation and it also doesn’t have anything relating to experience language.

I found this topic, should give it a read:

2 Likes

So I guess there is no solution about it… It’s weird roblox never though of doing this…

There is a way:

--!strict

local Players = game:GetService("Players")
local LocalizationService = game:GetService("LocalizationService")

local translator: Translator = LocalizationService:GetTranslatorForPlayer(Players.LocalPlayer)

local function onLocaleIdChanged(): ()
	print(translator.LocaleId)
end

onLocaleIdChanged()

translator:GetPropertyChangedSignal("LocaleId"):Connect(onLocaleIdChanged)
1 Like