Localization

Localization allows you to present the interface of dhtmlxVault in any language: English (default), Spanish, French, etc. It takes just a couple of simple steps described below.

Default locale

By default, dhtmlxVault provides support for the English locale:

var en = {
    dragAndDrop: "Drag & drop",
    or: "or",
    grid: "Grid",
    list: "List",
    browse: "Browse files",
    filesOrFoldersHere: "files or folders here",
    cancel: "Cancel",
    clearAll: "Clear all",
    clear: "Clear",
    add: "Add",
    upload: "Upload",
    download: "Download",
    error: "error",
    byte: "B",
    kilobyte: "KB",
    megabyte: "MB",
    gigabyte: "GB"
};

Custom locale

To apply a different locale you need to:

  • provide translation for all text labels in Vault, e.g. the German locale looks like this:
var de = {
    dragAndDrop: "Drag & Drop",
    or: "oder",
    grid: "Gitter",
    list: "Liste",
    browse: "Suchen Sie Dateien durch",
    filesOrFoldersHere: "Dateien oder Ordner hier",
    cancel: "Stornieren",
    clearAll: "Alles löschen",
    clear: "Löschen",
    add: "Hinzufügen",
    upload: "Hochladen",
    download: "Herunterladen",
    error: "error",
    byte: "B",
    kilobyte: "KB",
    megabyte: "MB",
    gigabyte: "GB"
};
  • apply the new locale by calling the dhx.i18n.setLocale() method before initializing Vault:
dhx.i18n.setLocale("vault", de);
var vault = new dhx.Vault("vault1");

Related sample:  Vault. Localization

Back to top