Angularjs / gettext: how to convert text to attributes
I have a html piece like this
<bar title="'My Title'"></bar> Now when I want to translate it, it looks like
<bar title="'My Title'|translate"></bar> The reason I don't have {{and}} is because the 'bar' directive associates the header with its scope with '='
scope: { title: '=', ... } The problem is that the "nggettext_extract" task does not retrieve this text because it searches for things between braces. I found a hack to solve this problem:
<bar dummy="{{My Title'|translate}}" title="'My Title'|translate"></bar> But I hope there is a better solution to this problem?
UPDATE: the workaround I implemented now is that I changed the directive as follows
scope: true, link: function(scope, element, attrs) { scope.title = attrs.title; } Of course, if someone knows a better solution, please let me know!