Closed morgrowe closed 2 years ago
Hi @morgrowe ,
Nice to see you again :)
Just use localize-content="false"
:
<p localize-att-title="foo" localize-content="false">bar</p>
Thanks for the incredibly fast response :). Awesome, localize-content="false"
works perfectly. Thank you!
Would it be possible to have this as the default behaviour? I can see why some people would like to have the implicit local-content
behaviour when using the localize-att-
tag helper, but I think it would be extremely handy if this behaviour could be disabled.
Cheers Morgan
you are welcome :)
I will take your comment into consideration during the next update.
Best, Ziya
Great, thank you. :)
Morgan
Hi Ziya
Hope you're well.
Whenever I use the
localize-att-
tag helper, not only does it localize the attribute's value, but the tag's contents as well. For example:Returns this in the console:
I'd expect it to log:
I'm using the
localize-att-*
extensively in my project and I'd like to reduce the amount of redundant database traffic. A real world example would be localizing Bootstrap's "close" label. I only want to localize thearia-label
attribute, not the content of the tag (as it's just an icon).I expect only one request to fetch the resource with the key "Close", but instead I get two. One for "Close" and another for "
<span aria-hidden="true">×</span>
".Is this working as intended? If so, would it be possible to add an option to only localize the tag's contents when
localize-content
is added to the tag please?Package versions:
Cheers Morgan