wikimedia / jquery.i18n

🌐 jQuery based internationalization library
GNU General Public License v2.0
704 stars 144 forks source link

Errors with minified version #130

Closed sashberd closed 7 years ago

sashberd commented 7 years ago

Hi First of all great job, very nice and useful plugin! In my application I using Grunt with grunt uglify. All looks good, but on load I got a lot of ajax error on cosole. After deep investigation I found that inside function load in for in loop it takes Array.prototype functions and pushes them inside ajax load urls: image

On debug mode you can see that array length is 1, but the code continue to take prototype function: image The result is many errors in console of ajax failed requests: image I around the array prototype functions on the PS. I found that if I replace for in to array.foreach this problem is not happend

// for ( locIndex in fallbackLocales ) {
                //  fallbackLocale = fallbackLocales[locIndex];
                //  sourceMap[fallbackLocale] = source + '/' + fallbackLocale + '.json';
                // }

                fallbackLocales.forEach(function(locale) {
                    sourceMap[fallbackLocale] = source + '/' + locale + '.json';
                });

For your review

sashberd commented 7 years ago

I see you fixed an issue When will you release 1.0.5? I would like to use it?

Nikerabbit commented 7 years ago

We haven't done releases in a while. Should probably do it.