I have a piece of html like this
<bar title="'My Title'"></bar>
Now, when I want to translate it, it looks like this
<bar title="'My Title'|translate"></bar>
The reason why I dont have {{ and }} is because the 'bar' directive binds the title to its scope with '='
scope: {
title: '=',
...
}
The problem is that the task 'nggettext_extract' doesn't extract this text, because it is looking for things in between curly brackets. 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've 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!
You can do something like this :