Localized name System.Windows.Media.Color

The standard color names are English names, normal. But my application is German, so I would like to have the color names in my ComboBox as German names. Instead of Blue, Yellow, etc. I would like to have "Blau", "Gelb", etc.

Is there a function that returns all localized names? Or is it easy to change the culture in this challenge?

 <ObjectDataProvider MethodName="GetType" ObjectType="{x:Type sys:Type}" x:Key="colorsTypeOdp"> <ObjectDataProvider.MethodParameters> <sys:String>System.Windows.Media.Colors, PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</sys:String> </ObjectDataProvider.MethodParameters> </ObjectDataProvider> 
+3
source share
4 answers

I found a useful table that gives me some translations (English and German names) . The table can be found here .

I will use texts and a converter to display German color names.

+2
source

As a continuation of the peetee question and the link to this German Netscape color name page , I created a small C # wrapper class that you can add to your project.

To use, just call it something similar to:

 string germanName = ColorNameGermanTranslator.GetGermanName(Color.Green); 

and you will get the German name back. He uses the English name as a fallback.

+1
source

Sorry, the code fragment has disappeared ... so here it is:

 <ObjectDataProvider MethodName="GetType" ObjectType="{x:Type sys:Type}" x:Key="colorsTypeOdp"> <ObjectDataProvider.MethodParameters> <sys:String>System.Windows.Media.Colors, PresentationCore, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</sys:String> </ObjectDataProvider.MethodParameters> </ObjectDataProvider> 
0
source

No, these are property names - the same part of the code / class definition as the String.Length property, not the resources. Property names are not localized.

0
source

All Articles