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
MIT License
618 stars 227 forks source link

translate substitute conflicts with angular-gettext #162

Open kwisatz opened 8 years ago

kwisatz commented 8 years ago

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.

niemyjski commented 8 years ago

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

kwisatz commented 8 years ago

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.

kwisatz commented 8 years ago

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

JoeFirebaugh commented 8 years ago

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().