Hacker News new | ask | show | jobs
by hcentelles 4502 days ago
Almost a year ago when this project was announced on angular google group I was looking for a i18n solution for my app, I tried it but the negative performance impact made me discard it. Its approach of implement i18n through filters and directives relying on angular dirty checking make your app really slow If you have a regular amount of i18n strings. I ended up generating different templates for each language with grunt and using a simple i18n function mapping a dictionary for strings on js code. I see that it hit 2.0 now, its evolution make it usable without a notable performance penalty?
1 comments

You are right, dirty check is not the best thing when it comes to performance. However, we've updated the directive to only set up watches when needed. Which means, when you don't change the language at runtime, but kick off some $digest cycles, they don't get re-evaluated. So this should be an performance boost. Filters always set up watches, if you use filters, well... deal with it. You could use the directive. angular-translate isn't the answer for everyone and that's okay because this is not what it should be. It solved a problem for me and people like it, which is why I still develop this module.

For some cases angular-gettext surely makes more sense, angular-translate gives you just a much higher integration into the angular world and solves more problems like async loading, fallback languages, pluralization, language negotiation etc etc.

Chose what fits best for you! :)

"Conditional watches" on the directive sounds good, I will try it. Also gettext support will be great, the use of existing i18n tools is a must have.