Localizing Non-Text Instances
Localizing Non-Text Instances
In special cases, it may be necessary to localize a non-text instance such as an image used for a shop sign or a spoken audio clip. In this case, unique assets for each supported language can be used.
Translation Module
The following module fetches any translation from the localization portal and uses error handling to catch potential failures from the web-based Translator APIs. To use it in your game:
- Create a new
ModuleScriptwithinReplicatedStorage. - Rename the new script TranslationHelper.
- Copy the following code into the script.
sourceLanguageCode on line 9 to a fully-supported language code which matches the game's source language setting in the localization portal (please refer to the reference table below).
Language Code Reference »
The following table outlines the languages currently supported in the localization portal. Those highlighted in yellow are fully supported by the Roblox platform/applications.
| Language Code | Language | |
|---|---|---|
| de | German | Deutsch |
| en | English | English |
| es | Spanish | Español |
| fr | French | Français |
| jp | Japanese | 日本語 |
| ko | Korean | 한국어 |
| pt | Portuguese | Português |
| zh-hans | Chinese (Simplified) | 中文(简体) |
| zh-hant | Chinese (Traditional) | 中文(繁體) |
| bg | Bulgarian | български |
| bn | Bengali | বাংলা |
| bs | Bosnian | босански |
| cs | Czech | Čeština |
| da | Danish | Dansk |
| el | Greek | ελληνικά |
| et | Estonian | Eesti |
| fi | Finnish | Suomi |
| hi | Hindi | हिन्दी |
| hr | Croatian | Hrvatski |
| hu | Hungarian | Magyar |
| id | Indonesian | Bahasa Indonesia |
| it | Italian | Italiano |
| ka | Georgian | ქართული |
| kk | Kazakh | қазақ тілі |
| km | Khmer | ភាសាខ្មែរ |
| lt | Lithuanian | Lietuvių |
| lv | Latvian | Latviešu |
| ms | Malay | Bahasa Melayu |
| my | Burmese | ဗမာစာ |
| nb | Bokmal | Bokmål |
| nl | Dutch | Nederlands |
| fil | Filipino | Filipino |
| pl | Polish | Polski |
| ro | Romanian | Română |
| ru | Russian | русский |
| si | Sinhala | සිංහල |
| sk | Slovak | Slovenčina |
| sl | Slovenian | Slovenski |
| sq | Albanian | Shqipe |
| sr | Serbian | српски |
| sv | Swedish | Svenska |
| th | Thai | ภาษาไทย |
| tr | Turkish | Türkçe |
| uk | Ukrainian | україньска |
| vi | Vietnamese | Tiểng Việt |
Gathering Asset IDs
To implement localized assets, you should first gather the asset ID of each version, for instance:
| English (Source) | Spanish (es) | Portuguese (pt) |
|---|---|---|
| rbxassetid://2957093606 | rbxassetid://2957093671 | rbxassetid://2957093727 |
![]() |
![]() |
![]() |
Key and Translations
Instead of supplying string translations within the .csv spreadsheet or localization portal, enter the asset ID of the corresponding asset. Remember to also supply a Key value for lookup within the LocalScript outlined in the next section.
| A | B | C | D | E | F | G |
| Key | Context | Source | Example | es | pt | |
| Key_JewelsImage | 2957093606 | 2957093671 | 2957093727 | |||
Script Implementation
Before proceeding, confirm that:
- The TranslationHelper script is located within
ReplicatedStorage. - A .csv spreadsheet is uploaded to the localization portal containing a “Key_JewelsImage” key and a valid asset ID associated with each localized image.
articles/localization portal additional features#upload-csv-file|here.
Now copy the following code into a new LocalScript. Since this tutorial deals with GUI images, the script can be placed within StarterGui.
Playtest your game in Studio as outlined articles/game testing#player-emulator|here and the correct image should appear for the configured languages/images.