We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Localization

Hi,
I would like to change the localization of EJ1 elements, like grids.

Using locale: "de-DE" or locale: "fr-FR" doesn't work.

I have tried adding scripts like
"Scripts/ej.localetexts.fr-FR.js" or "Scripts/ej.localetexts.de-DE.js"

Or targeting the element using :

ej.Grid.Locale["de-DE"] = { ... }

Still no success. Is there any NuGet i should download to get it working ?
Thanks

7 Replies

VN Vignesh Natarajan Syncfusion Team February 4, 2019 10:07 AM UTC

Hi Erik, 
 
Thanks for using Syncfusion products. 
 
Query: “I would like to change the localization of EJ1 elements, like grids. 
 
From your query we understand that you are facing issue while defining the locale to ejGrid. We have prepared a sample as per your suggestion and we are not able to reproduce the reported issue at our end. To apply localization to Grid, locale property must be used to define in ejGrid. refer the below code example 
 
 
@*Kindly ensure to refer the corresponding culture and localetext*@ 
 
<script src="~/lib/syncfusion-ej-global/i18n/ej.culture.fr-FR.min.js"></script> 
<script src="~/lib/syncfusion-ej-global/i18n/ej.culture.de-DE.min.js"></script> 
<script src="~/lib/syncfusion-ej-global/l10n/ej.localetexts.de-DE.min.js"></script> 
<script src="~/lib/syncfusion-ej-global/l10n/ej.localetexts.fr-FR.min.js"></script> 
 
 
<ej-grid id="FlatGrid" allow-paging="true" locale="fr-FR"> 
    <e-datamanager json="(IEnumerable<object>)ViewBag.datasource" adaptor="remoteSaveAdaptor" /> 
    …………………………………………. 
</ej-grid> 
 
<br> 
 
<ej-grid id="FlatGrid1" allow-paging="true" locale="de-DE"> 
    <e-datamanager json="(IEnumerable<object>)ViewBag.datasource" adaptor="remoteSaveAdaptor" /> 
……………………………………………………… 
</ej-grid> 
 
 
 
 
<script type="text/javascript"> 
    ej.Grid.Locale["fr-FR"] = { 
    EmptyRecord: "Aucun enregistrement à afficher", 
………………………………………………………………………… 
                                    UnGroup: "Cliquez ici pour dégrouper" 
        }; 
    ej.Pager.Locale["fr-FR"] = { 
        pagerInfo: "{0} de {1} Pages ({2} Articles)", 
        firstPageTooltip: "Aller à la première page", 
…………………………………………. 
    }; 
    
 
    ej.Grid.Locale["de-DE"] = { 
        EmptyRecord: "Keine Aufzeichnungen angezeigt", 
………………………………………. 
    }; 
 
    ej.Pager.Locale["de-DE"] = { 
………………………………………………………………………. 
        previousPagerTooltip: "Zum vorherigen Pager" 
    }; 
    
 
 
</script> 
    
Refer the below screenshot for the output 
 
 
 
 
For your convenience we have attached the sample with 2 Grid (fr-FR locale and de-DE locale) which can be downloaded from below link 
 
 
Refer our help documentation  
 
 
After refering the above sample, still you are facing kindly share the following details 
 
  1. Share the screenshot of issue you are facing.
  2. Share the Grid rendering code.
  3. Share your essential studio version.(xx.x.x.xx)
  4. If possible try to reproduce the reported issue at our end.
  
Regards, 
Vignesh Natarajan    
 



ER Erik February 19, 2019 10:14 AM UTC

Hi,

I still have an issue with the date picker of the filter menu in a grid.

The date format in the calendar is  in US format. I have set my date columns format to dd/MM/yyyy and i would like the same format for the filter menu.

Thanks for your support

Attachment: filter_bd12973b.rar


VN Vignesh Natarajan Syncfusion Team February 20, 2019 06:02 AM UTC

Hi Erik, 

Query#:- I still have an issue with the date picker of the filter menu in a Grid. 

From your query, we suspect that you are facing issue with datetimepicker (as per the screenshot shared) in the filter menu. We have analyzed your query and we have prepared sample by applying Format dd/MM/yyyy but we are unable to reproduce the problem at our end. Filter menu maintains the same format as like given in the column’s format. 

Refer to the sample Link:- 

Screenshot:- 
 

After following the above solution still facing the issue, please share us the following details. 

  1. Complete Grid code example(both in server and client side).
  2. How you have bind dataSource for the date Column.
  3. Share the video demonstration along with replication procedure of the reported issue
  4. If possible replicate the issue in the above sample and revert us back.
  5. Product version details.(xx.x.x.xx)

Regards, 
Vignesh Natarajan. 
 



ER Erik February 21, 2019 11:28 AM UTC

Hi Vignesh,

The columns of my grids are dynamic (img1). I use an object containing a list of Syncfusion columns (img2). I set the fomat of DateTime columns to "{0:dd/MM/yyyy}", just like what you did in the sample you sent me (img3).

