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

Localization Settings to UK

Good morning, 

I have an issue with the Localization. I have set ".Locale('en-gb')" on the view and also changed the _Layout.cshtml to look at the Script "~/Scripts/lang/uk.js" but the Grid is still showing the date in an American format i.e. mm/dd/yyyy whereas I need it in dd/mm/yyyy. I have a work around on the grid for that column, however, when grouping on the date column it shows it in this format like in the photograph below: 



Are you able to help me on this issue? 

Much appreciated 

Thanks,
Frankie

13 Replies

SA Saravanan Arunachalam Syncfusion Team June 1, 2017 01:01 PM UTC

Hi Frankie, 
Thanks for contacting Syncfusion’s support. 
By default, the value in the groupcaption is formatted based on the specified format on that grouped column, i.e if you specified the DueDate column format as {0: mm/dd/yyyy}, group caption value will format based on this specific format which is behavior of Grid grouping. 
So, we suggest you to specify the required format in the Grid columns object itself and please refer to the below code example. 
    
@(Html.EJ().Grid<EditableOrder>("Grouping") 
        . . . 
        .Columns(col => 
        { 
            . . . 
            col.Field("OrderDate").HeaderText("Order Date").TextAlign(TextAlign.Right).Format("{0:dd/MM/yyyy hh:mm:ss}").Width(90).Add(); 
        }) 
    ) 
 
Regards, 
Saravanan A. 



FM Frankie Moran June 1, 2017 02:23 PM UTC

Hi Saravanan,

Thank you for your help that has helped and fixed the issue. 

One quick one related to another project we are currently working on. We have a summary field which calculates all the values, however, it is showing as dollars and we need it in pounds. I'm going to guess its a similar situation where you need to format the column with {{0:£}}? 

Many thanks,
Frankie


SA Saravanan Arunachalam Syncfusion Team June 2, 2017 05:05 AM UTC

Hi Frankie, 
We suspect that you have missed to set the currency format in both the Grid’s Columns and SummaryColumns property. So, please ensure whether you have set the currency format for both Columns and SummaryColumns that refer from the below code example and online demo link. 
@(Html.EJ().Grid<OrdersView>("Summary") 
          . . . 
          .SummaryRow(row => 
          { 
              row.ShowTotalSummary(false) 
                 .SummaryColumns(col => 
                 { 
                     col.SummaryType(SummaryType.Sum) 
                        .DisplayColumn("Freight") 
                        .DataMember("Freight") 
                        .Prefix("Average = ") 
                        .Format("{0:C}") 
                        .Add(); 
                      
                 }).Add(); 
          }) 
          .Locale("en-GB") 
          .Columns(col => 
          { 
            . . .              col.Field("Freight").HeaderText("Freight").TextAlign(TextAlign.Right).Width(80).Format("{0:C}").Add(); 
          }) 
) 
 
 
 We have created a sample that can be downloaded from the below link. 
Regards, 
Saravanan A. 



FM Frankie Moran June 2, 2017 08:24 AM UTC

Hi Saravanan,

Thank you for that. 

Going back to the issue about the date format being: MM/DD/YYYY hh:mm:ss this is fixed on screen, however, whenever the grid is exported with the grouping of the due date column it still has the format MM/DD/YYYY hh:mm:ss. 

How do you solve this issue on the exported files?

Thanks,
Frankie


SA Saravanan Arunachalam Syncfusion Team June 5, 2017 06:40 AM UTC

Hi Frankie, 
We are sorry that we are unable to reproduce the reported issue and we have created a sample for your requirement that can be downloaded from the below link, 
For your reference, we have attached the exported document that can be download from the below link. 
And please refer to the below links to know more about exporting. 
If the issue is still exist, could you please provide the below details? 
1.       Share your build version. 
2.       Share your view code and its controller code. 
3.       If possible, please reproduce the issue in the above sample. 
Regards, 
Saravanan A. 



FM Frankie Moran June 8, 2017 08:06 AM UTC

Good morning Saravanan,

I have fixed the date issue which now shows in the format: dd/MM/yyyy. Thank you for that. 

I am still having issues around the currency issue. It still shows as '$' when it should show as '£' and I have also noticed that negative numbers show as ($15.70) rather than -£15.70. I have placed the .Loacle("en-GB") and on the the column ensured it has the currency format. 

"col.Field("UnitPrice").AllowFiltering(false).HeaderText("Unit Price").TextAlign(TextAlign.Right).Format("{0:C2}").Width("10%").Add();"

Can you please advise? 

Thanks,
Frankie


SA Saravanan Arunachalam Syncfusion Team June 9, 2017 09:07 AM UTC

Hi Frankie, 
We are sorry that we are unable to reproduce the reported issue and we suspect that you have not load the corressponding culture in script reference. So, please ensure whether you have referred the specified culture script file in the layout page. Please refer to the below code example and online documentation link. 
<html lang="en"> 
    <head> 
        <meta charset="utf-8" /> 
        <title>@ViewBag.Title - My ASP.NET MVC Application</title> 
        <meta name="viewport" content="width=device-width" />                 
        <link rel='nofollow' href="~/Content/ej/web/default-theme/ej.web.all.min.css" rel="stylesheet" /> 
        @Scripts.Render("~/bundles/modernizr") 
        @Scripts.Render("~/Scripts/jquery-2.1.4.min.js") 
        @Scripts.Render("~/Scripts/jsrender.min.js") 
        <script src="~/Scripts/jsondata.min.js"></script> 
        <script src="~/Scripts/ej/ej.web.all.min.js"></script> 
        @*Load the cultures*@ 
        <script src="~/Scripts/ej/i18n/ej.culture.en-GB.min.js"></script> 
 
</head> 
 
Regards, 
Saravanan A. 



FM Frankie Moran June 12, 2017 10:43 AM UTC

Hi Saravanan,
 
I have just looked in the C:/ drive of where my SyncFusion is installed and the "ej.culture.en-GB.min.js" you refer to is not in the folder at all. I cannot find it at all.

Where are you able to find this file so I am able to refer to it? 

Thanks,
Frankie


SA Saravanan Arunachalam Syncfusion Team June 13, 2017 05:21 AM UTC

Hi Frankie, 
You can get the culture-specific script files either from installed location or from github location and we have already discussed this query in the following user guide documentation link. 
Regards, 
Saravanan A. 



FM Frankie Moran June 13, 2017 07:39 AM UTC

Hi Saravanan,

I seem to be missing this file from the install of SyncFusion. However, I will try GitHub and get back to you to see if it works or not! 

Thanks,
Frankie




SA Saravanan Arunachalam Syncfusion Team June 14, 2017 06:41 AM UTC

Hi Frankie, 
To translate our control content from default English to any of the culture, say For example - UK language, then you need to refer the ej.culture.en-GB.min.js and ej.localetexts.de-DE.min.js files in your application, after the reference of ej.web.all.min.js file.
Note: Seven culture-specific script and its localetext files are available in the build installed location. For all other culture files, please download from the below locations.
 
Regards, 
Saravanan A. 



FM Frankie Moran June 14, 2017 10:45 AM UTC

Hi Saravanan,

That worked!

Thanks,
Frankie


SA Saravanan Arunachalam Syncfusion Team June 15, 2017 04:54 AM UTC

Hi Frankie,  
Thanks for your update.       
We are happy that the provided information helped you. 
Regards, 
Saravanan A. 


Loader.
Live Chat Icon For mobile
Up arrow icon