Localization of the Excel Filter

How to localize the Excel Filter (and the other types of filter) on Grid ?




7 Replies

IR Isuriya Rajan Syncfusion Team March 19, 2018 12:39 PM UTC

Hi Massimo, 

Thanks for contacting Syncfusion support, 

We have created a sample  locale with Menu type filter. Refer the below code example 

<ejs-grid id="Grid" datasource="ViewBag.DataSource" height="315" allowpaging="true" locale="es-AR" allowfiltering="true" allowgrouping="true"> 
    <e-grid-editsettings allowadding="true" allowdeleting="true" allowediting="true"></e-grid-editsettings> 
    <e-grid-filtersettings type="Menu"></e-grid-filtersettings> 
    <e-grid-columns> 
        <e-grid-column field="OrderID" headertext="Order ID" isprimarykey="true" textalign="Right" width="100"></e-grid-column> 
       <e-grid-column field="OrderDate" headertext="Order Date" width="150" type="date" edittype="datepickeredit" format="yMd"></e-grid-column> 
    </e-grid-columns> 
</ejs-grid> 

Sample for your reference: 

 
The “Provide Locale support for excel/check box custom menu filters” is already a known issue. We have created the bug report for this. This fix will be included in our upcoming patch release which will be planned to be rolled out at the end of March, 2018   
 
Regards, 
Isuriya R 
 



MG Massimo Giambona April 9, 2018 03:17 PM UTC

Thanks for your info.
I have tested the new release and saw that there are some labels that I cannot localize.

On the custom filter dialog the title is hard coded

