Some LocalizationService methods take an extreme, unreasonable, amount of time to execute in Studio (>10 seconds)

In Studio, both LocalizationService:GetTranslatorForLocaleAsync and LocalizationService:GetTranslatorForPlayerAsync take upwards of 10 seconds to execute. This occurs regardless of whether the method was recently executed with the same arguments or not. The following code example can reproduce this issue, taking ~10 seconds for each method call:

local localisation = game:GetService("LocalizationService")
local c = os.clock()
localisation:GetTranslatorForLocaleAsync("en-us")
warn("Time taken (english): "..os.clock()-c)

local c = os.clock()
localisation:GetTranslatorForLocaleAsync("en-us")
warn("Time taken (english again): "..os.clock()-c)

local c = os.clock()
localisation:GetTranslatorForLocaleAsync("es-es")
warn("Time taken (spanish): "..os.clock()-c)

In a live experience, this does not occur. Both on the client and on the server, running each of these methods takes, at most, roughly one second from my personal tests. One second is still quite unreasonable for what in my case is just a single localisation entry but it is much more reasonable than a ten second yield. In a live experience, results also appear to be cached, unlike Studio which yields for 10 seconds regardless of whether the result should be cached or not. This has led me to believe that perhaps both methods just have a guarenteed 10 second yield for some reason.


It’s also worth noting that, when downloading them, the CSV form of my translations appears to be incorrect; essentially being a blank table with only column headers, which could be related to this issue. However, this yiedling bug occurs even on some of my other experiences which do not contain any localisation entries.


Beta Features:
I have all beta features except “Next Gen Explorer” and “CreateAssetAsync Lua API” enabled.

Expected behavior

I expect a much more reasonable execution time than 10 full seconds.

A private message is associated with this bug report

3 Likes

This is happening to my team too. It’s not only taking 10 seconds for us but the translator returned doesn’t have our localization keys in it which results in errors when calling FormatByKey. This started happening yesterday, at first it was only happening to a few of us but it started happening to me after I restarted studio. Before, the function call took 0.000018s now its taking 10.029s.

I hope that this can be resolved soon, because the localization keys missing results in our UI being unusable while Studio testing.

Thanks for the report; We’ll follow up when we have an update for you!

1 Like

Hey @Abcreator , thanks for reporting the issue. This bug should be fixed now - could you try again on your end?

1 Like