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

how to localize excel-like _date_ filter captions in GridGroupingControl

hi,
how can I localize captions displayed in excel-like filter of type datetime in GridGroupingControl ?
(captions 1 to 4):



regards,
Adam


3 Replies

AR Arulpriya Ramalingam Syncfusion Team March 16, 2018 12:44 PM UTC

Hi Adam, 
 
Thanks for contacting Syncfusion support. 
 
Query 
Response 
 
1)      The “Sort Oldest to Newest” and “Sort Newest to Oldest” strings in GridExcelFilter are used internally to set the strings in GridExcelFilter. This can be localized by implementing the ILocalizationProvider interface and modify the strings based on default string by using the GetLocalizedString () method. Please refer to the below code and sample, 
 
Code example 
 
public string GetLocalizedString(System.Globalization.CultureInfo culture, string name, object obj) 
{ 
    switch (name) 
    { 
        //Some code 
        //To localize the DateFilters 
        case "DateTimeFilters": 
            return "Terminzeit filter"; 
        //To set string for Sorting operations 
        case "SortOldesttoNewest": 
            return "&SortierenOldbisNew"; 
        case "SortNewesttoOldest": 
            return "&SortierenNewbisOld"; 
    } 
} 
2)      The “Date Filters” item can be localized by replacing the string "DateTimeFilters" in GetLocalizedString() method. Please make use of the attached sample. 
3)      As per our current support, CheckBox items of GridExcelFilters will be loaded based on the unique values of the records in the grid and the “(Blanks)” for Null/Empty values are added internally at our end. So, we have logged a bug report to provide localization support for “(Blanks)” string in GridExcelFilter. The fix will be included in our upcoming main release 2018_volume1_Sp2. 
4)      The month and year of DateFilters menu item can be replaced by strings to be displayed in menu items based on the default string. Please refer to the below code and sample, 
 
Code example 
 
public string GetLocalizedString(System.Globalization.CultureInfo culture, string name, object obj) 
{ 
    switch (name) 
    { 
        //Some code 
        //To localize the DateFilters dropdown items 
        case "Office2007FilterDateEquals": 
            return "gleich"; 
        case "Office2007Filterbefore": 
            return "Vor"; 
        case "Office2007Filterafter": 
            return "nach"; 
        case "Office2007Filterbetween": 
            return "zwischen"; 
        case "Office2007Filtertomorrow": 
            return "Morgen"; 
        case "Office2007Filtertoday": 
            return "heute"; 
        case "Office2007Filteryesterday": 
            return "gestern"; 
        case "Office2007FilternextWeek": 
            return "for nextweek"; 
        case "Office2007FilterthisWeek": 
            return "for This week"; 
        case "Office2007FilterlastWeek": 
            return "for last week"; 
        case "Office2007FilternextMonth": 
            return "for next month"; 
        case "Office2007FilterthisMonth": 
            return "for this month"; 
        case "Office2007FilterlastMonth": 
            return "for last month"; 
        case "Office2007FilternextQuarter": 
            return "for next quarter"; 
        case "Office2007FilterthisQuarter": 
            return "for this quarter"; 
        case "Office2007FilternextYear": 
            return "for next year"; 
        case "Office2007FilterthisYear": 
            return "for this year"; 
        case "Office2007FilterlastYear": 
            return "Terminzeit filter"; 
        case "Office2007FilteryearToDate": 
            return "for year to date"; 
        case "Office2007FilterallDatesInThePeriod": 
            return "for period"; 
        case "Office2007FiltercustomDateTimeFilter": 
            return "For Custom date filter"; 
        case "Office2007Filterquarter1": 
            return "For quarter1"; 
        case "Office2007Filterquarter2": 
            return "for quarter2"; 
        case "Office2007Filterquarter3": 
            return "for quarter3"; 
        case "Office2007Filterquarter4": 
            return "for quarter4"; 
        case "Office2007Filterjanuary": 
            return "for january"; 
        case "Office2007Filterfebruary": 
            return "for frbruary"; 
        case "Office2007Filtermarch": 
            return "for march"; 
        case "Office2007Filterapril": 
            return "for april"; 
        case "Office2007Filtermay": 
            return "for may"; 
        case "Office2007Filterjune": 
            return "for june"; 
        case "Office2007Filterjuly": 
            return "for july"; 
        case "Office2007Filteraugust": 
            return "for augest"; 
        case "Office2007Filterseptember": 
            return "for september"; 
        case "Office2007Filteroctober": 
            return "for october"; 
        case "Office2007Filternovember": 
            return "for novermber"; 
        case "Office2007Filterdecember": 
            return "for december"; 
       } 
} 
 
 
Note 
We already provided a dashboard sample to localize the default strings in GridExcelFilter and GridDynamicFilters. Please make use of the sample in your local machine at the below location, 
 
Dashboard sample location: <Install_Location>\Syncfusion\EssentialStudio\<Product_Version>\Windows\Grid.Grouping.Windows\Samples\Localization Samples\Localization Demo\CS 
 
Regards, 
Arulpriya 



AM amsm March 17, 2018 02:26 PM UTC

thank You very much for help.


AR Arulpriya Ramalingam Syncfusion Team March 19, 2018 04:05 AM UTC

Hi Adam, 
 
Thanks for the update. 
 
We are glad that the provided solution resolved your scenario. Please let us know, if you need any further assistance. 
 
Regards, 
Arulpriya 


Loader.
Live Chat Icon For mobile
Up arrow icon