angular-gettext-tools icon indicating copy to clipboard operation
angular-gettext-tools copied to clipboard

Don't use inner HTML when using attribute

Open karelbilek opened this issue 9 years ago • 2 comments

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.

karelbilek avatar Jun 06 '16 13:06 karelbilek

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.

karelbilek avatar Jun 06 '16 13:06 karelbilek

....yep, my fix breaks something. It was an idea :)

karelbilek avatar Jun 06 '16 13:06 karelbilek