Localized System.Windows.Media.Color name

前端 未结 4 1056
小鲜肉
小鲜肉 2021-01-21 01:14

The standard color names are english names, ok. But my Application is german so I would like to have the color names in my ComboBox as german names. Instead of \"Bl

相关标签:
4条回答
  • 2021-01-21 01:57

    As a follow-up to peetee's question and link to this German page about Netscape color names, I've built a small C# wrapper class that you can drop-into your project.

    To use, simply call it something similar to:

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

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

    0 讨论(0)
  • 2021-01-21 01:59

    No, these are property names -- as much part of the code / class definition as the String.Length property -- not resources. Property names aren't localised.

    0 讨论(0)
  • 2021-01-21 02:05

    Sorry, the code snippet was gone ... 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 讨论(0)
  • 2021-01-21 02:15

    I have found a useful table that gives me some Translations (english names and german ones) The table can be found here.

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

    0 讨论(0)
提交回复
热议问题