enyojs/enyo-ilib — pull request #78 by ehoogerbeets (2014-06-04 20:11:14+00:00)
Title: Fix problem where enyo-ilib was not loading localized resources

In my previous attempt, I had tested this change with a side-loaded app, which worked fine. The problem came in when you concatenated and minified enyo-ilib and put it on the device. In that case, it was ilib was loaded as part of the app container before it was morphed into an app. The glue code had a cache of the manifest files which detail what locale data was available. In the container, there were no localized resource strings available, so it thought there was nothing to load. Later, when the container was morphed into an app and it attempted to load the string resources, the glue code checked the manifest and still thought that there were no resources to load. Now, we clear the cache when loading the app to cause it to re-read the manifests.

Also, there was a problem where files loaded from a custom root (eg. string resource files in moonstone) were not being loaded because the custom root was not in the manifest cache. Also, if the locale dir or custom root did not have a manifest file, the code incorrectly assumed that all files were not available. Now, it assumes they are all available. If there is a custom root, or if any locale data directory does not have a manifest file, it will attempt to load the files anyways. This will cause some 404 errors again, but these can be remedied if the missing ilibmanifest.json file is properly added to that dir.