Screenshot of the reported locales in the developer console in a live server on desktop.
The issue with SystemLocaleId is specific to live servers only. When in Studio, it is correctly reported as "en-gb". RobloxLocaleId is always reported as "en-us", even in Studio. In Studio, this can only be corrected by setting a custom locale in the Player Emulator widget.
Screenshot of the correctly reported SystemLocaleId (and incorrect RobloxLocaleId) in Studio.
Expected behavior
I would expect my SystemLocaleId to accurately report my system locale in-game. On both my phone and computer this is set to "en-gb".
I would also expect my RobloxLocaleId to be reported as "en-gb" if my Account Location is set to “United Kingdom” and Language is set to “English.”
I should add that this is important because incorrectly reported locales means using methods such as DateTime::FormatLocalTime in conjunction with the reported RobloxLocaleId or SystemLocaleId result in incorrectly formatted dates and times:
Screenshot of an in-game date and time widget displaying the real world local date and time, but it is incorrectly formatted.
The date and time in the above screenshot were formatted using the following snippet:
-- ClockWidget.client.luau
local now = workspace:GetServerTimeNow()
local localTime = DateTime.fromUnixTimestamp(now + ((offset - 1) * 3600))
Date.Text = localTime:FormatLocalTime("L", LocalizationService.SystemLocaleId)
Time.Text = localTime:FormatLocalTime("LT", LocalizationService.SystemLocaleId)
If SystemLocaleId was reported correctly, the date and time should be formatted correctly as "18/04/2024 | 11:41", as can be seen in Studio:
Screenshot of the same date and time widget running in Studio with correctly formatted values.