Translation of pagination in Datagrid2

0
Hello everyone, I wanted to change the language of pagination in datagrid2, (English - {1} of {2} to {3} to French - {1} à {2} de {3}) I have tried the batch translation in the language section, but it seems to be working for DataGrid but not for datagrid2 any solution to achieve this behavior. Thanks in advance.
asked
6 answers
1

Hi Chethana,

Translation of DG2 label is not supported by batch translate , but can be done via js 

try this in html snippet setting Javascript 

setTimeout(function() { 
    function translatePagingStatusToFrench() { 
        var pagingStatusElements = document.querySelectorAll('.paging-status'); 
        pagingStatusElements.forEach(function(pagingStatus) { 
            var text = pagingStatus.innerHTML.trim(); 
            var parts = text.match(/(\d+)\s*to\s*(\d+)\s*of\s*(\d+)/); 
            if (parts && parts.length === 4) { 
                var start = parts[1]; 
                var end = parts[2]; 
                var total = parts[3]; 
                var frenchText = `${start} à ${end} sur ${total}`; 
                pagingStatus.innerHTML = frenchText; 
            } 
        }); 
    } 
    
    translatePagingStatusToFrench(); 
    
    var paginationButtons = document.querySelectorAll('.pagination-button'); 
    paginationButtons.forEach(function(button) { 
        button.addEventListener('click', function() { 
            setTimeout(translatePagingStatusToFrench, 500); 
        }); 
    }); 
}, 2000);

 

Hope it helps!

answered
0

Given issue above is working fine in DataGrid but issue is coming for datagrid2 only. Please suggest if any one has implemented this.

image.png

answered
0

You can do so via css. See this doc https://community.mendix.com/link/space/ui-%26-front-end/exchanges/41

answered
0

To be honest this is no solution, these are all workarounds for a BUG in the datagrid2 which is a Mendix widget. Mendix wants to be a Low-Code platform for big sized companies and is high priced. As a customer workarounds like this are not acceptable. This must be fixed!

answered
0

DataWidgets 3.9.0 has an option to set the current page and total record count on page variables or attributes, allowing you to take full control of showing these values.

answered
0

hi,


In Data Grid 2, the pagination text (e.g., “{1} to {2} of {3}”) is currently not configurable via the standard Mendix language translation (Texts → Language).

Why your translation is not working

  • The classic Data Grid uses Mendix system texts → so translations work
  • Data Grid 2, however, is a pluggable React widget
  • Its pagination labels are handled internally and are not exposed to Mendix’s translation system

So your observation is correct:

→ Batch translation will not affect Data Grid 2 pagination

Current supported options

1. No direct configuration (current limitation)

As of now, there is:

  • No built-in property
  • No system text key
  • No official configuration

to change pagination text in Data Grid 2

2. Recommended approach (practical workaround)

If localization is required, the only reliable approach is:

Customize the Data Grid 2 widget

Steps:

  1. Download Data Grid 2 from Marketplace (GitHub source)
  2. Locate pagination component (React code)
  3. Update the label format (e.g., French format)
  4. Rebuild and use your custom widget

3. Temporary workaround (not recommended for production)

You can override using CSS:


.mx-datagrid2-paging-text {
    display: none;
}

Then add your own label separately in the UI.

Limitation:

  • You will lose dynamic numbers unless you rebuild logic manually


  • For production-grade multilingual apps → custom widget modification is the correct approach
  • Otherwise → wait for Mendix to expose pagination labels in future updates


  • Data Grid 2 pagination is not part of Mendix language texts
  • Translation via standard language settings will not work
  • Proper solution: customize the widget
  • This is a known limitation in current versions


answered