dakk / jquery-multilang

Simple and fast multilanguage plugin for jquery
48 stars 19 forks source link

If return false all the time #1

Open iriejoy opened 9 years ago

iriejoy commented 9 years ago

In my case I test in XP chrome. but the:

I will pass the language later by cookie or server //langCode = navigator.language.substr (0, 2);

langCode = 'it';

EVERYTIME GIVE ME FALSE if (langCode in langs) $.getJSON('lang/'+langCode+'.json', translate); else $.getJSON('lang/en.json', translate);

instead use Jquery (already loaded) if ($.inArray( langCode, langs ) >= 0) base on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/in

alexfujita commented 7 years ago

Thanks. It helped me.

raphaelchalicarne commented 4 years ago

I personally used the line if (langs.includes(langCode)) to keep using JavaScript. Based on the MDN docs.

dakk commented 4 years ago

@raphaelchalicarne link is broken

raphaelchalicarne commented 4 years ago

@raphaelchalicarne link is broken

@dakk I updated the link