Can't get Angular Translate working on Android (works fine on iOS)


#1

I have an app that’s been translated into various languages using Angular Trenslate, it works fine on iOS but does nothing on Android other than giving a notice to the console about security:

pascalprecht.translate.$translateSanitization: No sanitization strategy has been configured. This can have serious security implications. See http://angular-translate.github.io/docs/#/guide/19_security for details.

Has anyone encountered anything similar? Any ideas why it works on iOS but not Android?


#2

Did you try going to the provided link ?

It seem to explain all you have to do.


#3

I tried explicitly stating a sanitize strategy but it still doesn’t translate the app. I don’t think that error will effect anything.

This is the code we’re using to detect the language of the device, I think the error might be here because it seems to be failing at or before this point.

$translateProvider.determinePreferredLanguage(function() { var lang = window.navigator.language || window.navigator.userLanguage; switch(lang) { case 'cs-cz': document.documentElement.setAttribute('lang', 'ces'); return 'ces'; ... other languages... ... default: return 'eng'; } });


#4

I never user angular-translate, so I can’t help you with that.

Try using some breakpoints to see what isn’t working, or try asking on the angular-translate forum/issue tracker.