feature
MatTooltip should be able to show title from title attribute
Only specify your own value
Providing a StackBlitz reproduction is the best way to share your issue.
StackBlitz starter: https://goo.gl/wwnhMV
To need for i18n
Having the title attribute set will cause the browser tooltip to be shown. Passing a translated string should be handled by you.
You can do something like this
<span class="cdk-visually-hidden" #translatedTooltipMessage i18n="@@myTranslation">Will be translated</span>
...
<button [matTooltip]="translatedTooltipMessage.innerHTML">I have a translated tooltip</button>
@msc117 Wow, it's a nice trick, but will be a cool having this method inside directive.
I haven't tried something like this before, but would this work?
<button i18n-matTooltip matTooltip="To be translated"></button>
Maybe i trying wrong, but string above doesn't work
Closing since we don't want to overload the title attribute and change default behavior of it
the i18n-matTooltip works well
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
Having the
titleattribute set will cause the browser tooltip to be shown. Passing a translated string should be handled by you.You can do something like this