0
votes

I'm using Kendo UI v2013.2.716, Kendo grid specifically, but I need to change the texts of the filters the Spanish language, I'm using kendo.culture.es-CL.min.js, but seeing him, simply text the days of the week in Spanish . In the picture you can see the filter in English. I have read and applied the instructions: http://docs.telerik.com/kendo-ui/aspnet-mvc/globalization, but even I can not make it work. Any help?

Text in english that I like in other language

3

3 Answers

3
votes

Globalization changes the number formats and day and month names. For translated UI messages check the localisation support.

** Update ** This is the right answer although being downvoted. Kendo UI provides built-in localization for various languages and there is no need to set the messages one by one.

UI for ASP.NET MVC goes one step further and provides satellite assemblies.

2
votes

You should include in you Grid definition

var grid = $("#grid").kendoGrid({
    dataSource: ds,
    filterable:  {
        messages : {
            info: "Muestra items cuyo valor:",
            isTrue: "es verdadero",
            isFalse: "es falso",
            filter: "Filtra",
            clear: "Borra",
            and: "Y",
            or: "Ó",
            selectValue: "-Selecciona valor-",
            operator: "Operador",
            value: "Valor",
            cancel: "Cancelar"
        }
    },
    columns   : [
        ...
    ]
}).data("kendoGrid");

See a running example here: http://jsfiddle.net/OnaBai/hb4yhco3/5/

NOTE: For using this you should use a recent version of KendoUI (v2014.2 or newer)

0
votes

I finally do it using this code, because my Kendo UI vertion is 2013.2.716, (thanks OnaBai but give me the main idea):

@(Html.Kendo().Grid<ViewModels.Test>()  
        .Name("test")
        .HtmlAttributes(new {@class="slim-rows"})
        .Columns(columns =>
        {
        ...
        })
    .Pageable(p => p
                .Messages(m => m
                    .Display("Mostrando {0}-{1} de {2} registros")
                    .Empty("No se encontraron registros")
                    .First("Ir a la primera página")
                    .Last("Ir a la última página")
                    .Next("Ir a la página siguiente")
                    .Previous("Ir a la página anterior")
                )
        )
        .Filterable(filterable => filterable
            .Messages(m => m
                .Filter("Filtrar")
                .Clear("Limpiar")
                .Info("Mostrar registros que:")
                .And("Y")
                .Or("O")
            )
            .Extra(false)
            .Operators(operators => operators
                .ForString(str => str.Clear()
                    .StartsWith("Comienza con")
                    .IsEqualTo("Es igual a")
                    .IsNotEqualTo("No es igual a")
                    .Contains("Contiene")))
        )