Relocated I2Languages.prefab doesn't work on iOS

  • pedrevans
  • Topic Author
  • Visitor
  • Visitor
8 years 2 months ago #1289 by pedrevans
I was doing some prerelease testing and found to my consternation that the localization was not working at all on iPad and iPhone (both iOS 8.4 and iOS 9). Strangely there was no problem in the Unity editor on the Mac. I did some instrumentation work in the localization code and found that the languages were not being populated. I couldn't figure out why but I had a think about what I had changed.

Prior to updating I2L I had moved the I2Languages.prefab to Assets/Prefabs/ so that it would not get overwritten. Everything worked fine in the editor. I noticed that the I2L had automagically created a I2Languages.prefab in the old location but didn't really think any more about. Then this issue came up. After going down many false roads I removed the automagically created prefab and moved my I2Languages.prefab to its place. And hey presto, iOS does localization again. I was very relieved to find what was wrong. Maybe you could put some log warnings in to give the programmer a heads up when the source is missing or (kind of) empty. Any tips on avoiding this kind of problem are welcome. :)

Please Log in or Create an account to join the conversation.

More
8 years 1 month ago #1290 by Frank
Hi,
Sorry for the delay in answering back, I wanted to run some tests and this last days has been crazy over here!

After I tested on the device I went back re-read your post. The problem you were seeing its that I2Languages.prefab needs to be in a Resources folder. That prefab is loaded using Resources.Load(..) so it can't be moved into a folder named Prefabs.

That's why the plugin couldn't find it and created a new one. Also, when you run in the editor, and select the I2Languages.prefab, even if its not in a Resources folder, the inspector will load all of its terms into the LocalizationManager and that's why it was working when playing in the Editor but not in the device.

In one of the latest versions, I made the default folder for the I2Languages.prefab, to be "Assets\I2\Resources" instead of "Assets\I2\Localization\Resources". That way, even if you delete the localization folder to reinstall/upgrade the plugin, the I2Languages.prefab will be kept. To make that easier to detect and use, when the prefab detects that its inside the localization folder, it shows a warning and a button to automatically move the prefab to the recommended folder.

Nonetheless, I will see if I can add another warning for the cases where the prefab will not be loaded because its not in a Resources folder.

Hope that helps,
Frank

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out
The following user(s) said Thank You: pedrevans

Please Log in or Create an account to join the conversation.

  • pedrevans
  • Topic Author
  • Visitor
  • Visitor
8 years 1 month ago #1291 by pedrevans
Replied by pedrevans on topic Relocated I2Languages.prefab doesn't work on iOS
Thanks Frank, that's a very helpful explanation.

Keep up the good work.

Please Log in or Create an account to join the conversation.

Time to create page: 0.229 seconds
Template by JoomlaShine