If Roblox adds run time localization, this should not be used because that implementation probably will involve using LocalizationService.RobloxLocaleId and proper changing of auto localizated text.
One of the problems I have with the current languages on Roblox is I have gotten offers and paid translators to do unsupported languages, like Russian, Latvian, Swedish, Finnish, and Korean. I have no way of testing them in-game to make everything looks good, and if the assets are showing up. Since no one else made a language changer, I decided to make my own.
How It Works
The biggest problem with making a language changer is LocalizationService.RobloxLocaleId read only. I could make my own localizer, but that would be hard because of the amount of logic required for regular expressions and picking what phrases to use. Not to mention the resource cost when changing languages. I discovered a pretty cool hack to get Roblox to change the localized language.
- Get the localization tables used (parented to LocalizationService and set by RootLocalizationTable.
- Divide all the entries of the tables as if they were separated tables.
- Set the translated languages to the LocalizationService.RobloxLocaleId. This even works when translated the same language, like en-us -> en-us. The tables can be re-parented to change the language, as well as changing the RootLocalizationTable.
There are some limitations with this system. The limitations include:
- There is no out of the box core GUI localization.
- LocalizationService.RobloxLocaleId still doesn’t change. Scripts require using a value named “CurrentLanguage” value inside the script when run.
- It relies on the current setup of frames in the chat. Renaming the frames will result in it not working. It does work with FearMeIAmLag’s Emoji Suite, a fork of the chat system.
- The chat transparency isn’t directly linked to the localization list. I couldn’t figure out a way to get around it without forking the chat script.
- There may or may not be a few missing languages. I used a script to parse the list of languages that Microsoft supports, but only did 2 character and 5 character codes. (Please PM me or post in this case).
- Referencing LocalizationTable references may not work as intended because they change.
- Adding/removing entries at run time is not supported.
- Checking if the RootLocalizationTable matches a certain value (another table) will break.
Screenshots from Roblox Battle (2018 Edition)
Once I get other languages added, I will post more pictures to show it working for non-supported languages.
Spanish (played as English):
French (played as Spanish):
Portuguese (played as French):
Korean (played as English):
Swedish (played as English):