- Home
- Forum
- React - EJ 2
- L10n
L10n
Hello, I'm having a problem trying to change the language of the dataGrid. I have to forget something, an import maybe? Thanks for your help: By following the doc, here is my approach:
package.json=> "@syncfusion/ej2-base":"^18.2.44"
import React from 'react';
import { L10n} from '@syncfusion/ej2-base';
import { GridComponent, ColumnDirective,
ColumnsDirective, Page, Inject, Group} from '@syncfusion/ej2-react-grids';
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',
'EmptyDataSourceError': 'DataSource darf bei der Erstauslastung nicht leer sein, da Spalten aus der dataSource im AutoGenerate Spaltenraster',
'Item': 'Artikel',
'Items': 'Artikel'
}
}
const Grid = () => {
...
return(
<Fragment>
...
<GridComponent
locale="de-DE"
dataSource={ ordersArray }
childGrid={childGrid}
allowSorting={true}
allowPaging={ true }
filterSettings={FilterOptions}
toolbar={toolbarOptions} height={'60vh'}
showColumnChooser={true}
pageSettings={{ pageSize : 6 }}
allowFiltering={ true }
allowGrouping={ true }
allowReordering={true} >
<ColumnsDirective>
<ColumnDirective type='checkbox' allowSorting={false} allowFiltering={false} width='50'/>
<ColumnDirective field='number' headerText='N°' width='120'/>
....
</ColumnsDirective>
<Inject services={[Page, Filter, Group]}/>
</GridComponent>
)
}
export default Grid
})
SIGN IN To post a reply.
3 Replies
1 reply marked as answer
PG
Praveenkumar Gajendiran
Syncfusion Team
July 10, 2020 11:41 AM UTC
Hi Baron Eric,
Greetings from Syncfusion support.
We have validated your screenshot and checked the reported problem at our end. Also we may suspect that the problem occurs due to not closing your “L10n.load()” method.
Here, we have prepared a sample using “L10n.load()” method in latest version(18.2.44) and it works fine(Localization). Find the below sample for your reference.
Greetings from Syncfusion support.
We have validated your screenshot and checked the reported problem at our end. Also we may suspect that the problem occurs due to not closing your “L10n.load()” method.
Here, we have prepared a sample using “L10n.load()” method in latest version(18.2.44) and it works fine(Localization). Find the below sample for your reference.
Sample: https://stackblitz.com/edit/react-yuqyff?file=index.js
Documentation link: https://ej2.syncfusion.com/react/documentation/grid/global-local/#loading-translations
Kindly get back to us If you are still facing the problem.
Documentation link: https://ej2.syncfusion.com/react/documentation/grid/global-local/#loading-translations
Kindly get back to us If you are still facing the problem.
Regards,
Praveenkumar G
Praveenkumar G
Marked as answer
BE
Baron Eric
July 10, 2020 02:00 PM UTC
Hello and thank you for your quick response.
Indeed I went a bit quickly on the copy-paste but the object “L10n.load ()” was well closed in my code.
On the other hand, thanks to your stackblitz, I could see that I was missing 2 packages:
"@syncfusion/ej2-file-utils": "^18.2.44"
"@syncfusion/ej2-react-base": "18.2.44" instead "@syncfusion/ej2-base": "18.2.44"
Problem solved, thanks a lot Praveenkumar!
AG
Ajith Govarthan
Syncfusion Team
July 13, 2020 12:45 PM UTC
Hi Baron,
Thanks for the update.
We are happy to hear that your issue has been resolved.
Please get back to us if you need further assistance.
Regards,
Ajith G.
SIGN IN To post a reply.
- 3 Replies
- 3 Participants
- Marked answer
-
BE Baron Eric
- Jul 9, 2020 02:38 PM UTC
- Jul 13, 2020 12:45 PM UTC