this.dlgObj = new Jl({
     header: "Custom Filter",
     isModal: !0,

Here the js object used

ej.base.L10n.load({
            "it-IT": {
                "grid": {
                    "EmptyRecord": "Nessun record da visualizzare",
                    "True": "vero",
                    "False": "falso",
                    "InvalidFilterMessage": "Filtro invalido",
                    "GroupDropArea": "Rilascia qui le colonne per raggruppare",
                    "UnGroup": "Clicca qui per separare",
                    "GroupDisable": "Raggruppamento disabilitato per la colonna",
                    "FilterbarTitle": "Filtro Cella",
                    "EmptyDataSourceError": "DataSource non deve essere vuoto al caricamento iniziale poiché le colonne vengono generate da dataSource in Grid colonne in AutoGenerate",
                    "Add": "Aggiungi",
                    "Edit": "Modifica",
                    "Cancel": "Annulla",
                    "Update": "Aggiorna",
                    "Delete": "Elimina",
                    "Print": "Stampa",
                    "Pdfexport": "PDF Export",
                    "Excelexport": "Excel Export",
                    "Wordexport": "Word Export",
                    "Csvexport": "CSV Export",
                    "Search": "Ricerca",
                    "Columnchooser": "Colonne",
                    "Save": "Salva",
                    "Item": "Riga",
                    "Items": "Righe",
                    "EditOperationAlert": "Nessun record selezionato per la modifica",
                    "DeleteOperationAlert": "Nessun record selezionato per l'eliminazione",
                    "SaveButton": "Salva",
                    "OKButton": "OK",
                    "CancelButton": "Annulla",
                    "EditFormTitle": "Dettaglio di ",
                    "AddFormTitle": "Nuovo record",
                    "BatchSaveConfirm": "Sei sicuro di salvare le modifiche ?",
                    "BatchSaveLostChanges": "Le modifiche non salvate andranno perse. Sei sicuro di voler continuare?",
                    "ConfirmDelete": "Sei sicuro di voler eliminare Record?",
                    "CancelEdit": "Sei sicuro di voler annullare le modifiche?",
                    "ChooseColumns": "Scegli Colonna",
                    "SearchColumns": "ricerca colonne",
                    "Matchs": "Nessun risultato trovato",
                    "FilterButton": "Filtro",
                    "ClearButton": "Pulisci",
                    "StartsWith": "Inizia con",
                    "EndsWith": "Finisce con",
                    "Contains": "Contiene",
                    "Equal": "Uguale",
                    "NotEqual": "NON Uguale",
                    "LessThan": "Minore di",
                    "LessThanOrEqual": "Minore o uguale di",
                    "GreaterThan": "Maggiore di",
                    "GreaterThanOrEqual": "Maggiore o uguale di",
                    "ChooseDate": "Scegli una data",
                    "EnterValue": "Inserisci il valore",
                    "Copy": "Copia",
                    "Group": "Raggruppa per questa colonna",
                    "Ungroup": "Separa da questa colonna",
                    "autoFitAll": "Adatta automaticamente tutte le colonne",
                    "autoFit": "Adatta automaticamente questa colonna",
                    "Export": "Esporta",
                    "FirstPage": "Prima Pagina",
                    "LastPage": "Ultima Pagina",
                    "PreviousPage": "Pagina precedente",
                    "NextPage": "Pagina successiva",
                    "SortAscending": "Ordine crescente",
                    "SortDescending": "Ordine decrescente",
                    "EditRecord": "Modifica record",
                    "DeleteRecord": "Elimina Record",
                    "FilterMenu": "Filtro",
                    "OK": "OK",
                    "Filter": "Filtro",
                    "Clear": "Pulisci",
                    "SelectAll": "Seleziona Tutto",
                    "Blanks": "Blanks",
                    "FilterTrue": "Vero",
                    "FilterFalse": "Falso",
                    "NoResult": "Nessun risultato trovato",
                    "ClearFilter": "Pulisci Filtro",
                    "NumberFilter": "Numero di filtri",
                    "TextFilter": "Filtri di testo",
                    "DateFilter": "Filtri di data",
                    "MatchCase": "Maiuscole/Minuscole",
                    "Between": "Tra",
                    "CustomFilter": "Filtro personalizzato",
                    "CustomFilterPlaceHolder": "Immetti valore",
                    "CustomFilterDatePlaceHolder": "Scegli una data",
                    "AND": "E",
                    "OR": "O",
                    "ShowRowsWhere": "Mostra righe dove:"
                },
                "pager": {
                    "currentPageInfo": "{0} di {1} pagine",
                    "totalItemsInfo": "({0} righe)",
                    "firstPageTooltip": "Prima pagina",
                    "lastPageTooltip": "Ultima pagina",
                    "nextPageTooltip": "Pagina successiva",
                    "previousPageTooltip": "Pagina precedente",
                    "nextPagerTooltip": "Prossimo",
                    "previousPagerTooltip": "Successivo",
                    "pagerDropDown": "Righe per pagina"
                }
            }
        });




See the attached file

Attachment: Capture_4d439ad8.zip


IR Isuriya Rajan Syncfusion Team April 10, 2018 12:13 PM UTC

Hi Massimo,  

We will consider this as an issue “Provide Locale string for column chooser and custom filter labels”  and this will be include in our release which we planned to be rolled on mid of April, 2018. 

Regards, 
Isuriya R 



KO Konstantin April 17, 2018 01:34 PM UTC

Hello!
What is the "~/lib/ej2-grid.js" file in the sample project "http://www.syncfusion.com/downloads/support/directtrac/general/ze/locale-439091575.zip"? What package did it come from?


RS Renjith Singh Rajendran Syncfusion Team April 18, 2018 11:57 AM UTC

Hi Massimo, 

The file “ej2-grid.js” is a bundled form of the Grid and its dependency component source. This file can be downloaded from the following website, 


This file is referred under the _Layout.cshtml file in the sample. Please refer the code below, 

[_Layout.cshtml] 
 
<!DOCTYPE html> 
<html> 
<head> 
    ... 
   <script src="~/lib/ej2-grid.js"></script> 
    ... 
</head> 
... 
</html> 

Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran. 



CO Costa April 21, 2018 12:04 PM UTC

Hi Renjith,

when try to filter in the OrderDate column of the above example, an error occurs: JavaScript runtime error: Object.keys: argument is not an Object




RU Ramdhas  Ueikattan Syncfusion Team April 24, 2018 01:11 AM UTC

Hi Massimo, 

We have analyzed the reported scenario. We have suspect you are doesn’t load the CLDR data for the selected locale. We have loaded the CLDR data for the locale by using the AJAX in the readyStateChange event. 
Please refer the below code example. 

Code sample: 
<script> 
    function loadCultureFiles(name) { 
        var files = ['ca-gregorian.json', 'numbers.json', 'timeZoneNames.json']; 
        if (name === 'ar') { 
            files.push('numberingSystems.json'); 
        } 
        var loadCulture = function (prop) { 
            var val, ajax; 
            if (name === 'ar' && prop === files.length - 1) { 
                ajax = new ej.base.Ajax(location.origin + '/../../scripts/cldr-data/supplemental/' + files[prop], 'GET', false); 
            } else { 
                ajax = new ej.base.Ajax(location.origin + '/../../scripts/cldr-data/main/' + name + '/' + files[prop], 'GET', false); 
            } 
            ajax.onSuccess = function (value) { 
                ej.base.loadCldr(JSON.parse(value)); 
            }; 
            ajax.send(); 
        }; 
        for (var prop = 0; prop < files.length; prop++) { 
            loadCulture(prop); 
        } 
    } 
 
    document.onreadystatechange = function () { 
        if (document.readyState == 'complete') { 
            gObject = document.getElementById('Grid').ej2_instances[0]; 
            loadCultureFiles('ar'); 
            gObject.locale = 'ar'; 
        } 
    } 
</script> 



For your reference, we have created a simple sample to load the CLDR data to your project. 


Regards, 
Ramdhas  Ueikattan 


Loader.
Up arrow icon