0
votes

In the kendo localization example mentioned here: http://demos.telerik.com/kendo-ui/grid/localization

The grid's data are getting localized. And the column names are hardcoded in the grid options. Is there a way to localize the column names as well? I am using Angular to get the text for localization. And I have annotated the text which has to be translated using translate filter and attribute. How should it be done for the kendo grid where column names are hardcoded in the kendo grid options?

Can anyone help me with a solution?

1

1 Answers

1
votes

I looked at the Telerik demo and I see this section for the columns:

 columns: [
          "ProductName",
           { field: "UnitPrice", title: "Unit Price", format: "{0:c}", width: "120px" },
           { field: "UnitsInStock", title:"Units In Stock", width: 
           ...

You just need to use gettextCatalog.getString()

      var unitPriceTitle = gettextCatalog.getString("Unit Price");
      var unitsInStockTitle = gettextCatalog.getString("Units In Stock");
      ...
           { field: "UnitPrice", title: unitPriceTitle, format: "{0:c}", width: "120px" },
           { field: "UnitsInStock", title: unitsInStockTitle , width: 
           ...