redrom
redrom

Reputation: 11642

Kendo Grid, how to translate filter dropdown?

I would like to translate filter items in Kendo UI grid, it means Sort Ascending, Is equal to, etc.. (see. image below).

enter image description here

I tried to find it in Official Kendo Grid documentation but without luck.

How can i do it please?

Thanks for any help.

Edit:

I tried by this way but it works only for info label:

 filterable: {
        mode: "row",
        messages: {
            info: 'enter what you want here:',
            equals: 'enter what you want here:'
        }
    },

Upvotes: 1

Views: 3089

Answers (2)

Lester
Lester

Reputation: 750

filterable: {
    messages: {
        info: "Custom header text:", // sets the text on top of the Filter menu
        filter: "CustomFilter", // sets the text for the "Filter" button
        clear: "CustomClear", // sets the text for the "Clear" button

        // when filtering boolean numbers
        isTrue: "custom is true", // sets the text for "isTrue" radio button
        isFalse: "custom is false", // sets the text for "isFalse" radio button

        //changes the text of the "And" and "Or" of the Filter menu
        and: "CustomAnd",
        or: "CustomOr"
    },
    operators: {
        //filter menu for "string" type columns
        string: {
            eq: "Custom Equal to",
            neq: "Custom Not equal to",
            startswith: "Custom Starts with",
            contains: "Custom Contains",
            endswith: "Custom Ends with"
        },
        //filter menu for "number" type columns
        number: {
            eq: "Custom Equal to",
            neq: "Custom Not equal to",
            gte: "Custom Is greater than or equal to",
            gt: "Custom Is greater than",
            lte: "Custom Is less than or equal to",
            lt: "Custom Is less than"
        },
        //filter menu for "date" type columns
        date: {
            eq: "Custom Equal to",
            neq: "Custom Not equal to",
            gte: "Custom Is after or equal to",
            gt: "Custom Is after",
            lte: "Custom Is before or equal to",
            lt: "Custom Is before"
        },
        //filter menu for foreign key values
        enums: {
            eq: "custom Is Equal to",
            neq: "custom Is Not equal to"
        }
    }
}

http://docs.telerik.com/kendo-ui/controls/data-management/grid/localization

Upvotes: 0

chiapa
chiapa

Reputation: 4412

Try this:

Razor:

@(Html.Kendo().Grid(Model)
    .Name("listView")
    .Filterable(f => f.Messages(m => m.Equals("text here"))

Javascript:

$("#grid").kendoGrid({

     filterable: {
        messages: {
            info: 'enter what you want here:',
            and: 'enter what you want here:',
            cancel: 'enter what you want here:',
            clear: 'enter what you want here:',
            filter: 'enter what you want here:',
            isFalse: 'enter what you want here:',
            isTrue: 'enter what you want here:',
            operator: 'enter what you want here:',
            or: 'enter what you want here:',
            selectValue: 'enter what you want here:',
            value: 'enter what you want here:',
            operators: {
                string: {
                     eq: "enter what you want here:",
                     neq: "enter what you want here:",
                     startswith: "enter what you want here:",
                     contains: "enter what you want here:",
                     doesnotcontain: "enter what you want here:",
                     endswith: "enter what you want here:",
                     eq: "enter what you want here:",
                     neq: "enter what you want here:"
                  }
             }
        }
    }
});

Upvotes: 3

Related Questions