Localization

You can localize labels in the interface of dhtmlxSpreadSheet and present it in any necessary language. You just need to provide localized strings for labels and apply your locale to the component.

SpreadSheet English locale

Default locale

The English locale is used by default:

var en = {
    undo: "Undo",
    redo: "Redo",
    textColor: "Text color",
    backgroundColor: "Background color",
    bold: "Bold",
    italic: "Italic",
 
    lockCell: "Lock cell",
    unlockCell: "Unlock cell",
 
    format: "Format",
    edit: "Edit",
    clear: "Clear",
    clearValue: "Clear value",
    clearStyles: "Clear styles",
    clearAll: "Clear all",
 
    insert: "Insert",
    columns: "Columns",
    rows: "Rows",
    addColumn: "Add column",
    removeColumn: "Remove column",
    addRow: "Add row",
    removeRow: "Remove row",
 
    configuration: "Configuration",
    underline: "Underline",
    align: "Align",
    left: "Left",
    right: "Right",
    center: "Center",
 
    help: "Help"
};

Custom locale

To apply a different locale you need to:

  • provide translation for all text labels in SpreadSheet, e.g. the Russian locale looks like this:
var ru = {
    undo: "Отменить",
    redo: "Применить",
    textColor: "Цвет текста",
    backgroundColor: "Цвет фона",
    bold: "Жирный",
    italic: "Курсив",
 
    lockCell: "Блокировать ячейку",
    unlockCell: "Разблокировать ячейку",
 
    file: "Файл",
    format: "Формат",
    edit: "Редактировать",
    clear: "Очистить",
    clearValue: "Очистить значение",
    clearStyles: "Очистить стили",
    clearAll: "Очистить все",
 
    insert: "Вставка",
    columns: "Столбцы",
    rows: "Строки",
    addColumn: "Добавить столбец",
    removeColumn: "Удалить столбец",
    addRow: "Добавить строку",
    removeRow: "Удалить строку",
 
    configuration: "Конфигурация",
    underline: "Подчеркнутый",
 
    align: "Выровнять",
    left: "по левому краю",
    right: "по правому краю",
    center: "по центру",
    help: "Помощь"
};
  • apply the new locale by calling the dhx.i18n.setLocale() method before initializing SpreadSheet:
dhx.i18n.setLocale("spreadsheet", ru);
var spreadsheet = new dhx.Spreadsheet("ssheet1");

Related sample:  Localization

Back to top