angular-dialog-service icon indicating copy to clipboard operation
angular-dialog-service copied to clipboard

translate substitute conflicts with angular-gettext

Open kwisatz opened this issue 8 years ago • 4 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.

kwisatz avatar Dec 24 '15 08:12 kwisatz

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

niemyjski avatar Dec 28 '15 13:12 niemyjski

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 avatar Dec 28 '15 16:12 kwisatz

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.

kwisatz avatar Dec 28 '15 16:12 kwisatz

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

JoeFirebaugh avatar Jan 22 '16 22:01 JoeFirebaugh