When FormatLocalTime is called for the first time with an unknown language, it errors on subsequent calls to the fallback language

If you try to run FormatLocalTime with an unsupported language (i.e. Filipino) for the first call, it errors on any calls to the unsupported language OR the fallback language.

If you run this code first, neither will error:

local time = DateTime.now()

print(time:FormatLocalTime("LLL", "es-es")) -- success
print(time:FormatLocalTime("LLL", "fil-ph"))  -- success, but fallback to english
print(time:FormatLocalTime("LLL", "en-us")) -- success

If you run this code first, both will error:

local time = DateTime.now()

print(time:FormatLocalTime("LLL", "fil-ph")) -- error
print(time:FormatLocalTime("LLL", "es-es")) -- success
print(time:FormatLocalTime("LLL", "en-us")) -- error

This breaks the entire Lua context. If this is executed outside of a play test, it completely breaks studio requiring a full re-launch (and not just exit and open the place).

Repro video:

2 Likes

Thanks for the report! We’ve filed a ticket to our internal database and we’ll follow up when we have an update for you.

5 Likes