The columns format is indeed in dd/MM/yyyy but the datepicker from the menu filter is still in US format : MM/dd/yyyy (img4).

Regards,

Erik




Attachment: IMG_95796f5d.rar


EDIT : Also, i would like to export my grid to an excel file. Could you show me the C# code in net core razor page format?
Tell me if i have to start a new thread for this specific question.




VN Vignesh Natarajan Syncfusion Team February 22, 2019 10:35 AM UTC

Hi Erik, 
 
Thanks for the update. 
 
Query1: “The columns format is indeed in dd/MM/yyyy but the datepicker from the menu filter is still in US format : MM/dd/yyyy (img4). 
 
From your query, we understand that you are facing issue with datetimepicker in the menu filter. We are able to reproduce the reported issue only when we refer the lower version of Essential studio (version below 16.2.0.41). We have fixed the reported issue from version 16.2.0.46. So to resolve the reported issue, we suggest you to upgrade to our latest source (16.4.0.52) or minimum of (16.2.0.46).   
 
Please find the release note for the same from below link 
 
 
If you are still facing the issue, kindly share your essential studio version(xx.x.x.xx). 
 
Query: “Also, i would like to export my grid to an excel file. Could you show me the C# code in net core razor page format? 
 
We have already documented your query in our help documentation. So kindly refer the below link for the UG documentation to how to  
 
 
 
Please get back to us if you have further queries. 
 
Regards, 
Vignesh Natarajan   



ER Erik February 25, 2019 11:22 AM UTC

Hi Vignesh,

Indeed, using the latest version of EJ1 has fixed the DatePicker format issue.

Concerning the grid export, the ConvertGridObject method from public ActionResult ExportToExcel(string GridModel) is unknown.

Do you know what might be missing ?

So far i am using :
Syncfusion.EJ.Export;
Syncfusion.XlsIO;

Thanks






VN Vignesh Natarajan Syncfusion Team February 26, 2019 10:34 AM UTC

Hi Erik, 
 
Thanks for the update. 
 
Query: Concerning the grid export, the ConvertGridObject method from public ActionResult ExportToExcel(string GridModel) is unknown. 
 
From your query, we understand that you are facing issue while exporting. But we are unable to reproduce the reported issue at our end. We have prepared sample with Exporting in Asp.Net core. You need to define ConvertGridObject method as like given below:-  
 
<ej-grid id="FlatGrid" 
         allow-sorting="true" 
         selectiontype="Multiple" datasource="ViewBag.datasource" allow-paging="true" toolbar-click="click"> 
    <e-edit-settings allow-adding="true" allow-editing="true" allow-deleting="true" edit-mode="@(EditMode.Normal)"></e-edit-settings> 
    <e-toolbar-settings show-toolbar="true" toolbar-items=@(new List<string>() {"excelExport","wordExport","pdfExport" })> 
    </e-toolbar-settings> 
    <e-columns> 
        <e-column field="OrderID" header-text="Order ID" text-align="Right" width="75" is-primary-key="true"></e-column> 
          .    .   .  
    </e-columns> 
</ej-grid> 
 
Serverside:- 
 
      public ActionResult GridFeatures() 
        { 
            if (order.Count() == 0) 
                BindDataSource(); 
            ViewBag.datasource = order; 
            return View(); 
        } 
 
        public ActionResult ExportToExcel(string GridModel) 
        { 
            ExcelExport exp = new ExcelExport(); 
            var DataSource = order; 
            GridProperties gridProp = ConvertGridObject(GridModel); 
            GridExcelExport excelExp = new GridExcelExport(); 
            excelExp.FileName = "Export.xlsx"; excelExp.Excelversion = ExcelVersion.Excel2010; 
            excelExp.Theme = "flat-saffron"; 
            return exp.Export(gridProp, DataSource, excelExp); 
        } 
 
        public ActionResult ExportToWord(string GridModel) 
        { 
            
 
            WordExport exp = new WordExport(); 
            var DataSource = order; 
            GridProperties gridProp = ConvertGridObject(GridModel); 
            GridWordExport wrdExp = new GridWordExport(); 
            wrdExp.FileName = "Export.docx"; wrdExp.Theme = "flat-saffron"; 
            return exp.Export(gridProp, DataSource, wrdExp); 
        } 
 
        private GridProperties ConvertGridObject(string gridProperty) 
        { 
 
            GridProperties gridProp = new GridProperties(); 
            gridProp = (GridProperties)JsonConvert.DeserializeObject(gridProperty, typeof(GridProperties)); 
            return gridProp; 
        } 
 
 
For your convenience we have prepared a sample which can be downloaded from below link 
 
 
Please get back to us if you have further queries. 
 
Regards, 
Vignesh Natarajan. 
 


Loader.
Live Chat Icon For mobile
Up arrow icon