Refresh a GUI image after a language change
Figure 10. The selected source is asset:sign_en. French points to the imported French image while English uses the original.
The picker offers assets of the same kind. An image needs an image, a model needs a model, and so on. A matching kind is only the first check: a replacement character model still needs compatible animation, skeleton and attachment setup.
This approach can also be used for suitable imported audio, video, fonts or other resources where the game's loading path uses the translated asset lookup. Always test the specific use. A CSV mapping contains IDs, not the actual image, font or recording.
In this version, an image control can keep the texture it loaded earlier. In the workshop test, the French text appeared while the sign still showed WORKSHOP, including after starting a fresh preview. The mapping itself correctly resolved to the French asset, but that did not rebuild the existing image control.
For the tested GUI image, reapplying its original asset ID through ChangeGUIElementProperty refreshed the image using the current language:
| Action | Values |
|---|---|
| Set Game Language | Language Code fr; Save Player Preference as appropriate. |
| ChangeGUIElementProperty | GUI translation_hud; Element workshop_sign; Property assetId; To sign_en. |
Keep sign_en in that second action. It is the source ID, so the French mapping can select sign_fr. Hard-wiring sign_fr would bypass the useful source-to-language relationship.
