angular-gettext-tools
angular-gettext-tools copied to clipboard
Don't use inner HTML when using attribute
I want to translate custom annotation, as described here
https://angular-gettext.rocketeer.be/dev-guide/custom-annotations/
I have tooltip, I want to automatically translate it that way. HOWEVER, it is only used in pairwise tags. Like this:
<div tooltip="You have mouse on Foo!"><img src="http://example.org/foo.jpg">...</div>
However, I cannot do that. Once I add tooltip to attributes, the inner HTML is extracted.
It's probably because here - https://github.com/rubenv/angular-gettext-tools/blob/master/lib/extract.js#L345 - the logic is first take inner HTML, and only when it's falsey, take the argument.
That's very unfortunate. If you really want this behaviour, it should be documented.
It might be fixed here - https://github.com/rubenv/angular-gettext-tools/pull/147 - but I am frankly not very sure, plus it might do something unintended.
....yep, my fix breaks something. It was an idea :)