I’m just wondering what one would do in the case that localizationService:GetTranslatorForPlayerAsync fails (returns an error due to (likely) server issues)? The docs say that the method can fail, but not how one would go about handling the failure correctly.
Do I just use GetTranslatorForPlayer instead of the asynchronous version? I’m debating on whether or not this is the way to go because the docs say “This function is deprecated and should not be used in new work” underneath the related method section under GetTranslatorForPlayerAsync even though it doesn’t have the deprecated tag.
This is just an exestack snippet example I made (sorry for the bad formatting I wrote this here, this can be tested by anyone)
--@getTranslator/${player}/${doWhatever}
local success, translator = pcall(function()
return localizationService:GetTranslatorForPlayerAsync(${player})
end)
if not success then
warn("Failed to get the Player's Translator, Message:", translator)
else
${doWhatever}()
end
Yes I understand you’re supposed to wrap it in a pcall, but what do you do in the case of it failing? How are you supposed to obtain translated strings in that case?
I didn’t mention it because I guess I thought it was common sense to use a pcall when methods can error.
What should happen in the case of an outage and the max retry threshold is reached? That’s basically all I need to know, what do I use in case of the translator strictly not being available?