Author Topic: Localization Tip, using Sprites and Atlas  (Read 3968 times)

Francisco

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Localization Tip, using Sprites and Atlas
« on: August 02, 2015, 12:13:02 AM »
So, i need to localize a game, and the CSV works really nice but i also have to localized the atlas and sprites, not everything is done using textfields/labels.¥

So how can i approach that problem? Is there a way to change the atlas/sprite depending of the Key at the beginning of the game? For example, the game loads and check the system language, if it is ENG, than change the reference Atlas for the ENG atlas.

Other solution i was thinking was to make builds for every language, but that is not practical at all.


appreciate any help!


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Localization Tip, using Sprites and Atlas
« Reply #1 on: August 05, 2015, 07:45:58 AM »
UILocalize is capable of swapping sprites for you, but not atlases. If you need to swap an atlas, you need to do it in Awake() in the very first scene upon loading the game. Whenever you want to swap languages, you then need to reload the scene for all changes to take effect properly.

The best way to handle all this is to have a reference atlas. Basically make an empty dummy atlas and make it point to a proper atlas. Make all your widgets use this dummy atlas rather than the proper atlas. Whenever you need to change the atlas it's pointing to, do just that -- change the reference of the dummy atlas. Since your widgets use the dummy, they will automatically start using whatever other atlas you make the dummy atlas point to.