Angular translate vs Ionic performance


#1

Hello,

I’m trying to optimize the performance of our Ionic app and I wonder if someone has noticed any performance problem deterioration due to the heavy use of angular-translate.

Our app heavily uses this module, all the views have lots of {{‘TRANSLATE_ME’ | translate}} expressions. Every digest cycle has to deal with all this expressions, some of them with inner params.

We are not using one way binding (::slight_smile: with any of the translate expression, because we wanted the change language option to be immediate and without page reload.

The question is wether the performance boost in the app would be noticeable if we changed all(most) of the translate expressions to use one way binding. In that case we would be obliged to reload the view when the users changes the language, but I think we could deal with that.


#2

Where possible you should prefer the translateDirective (e.g., translate=‘ALL_POSTS’) to the translateFilter (e.g., ‘ALL_POSTS’ | translate). See: http://stackoverflow.com/questions/20540877/correct-use-for-angular-translate-in-controllers/23866441#23866441

And: http://robferguson.org/2015/07/22/internationalisation-i18n-and-localisation-l10n-for-ionic-apps/