mui-datatables icon indicating copy to clipboard operation
mui-datatables copied to clipboard

Question: How can we localize all texts ?

Open tjaskula opened this issue 8 years ago • 6 comments

Is there an easy way to localize texts in any language ?

tjaskula avatar Apr 18 '18 08:04 tjaskula

Hey @tjaskula, there is not any localization support as it stands today. It is a feature that is definitely in the future roadmap

gregnb avatar Apr 18 '18 09:04 gregnb

Could we use https://github.com/stefalda/localized-strings ?

victorbueno avatar May 03 '18 20:05 victorbueno

@victorbueno I think to start I will provide something in the options that will allow you to start overriding the default language as opposed to storing different language sets

const options = {
   textLabels: {
      pagination: {
         labelRowsPerPage: "Zeilen pro Seite:",
      },
      toolbar: {
        viewColumns: ""
     }
   }
};

gregnb avatar May 04 '18 07:05 gregnb

@gregnb that's even better!

victorbueno avatar May 04 '18 20:05 victorbueno

I'm going to finish this feature today and here's what I have so far for options:

Pass in a property named textLabels via options prop

      textLabels: {
        pagination: {
          next: "Next Page",
          previous: "Previous Page",
          rowsPerPage: "Rows per page:",
          displayRows: "of" // 1-10 of 30
        },
        toolbar: {
          search: "Search",
          downloadCsv: "Download CSV",
          print: "Print",
          viewColumns: "View Columns",
          filterTable: "Filter Table"
        },
        filter: {
          title: "FILTERS",
          reset: "reset",          
        },
        viewColumns: {
          title: "Show Columns"
        },
        selectedRows: {
          text: "rows(s) deleted",
          delete: "Delete"
        }
    }

gregnb avatar May 13 '18 15:05 gregnb

This issue is resolved in 2.0.0-beta-6 which will also require upgrade to the latest material-ui

gregnb avatar May 14 '18 01:05 gregnb