m-e-conroy / angular-dialog-service

A complete AngularJS service with controllers and templates for generating application modals and dialogs for use with Angular-UI-Bootstrap and Twitter Bootstrap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

translate substitute conflicts with angular-gettext

kwisatz opened this issue · comments

We discovered an issue with the translate substitution when this module is used together with angular-gettext.

If dialogs.main is instantiated after gettext, then its translate filter will override gettext's and make all translated text disappear from your app.

The workaround we're using at this time is to make sure to instantiate gettext last.

Are they overriding one of our methods or one of angulars? What ever is causing this should respect angular core implementations (if being used)

While I was writing this up I was indeed wondering where the fault would lie. I don't exactly know who's overriding what though, particularly since I'm not overly familiar with angular-translate and not at all with the translate.sub module or how you would go about checking that you don't – or willingly do – override an existing directive/service/filter.

OK, looks like my initial search was not too good. Just found this, with mentions angular-gettext overriding the core translate filter and directive: rubenv/angular-gettext#105 and it specifically mentions the dialogs module.

Ya, I wrote that ticket back on angular-gettext, and I almost opened one here. I would be interested in using Angular Dialog Service again, if it dropped it's dependency on ng-translate. I've since rolled my own service that uses a JQuery Bootstrap 3 plugin. Maybe this project shouldn't be in the business of having or needing translated bundles. Just my two cents.

What I think is nice about this project is this:
dialogs.create(url, ctrlr, data, opts, ctrlAs)

I personally would want to make my own Error/Notification/Progress dialogs, so I would have my own helper functions and templates that would call dialogs.create().