When a player changes their In Experience Language, Roblox automatically changes the language in the game’s UI (Except for the Roblox settings menu, which remains the same). Both the RobloxLocaleId and SystemLocaleId properties also do not change, and no events get fired (GetPropertyChangedSignal)
This leaves me no way of being able to detect locale change and take action accordingly.
Note: I do not expect Roblox to automatically fetch the new localization table for the language I just need to know when the localeId changes!!
I don’t know if it not firing is intended behaviour, but from the announcement when the in-game language switcher was implemented, you are supposed to listen to the translator.LocaleId to change
Doing it this way will give you your intended result
local localizationService = game:GetService('LocalizationService')
local translator: Translator = localizationService:GetTranslatorForPlayerAsync(game:GetService('Players').LocalPlayer) -- wrap this in a pcall for live game use as it can error
local oldLocaleId = translator.LocaleId
print('Loaded game with LocaleId', oldLocaleId)
translator:GetPropertyChangedSignal('LocaleId'):Connect(function()
print('Locale was changed: old locale', oldLocaleId, '- new locale', translator.LocaleId)
oldLocaleId = translator.LocaleId
end)
Hello! Thanks for the post. Would it be possible to try out what @7z99 pointed out? The release of the language switcher should have coincided with the ability to listen to changes for the translator’s localeId for this purpose.
Hello! Seeing as there hasn’t been any activity on this thread for some time, I am going to close this as by design.
My recommendation is to try what cody posted above and see if it suits your use case. If you run into any problems feel free to reopen this post or start a new one. Hope things work out!