I’m trying to follow the guides and api to start implementing localization on an app I’m working on, but I don’t seem to be able to even get it to work in the editor.
I’ve gone through this quick start guide - Quick Start Guide | Localization | 1.3.2 to get the flag icons to change, yet they don’t.
I’ve copied the dropdown from the sample scene and that works for selecting the languages, and I can see the inspector showing the different sprites I’ve set, but in both the scene view and the game view nothing changes.
Is there something basic missing from this guide that I need to do as well?
I’m just getting slightly-dangerous with localization, having used it a few times now, but I’ve never localized assets, only text.
So… just now I went and set up a quick asset loc table, with two locales.
Here’s what I suggest you do:
Ensure your textures are imported as sprites AND that they are Single, or at least that they did create a sprite. The annoying version of Unity I use right now defaults sprites to Multiple and then cuts nothing out, which is pure silliness compared to how sprite texture imports used to work. This change in sprite texture import is incredibly disruptive to ALL 2D workflows.
Start super simple, make an asset table with two flags for two locales, put them in a simple “Flags” asset table, and make sure you drag the Sprites from your images in , NOT the textures. It seems to simply fail silently if you drag textures in, since the UI.Image will want a sprite.
Make sure your textures are imported as sprites:
Then right-click the top line of the UI.Image and select Localize to trigger everything to be hooked up:
Finally go hook up the loc entry you want (This LocalizeSpriteEvent is ON my UI.Image object after I selected Localize from context menu above):
And as always, pull up the Window → Asset Management → Localization Scene Controls to test.
Test by selecting your locale from that Localization Scene Controls window:
1 Like
Thank you!
I had tried it with a simple text string as well, and was having the same problem. Doing it the way you suggested has worked for both text and images now.
The directions they give in the guide is to turn on “Track changes” in the Scene Controls, then apply your image (or text) to each language. But doing it this way adds a “Game Object Localizer” component. This component has an empty Changed() at the bottom, and trying to set in manually, doesn’t seem to come up with the same options.
Doing it the way you suggested adds a “Localize String (or Sprite) Event” instead, and has an Update String function already set.