GetTranslatorForLocaleAsync/GetLocalizationTableAsync

New Format

Please complete one of the following sentences:
As a Roblox developer, it is currently too hard to . . .
As a Roblox developer, it is currently impossible to . . .

As a Roblox developer, it is currently impossible to get a Translator for a certain language for the cloud localization tables. For traditional, non-cloud localization tables the method GetTranslator can be used to get a translator for a specific language.

If Roblox is able to address your issue, how would it improve your game and/or your development experience? Please be as specific as possible.

Translator objects have a (great!) FormatByKey method to perform translations from scripts. This method throws an error whenever, for example, the Translator cannot find a translation for the given key (this is the case for untranslated languages, but also partially translated ones). This error is expected behavior. Previously I always fell back on the English localization table and presented an English string in the case of translation failures. Because an English Translator cannot be obtained for cloud localization tables at all I cannot present fallback strings anymore.

Something like GetTranslatorForLocaleAsync could help here, which can load a translator for a specific locale. Alternatively, simply GetLocalizationTableAsync that loads the entire cloud localization table into a traditional LocalizationTable would work well in my case too (the latter would allow me to preload all translations from the server too, simplifying the player join process).

7 Likes

Thanks for your feedback. Yes, this is a case we should support, and it shouldn’t be hard to do.

4 Likes

I have the same concerns / issues with cloud / game localization tables and access to their content. Having the FormatByKey method error out is not an option and I have also implemented a wrapper function to return English if there is an error and a finally to return the key if there is no English found for the key. This cannot be done with the current cloud implementation.

At a minimum the GetTranslatorForLocaleIdAsync is needed. The only work around I can see at this point is keep a copy of the cloud file as an embedded file in game for error handling. Obviously, defeating to purpose of going to cloud.

Having both GetTranslatorForLocaleIdAsync and GetLocalizationTableAsync would be great.