I have an app that I am building using cordova, and it uses jquery localize
to switch between various JSON files in order to show my pages in different
languages. The functionality works fine on the web, in iOS, and in previous
versions of android. But after upgrading one of my test devices to Android
6.0, the buttons to switch languages no longer work. I hooked up the phone
to adb and got this input while debugging:
Here is the error that it throws when the app is first loaded:
03-14 11:51:02.702 27974-27974/? I/chromium﹕ [INFO:CONSOLE(4)] "Uncaught
TypeError: Cannot read property 'replace' of undefined", source:
file:///android_asset/www/app/vendor/jquery-localize-i18n/dist/jquery.localize.js
(4)
And here is the error that it throws every time you click on one of the
language buttons:
03-14 11:51:48.323 27974-27974/? I/chromium﹕ [INFO:CONSOLE(469)] "Uncaught
TypeError: $(...).localize is not a function", source:
file:///android_asset/www/app/js/arkeo-functions.js (469)
The relevant section of code that it's referencing is the LocalizeThis
function from arkeo-functions.js
Here it is:
function localizeThis(lang) {
$('#checkLang em').removeClass("fa-check");
$('#checkLang em').addClass("fa-fw");
$('.' + lang + ' em').addClass("fa-check");
$("[data-localize]").localize("i18n/site", { language: lang });
localStorage.setItem('jq-appLang', lang);
}
I checked and it seems that there may be one other person having this issue
with the jquery.localize plugin, but it's very recent and hasn't been
resolved. See the top post here:
https://github.com/coderifous/jquery-localize/issues
Beyond this info, I'm not sure what to do. The functionality still works on
the web, in iOS, and on older versions of Android. I can't for the life of
me figure out what changed. After exhaustively looking into the whitelist
plugin, I don't think that's it at all.
Any insights you have would be super helpful.
--
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-developers/c65eeee4-30b2-4a37-b8c0-3124a7589aa0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.