I've built a very basic WPF, but the context menus which appear when right-clicking on scrollbars or text selections remain in English, even when the local language/regional settings was changed to a different language. Code is attached at the bottom of this post.
At first, I thought maybe I didn't change all the language related settings on a system level, but when I try that in notepad, it works fine (meaning, the right-click menu isn't in English). So I thought maybe it's some kind of a .net/WPF-specific issue, so I checked with Paint.net and it was fine there as well (though it might be non-WPF C# and C++ mixed?). Also tried to install the latest .net Framework Language Pack, which wouldn't install because it already exists on my PC.
You can see the differences in context menus between my app and Notepad in the following screenshots:
The code for the example app which reproduces this problem is pretty basic. This is the xaml file:
<Window x:Class="WpfTestScrollLanguage.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfTestScrollLanguage"
mc:Ignorable="d"
Loaded="Window_Loaded"
Language="uk-ua"
xml:lang="uk-UA"
Title="MainWindow" Height="100" Width="525">
<Grid Height="300" ScrollViewer.CanContentScroll="True" ScrollViewer.VerticalScrollBarVisibility="Visible" Language="uk-ua" xml:lang="uk-UA">
<ListView Language="uk-ua" xml:lang="uk-UA">
<Button Content="A" Height="20" Width="20"/>
<Button Content="B" Height="20" Width="20"/>
<Button Content="C" Height="20" Width="20"/>
<Button Content="D" Height="20" Width="20"/>
<TextBlock Height="300" Name="Text"/>
<TextBox Height="50" Width="300" Text="test123" Language="uk-ua" xml:lang="uk-UA"/>
</ListView>
</Grid>
and this is the .xaml.cs file that goes along with it (only the code that isn't auto-generated):
private void Window_Loaded(object sender, RoutedEventArgs e)
{
var test = System.Globalization.CultureInfo.CurrentCulture;
var test2 = System.Globalization.CultureInfo.CurrentUICulture;
var test3 = this.Language;
var test4 = System.Windows.Markup.XmlLanguage.GetLanguage(System.Threading.Thread.CurrentThread.CurrentUICulture.Name);
Text.Text = "a\nb\nc\nd\ne\nf";
}
all of the test variables in runtime have shown "uk-UA" (as I've changed the OS language and region to Ukraine) even without setting those values manually within the xaml file itself. I just added them explicitly to the UI elements defined in the xaml file, to make sure I cover all possible cases.
edit: the app.config file is pretty simple, and doesn't seem related in this scenario:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
Any idea about what I might be missing here? (Running on Windows 10 RS1, but I've observed the same problem also in RS2 and RS3-beta)
edit2: I've tried to find some existing apps that are based on WPF solely, and found WittyTwitter - there it seems that the text's context menu remains in English as well, but the whole app is English only so I can't really tell if maybe it's designed to be like that, or maybe it's really a WPF-based bug?
edit3: someone flagged this question as a dup of this one. Even though it might be more or less the same case, the answer there doesn't solve it (as I've described here), plus my question has more details to reproduce the problem.