This is a migrated thread and some comments may be shown as answers.

Button Tooltip cannot be translated

4 Answers 146 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Kun
Top achievements
Rank 2
Kun asked on 14 May 2019, 01:51 PM

Hello,

I've activated autotooltip for the buttons in my ribbonbar. But the autotooltip can not take acount of the translation like the button text.

It should display the same text as the button, doesn't it ?

You can see in my attach photo, the button is in French, but the tooltip is in english.

 

Thank you by advance.

4 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 15 May 2019, 06:48 AM
Hello, Kun,     

Following the provided information, I was unable to reproduce the issue you are facing. Please refer to the below screenshot illustrating the behavior on my end with the specified version:



I have attached my sample project. Feel free to modify it in a way to reproduce the experienced issue and get back to me with it so I can investigate the precise case. Thank you in advance. 

Note that the RadRibbonBar.ToolTipTextNeeded event is an appropriate place to customize the tool-tip text as well in order to display the desired tool-tip.

I am looking forward to your reply.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Kun
Top achievements
Rank 2
answered on 15 May 2019, 08:26 AM

Hello, Dess

Thank you for your reply.

I've tried your demo. In your demo, it works well if autotooltip is enabled in the program.

But if I set autotooltip = true only in designer time, it won't work.

Please download the demo that I modified to reproduce the issue:

https://www.dropbox.com/s/nmyqtq47c1m2gw4/Modified_RibbonButtonsTooltips.rar?dl=0

 

Regards,

 

0
Kun
Top achievements
Rank 2
answered on 16 May 2019, 02:24 PM

Hello, Dess

I've found something new:

In designer time, if I enable the autotooltip (true), TooltipText will be filled automatically by the button name (only in the default language) in the Form.resx. The system haven't filled the TooltipText in the other resource file, like Form.fr.resx. That's the reason the tooltip is always in English.

It is strange that autotooltip can work without TooltipText in program.

 

I am looking forward for your help.

Thank you by advance.

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 17 May 2019, 09:31 AM
Hello, Kun,     

Note that the Text property is localizable, but the ToolTipText is not. If you leave the ToolTipText empty, it will extract the respective Text dynamically considering the language at run time. However, if you explicitly set the ToolTipText property, the specified text will be shown as tool-tip no matter the language. Since the ToolTipText is not localizable, the obtained behavior is expected.

The possible solution that I can suggest is to handle the RadRibbonBar.ToolTipTextNeeded event and set the ToolTipText to he current RadButtonElement.Text.

private void radRibbonBar1_ToolTipTextNeeded(object sender, Telerik.WinControls.ToolTipTextNeededEventArgs e)
{
    RadButtonElement btn = sender as RadButtonElement;
 
    if (btn != null)
    {
        e.ToolTipText = btn.Text;
    }
}

Should you have further questions please let me know.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
RibbonBar
Asked by
Kun
Top achievements
Rank 2
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Kun
Top achievements
Rank 2
Share this question
or