Grid DateTime - Time picker gets broken by internationalization

Please take a look at this example where 

setCulture('de-DE');


Breaks the time picker as such:

Image_5543_1701020414492

Image_8692_1701020445212

https://stackblitz.com/edit/github-qcvsa5?file=src%2Fapp.component.ts,src%2Fdatasource.ts,src%2Fapp.module.ts


If you comment it out then it works fine.


8 Replies

DM Dineshnarasimman Muthu Syncfusion Team December 1, 2023 10:21 AM UTC

Hi Frank Alberts,


Greetings from Syncfusion Support.


We have reviewed your query about issue in the dateTimePicker when setting culture using setCulture. We have attached a sample on implementing the setCulture in the grid. The code snippet and sample have been attached for your reference. Also we have attached the image of the output and Knowledge Base link on how to set different cultures in Angular Grid.


 

import de from './de.json'

// localize the default text

L10n.load(de);

loadCldr( cagregorian,currencies, numbers, timeZoneNames);

setCulture('de'); // Change the Grid culture

 



Image of the Dialog Editing:



KB link : https://support.syncfusion.com/kb/article/11453/how-to-set-different-cultures-in-javascript-and-angular-grid


Please let us know if you need any further assistance.


Regards,

Dineshnarasimman M


Attachment: CultureInAngularGrid_6aeb61a6.zip


JB Jonas Blazinskas December 6, 2023 05:46 PM UTC

Hi I was following along but I might have made a mistake somewhere? As one of the grids is working but the other is not, they are part of the same module/component which in itself is imported to the app module and the translation code is there:

Image_9753_1701883745394


import { L10n, setCulture,loadCldr,setCurrencyCode } from '@syncfusion/ej2-base';

import * as cagregorian from 'cldr-data/main/de/ca-gregorian.json';
import * as currencies from 'cldr-data/main/de/currencies.json';
import * as numbers from 'cldr-data/main/de/numbers.json';
import * as timeZoneNames from 'cldr-data/main/de/timeZoneNames.json';

import EJ2_LOCALE from "../../node_modules/@syncfusion/ej2-locale/src/de.json";
L10n.load({ de: EJ2_LOCALE.de });
loadCldr(cagregorian, currencies, numbers, timeZoneNames);
setCulture("de");




Mind you I had to change the import EJ2_LOCALE due to the following error:

/src/app/app.component.ts:17:6-19 - Error: Should not import the named export 'de' (imported as 'EJ2_LOCALE') from default-exporting module (only default export is available soon)

maybe that's an issue?




















JB Jonas Blazinskas December 6, 2023 05:49 PM UTC

I would like to report a bug as well there is missing translation on AdaptiveUI for grid

Image_5112_1701884983510



JB Jonas Blazinskas December 6, 2023 05:55 PM UTC

had this tagging that one grid..

    [locale]="'de-DE'"


JB Jonas Blazinskas December 6, 2023 05:55 PM UTC

adaptive UI bug is still a thing tho



JB Jonas Blazinskas December 6, 2023 06:00 PM UTC

Ok is translated to "In order" ? that seems wrong and it messes with UI as it stacks the button do to words being too long.

Image_6139_1701885565443



JB Jonas Blazinskas December 6, 2023 06:07 PM UTC

https://github.com/syncfusion/ej2-locale/pull/189

Created a pull request for that one



DM Dineshnarasimman Muthu Syncfusion Team December 14, 2023 03:26 AM UTC

Hi Frank Alberts,


We have reviewed your query and understood that you need to Customize the text for OKButton in the filter dialog and also apply the localization in two grid. We suggest you to customize the text in the de.json file based on requirement. Also to set localization for other grid set locale as 'de' in the other grid. We have attached the code snippet of the implementations and snapshot for your reference. Also attached local angular sample for you reference.



[de.json]

 

"de": {

"grid": {

  "SaveButton": "Speichern",

  "OKButton": "está bem",

}}

 



[app.component.html]

 

<ejs-grid #grid height="500" width="500" locale="de" [dataSource]='employeeData' [allowFiltering]="true" [allowSorting]="true" [filterSettings]='filterSettings' allowPaging='true' [pageSettings]='pageSettings' [editSettings]='editSettings' [toolbar]='toolbar'>

 


Images:


Localization in Two Grids:


Filter OKButton:



If this didn't your requirement, can you please provide the following information which will be very useful for us to validate further.


  • Can you please ensure your code with the sample which we have provided.
  • If you still face issue, can you please replicate the issue in the sample which we have provided, so that we can identify the issue.
  • As you have mentioned about issue in the adaptive UI, can you please elaborate your issue so that we can understand better and provide solution.


Regards,

Dineshnarasimman M



Attachment: CultureChangeInGrid_62332267.zip

Loader.
Up arrow icon