What is the i18n translation key for Grid - TextFilter "Does not contain"

Missing the key for above option..... "DoesNotContain" does not work.

Thx. for any help

Dschuli


5 Replies

RR Rajapandi Ravi Syncfusion Team November 20, 2023 12:12 PM UTC

Hi Julius,


Greetings from Syncfusion support


Based on your requirement, you want to localize the EJ2 Grid in your project with Grid filter operators.


By default, we have used en-US culture in the EJ2 Components. If you want to use different culture in EJ2 Components, you need to load the corresponding CLDR files for the respective cultures. By using setCulture method you can change the culture as you want. Based on your requirement we have prepared a sample and achieved your requirement, please refer the below code example, sample and documentation for more information.


 

  import * as cagregorian from '../locale/ca-gregorian.json';

  import * as currencies from '../locale/currencies.json';

  import * as numbers from '../locale/numbers.json';

  import * as timeZoneNames from '../locale/timeZoneNames.json';

  import fr from '../locale/fr.json';

 

loadCldr(cagregorian, currencies, numbers, timeZoneNames); // load json cldr files

 

L10n.load(fr);

setCulture('fr'); // Change the culture of Syncfusion component

setCurrencyCode('EUR'); // Change the currency code


Grid Internalization:

https://ej2.syncfusion.com/angular/documentation/grid/global-local/#internationalization

https://ej2.syncfusion.com/angular/documentation/common/globalization/internationalization


Sample:


Screenshot:



Regards,

Rajapandi R


Attachment: angularlocale_6750380.zip


JP Julius Peter November 20, 2023 04:19 PM UTC

Thanks for the quick answer, Rajapandi.

As I understand - according to docs, you have to provide the translations for non-US in your code Like:

L10n.load({
    'de-DE': {
        grid: {
            EmptyRecord: 'Keine Aufzeichnungen angezeigt',
            GroupDropArea: 'Ziehen Sie einen Spaltenkopf hier, um die Gruppe ihre Spalte',
            UnGroup: 'Klicken Sie hier, um die Gruppierung aufheben',

If there is an existing translation definition for (in my case German), I'd like instructions on how to access/use (have not found anything about that in the docs). It would even help to get a list of all properties/keys of the translation object for the different (parts of a) control.

Anyhow, I did create my own L10n.load definition, but it does not work for the text-filter item "Does not contain",

Image_2272_1700496829044


So I assume the key "Does NotContain" is incorrect and I'm looking for the correct one.

StartsWith: 'Beginnt mit',
EndsWith: 'Endet auf',
Contains: 'Enthält',
DoesNotContain: 'Enthält nicht',
Equal: 'Gleich',
NotEqual: 'Ungleich',
LessThan: 'Kleiner',
LessThanOrEqual: 'Kleiner/Gleich',
GreaterThan: 'Größer',
GreaterThanOrEqual: 'Größer/Gleich',


Thanks for your help!

Ju



RR Rajapandi Ravi Syncfusion Team November 22, 2023 05:44 AM UTC

Julius,


Since you like to translate the text using keywords, you can use the "NotContains" keyword to achieve your requirement. Please refer the below code example for more information.


 

          StartsWith: 'Beginnt mit',

          EndsWith: 'Endet auf',

          Contains: 'Enthält',

          NotContains: 'enthält nicht',

          DoesNotContain: 'Enthält nicht',

          Equal: 'Gleich',

          NotEqual: 'Ungleich',

          LessThan: 'Kleiner',

          LessThanOrEqual: 'Kleiner/Gleich',

          GreaterThan: 'Größer',

          GreaterThanOrEqual: 'Größer/Gleich',

 



JP Julius Peter November 22, 2023 10:12 AM UTC

Thanks, Rajapandi.

That was the info I was looking for - works perfectly. I did my own translations as I was unaware of the @syncfusion/ej2-locale package (did not find any hint for this in the grid docs). This package makes life a bit easier ......




RR Rajapandi Ravi Syncfusion Team November 23, 2023 01:40 PM UTC

Julius,


We are happy to hear that our provided solution was helpful to achieve your requirement.


Please get back to us if you have any further assistance.


Loader.
Up arrow icon