Skip to main content

Localization

DHTMLX Colorpicker allows you to apply different languages to its interface. Translate the strings for Colorpicker labels and tooltips and apply the resulting locale to the component.

Default locale​

Colorpicker uses the following default locale:

const en = {
cancel: "Cancel",
select: "Select",
rightClickToDelete: "Right click to delete",
customColors: "Custom colors",
addNewColor: "Add new color"
};

Custom locale​

Follow these steps to use a different locale:

  • Define the language settings: translate the button labels, the labels of the custom colors section, and the tooltip:
const de = {
cancel: "Abbrechen",
select: "Wählen",
rightClickToDelete: "Rechtsklick zu entfernen",
customColors: "Seine Farben",
addNewColor: "Neue Farbe hinzufügen"
}
  • Call the dhx.i18n.setLocale() method before Colorpicker initialization to apply the settings:
dhx.i18n.setLocale("colorpicker", de);
const colorpicker = new dhx.Colorpicker("colorpicker_container");

Related sample: Colorpicker. Localization