Furkan Kırcı
Furkan Kırcı

Reputation: 1

Primereact Datatable Language

I have a project that I developed using primereact and I use primereact/datatable in this project. Things like filtering operations and buttons in this table are in English, which is fine for me, but since the users of the application will be Turkish, I want some things, if not everything, to be in Turkish. For example, when filtering in primereact/datatable, there are "Match All", "Match Any" options in the filter window that opens. Apart from these, there are options such as "Starts With", "Contains",... as filtering criteria. How can I translate these into Turkish or the articles written in Turkish? If I have the opportunity to change it, how can I do this?

https://stackblitz.com/run?file=src%2FApp.jsx

This is from a documentation published by primereact for its database.

In short, how can I translate primereact into Turkish?

By accessing the CSS-related classes and using the "::after" or "::before" options, I can add whatever I want next to the texts with the "nth-child" property of the relevant class, but this can be done with the "Match All" and "Match Any" options in two different searches. It also affects the "Starts With" and "Contains" options.

In addition, when I access the relevant classes during the initial rendering of my component and want to change things like the "innerHTML" or "aria-label" attribute, it cannot find these classes because there are no elements with these classes in my HTML page unless I open the menu by clicking on the menu where I entered the filtering criteria.

Upvotes: 0

Views: 271

Answers (1)

user25539973
user25539973

Reputation:

if you are still looking for a solution to this issue, I can help you. Primeract default language is set to 'en', you need to make some adjustments to change it to 'tr'. This issue is explained in the Locale field in the Configuration tab of Primeract's own documentation. You can add addLocale('tr', {json language}) language options in json format there, assign it as value and use it in your application.

Upvotes: 0

Related Questions