Localizing Pivot

Pivot provides you with the possibility to fully localize its interface into the necessary language. You just need to specify the corresponding locale via the dhx.i18n.setLocale method. The method takes two parameters: the pivot container and an object that contains rules of localization for a particular country.

dhx.i18n.setLocale("pivot", {
    availableFields: "available fields",
    values: "data",
    columns: "columns",
    rows: "rows",
    moveFieldsHere: "MOVE FIELDS HERE",
    hideSettings: "Hide Settings",
    showSettings: "Show Settings",
    apply: "Apply",
    day: "Day",
    week: "Week",
    month: "Month",
    quarter: "Quarter",
    year: "Year",
    min: "Min",
    max: "Max",
    sum: "Sum",
    count: "Count",
    equal: "Equal",
    notEqual: "Not Equal",
    contains: "Contains",
    notContains: "Not Contains",
    typeHere: "Type Here",
    selectAll: "Select All",
    unselectAll: "Unselect All",
    cancel: "Cancel",
    ok: "Ok",
    total: "Total",
    date: {
        month_full: ["January", "February", "March", "April", "May", "June", "July", 
            "August", "September", "October", "November", "December"],
        month_short: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", 
            "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
        day_full: ["Sunday", "Monday", "Tuesday", "Wednesday", 
            "Thursday", "Friday", "Saturday"],
        day_short: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
        quarter: ["Q1", "Q2", "Q3", "Q4"],
        week: "W"
    }
});

After that, you need to initialize Pivot and check how the labels' names have changed.

var pivot = new dhx.Pivot(document.body, {
    data: dataset,
    fields: {
        rows: ["form", "name"],
        columns: ["year", { "id": "when", "group": "dateByQuarter" }],
        values: [{ id: "oil", method: "max" }, { id: "oil", method: "sum" }],
    },
    fieldList: [
        { id: "name", label: "name" },
        { id: "year", label: "year" },
        // all fields
    ]
});

Related sample:  UI Localization

Back to top