wpf icon indicating copy to clipboard operation
wpf copied to clipboard

[WPF] KeyGesture.GetDisplayStringForCulture() does not provide a localized string

Open vsfeedback opened this issue 7 months ago • 1 comments

This issue has been moved from a ticket on Developer Community.


[severity:It's more difficult to complete my work] Contrary to what its name suggests, the function GetDisplayStringForCulture(CultureInfo) in the class System.Windows.Input.KeyGesture does not return a localized string. After looking into the source code, the problem can be tracked down to the ConvertTo(ITypeDescriptorContext, CultureInfo, object, Type) method of the System.Windows.Input.KeyConverter class, which does not use its CultureInfo parameter.

Workaround (not ideal): use WinForms, as suggested by this StackOverflow answer. This works because System.Windows.Forms.KeysConverter properly translates the special keys.


Original Comments

Feedback Bot on 5/22/2025, 11:33 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

vsfeedback avatar May 30 '25 05:05 vsfeedback

I am the one who opened the ticket on Developer Community. Here are some links for an easier investigation:

Arkane5 avatar Sep 12 '25 09:09 Arkane5