This project has moved. For the latest updates, please go here.

Translation Colorpicker

May 8, 2011 at 12:36 PM

Hi,

Is there a way to translate in another language the texts of the colorpicker control ?

Sincerely

May 9, 2011 at 1:28 PM

Sorry, but color names are constant values in the KnownColor and SystemColors enumeration types; they aren't not localizable.

Jun 7, 2011 at 4:26 PM

But what about text of buttons like "Advanced", "Standard" and "Available Colors", "Standard Colors" labels?

Jun 7, 2011 at 4:31 PM

Those could be localized.  Just create a resource dictionary for your region and use those values instead.

Jun 10, 2011 at 12:03 PM

But i want to change my language dynamically, is it possible to change these values at runtime?

Jun 14, 2011 at 2:00 PM

Yes, this is possible. There are quit of few discussions on how to accomplish this in the WPF Forums.

http://social.msdn.microsoft.com/forums/en/wpf/threads/

Sep 14, 2011 at 11:48 AM
brianlagunas wrote:

Those could be localized.  Just create a resource dictionary for your region and use those values instead.


Hi Brian,

could you explain the step with the resource dictionnary in detail?

I want to change the text "Advanced" into "Erweitert":

<extToolkit:ColorPicker Foreground="Black" AvailableColorsHeader="Verfügbare Farben" StandardColorsHeader="Standardfarben">
    <extToolkit:ColorPicker.Resources>
        <ResourceDictionary>
         ??? "Advanced" "Erweitert"
        </ResourceDictionary>
    </extToolkit:ColorPicker.Resources>
    <extToolkit:ColorPicker.SelectedColor>
        <MultiBinding Converter="{StaticResource argbtocolorconverter}">
            <Binding Path="VA"/>
            <Binding Path="VR"/>
            <Binding Path="VG"/>
            <Binding Path="VB"/>
        </MultiBinding>
    </extToolkit:ColorPicker.SelectedColor>
</extToolkit:ColorPicker>
Is this the correct way? What is the correct entry for ??? "Advanced" "Erweitert"?
Thanks and greetings from Germany
Ralf
Sep 15, 2011 at 7:09 AM

Unfortunately this is not possible without re-templating the control.  This is a requested feature and should make it into the next version.  If you need it now, you will need to re-template the control.

Aug 28, 2013 at 1:00 PM
Edited Aug 28, 2013 at 1:01 PM
Actually, u could rewrite ColorPick.
set togglebutton Checked and Unchecked event.
code like this:
public class ColorPickerRewrite : ColorPicker
    {
        private ToggleButton _advanced;
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
            _advanced = GetTemplateChild("_colorMode") as ToggleButton;
            if (_advanced != null)
            {
                _advanced.Content = "default/advanced";
                _advanced.Unchecked += (sender, e) =>
                    {
                        _advanced.Content = "default/advanced";//uncheck togglebutton, content return to default

                    };
                _advanced.Checked += (sender, e) =>
                    {
                        _advanced.Content = "standard";//checked, get into advanced mode, changed content into standard
                            
                    };
            }
        }
    } 
this is only way that i found to change the language without re-template
Developer
Apr 24, 2014 at 4:05 PM
Hi,

You are right, there are more languages than English around the world. But if properties are added for the ColorPicker to manage localization, there should be the same for all text in all the controls of the toolkit : which would make a bunch of new properties.

This feature is part of the issue https://wpftoolkit.codeplex.com/workitem/19306. Please vote for it in order to put it on top of the list :-)