Grid Pager Translation missing attribute?

Hello,

Recently I translated my Grids using the provided information here.
Everything is working great, apart from a single case.
In pager on the bottom right corner where it says how many items there are in the grid, translation is not working when I have only a single entry in the grid.
I see that the translation resources mention "totalItemsInfo" that is for multiple items, and I have translated that, but I don't see any attribute that equals to "1 item" which would show up when there is only a single item in the Grid.
Is there an attribute for that, that I missed?
Thank you in advance!

Best regards.

3 Replies 1 reply marked as answer

PG Praveenkumar Gajendiran Syncfusion Team June 14, 2021 08:51 AM UTC

Hi Spyros, 
Thanks for contacting Syncfusion support. 
Based on your query, we could see that you want to localize the default text content of the Grid pager total item info for single item in the Grid, for this we suggest you to set the required culture localization in the Grid(using locale property) and use the base’s L10n load function to load translation object in an application. This is demonstrated in the below code snippet,  we have set the locale culture as ‘de-DE’(German) for the Grid, 

import { L10n } from '@syncfusion/ej2-base'; 
 
L10n.load({ 
  'en-US': { 
    pager: { 
      totalItemInfo: '({0} Beitrag)',  // Locale key words for total item info for single item in the Grid 
      totalItemsInfo: '({0} Beiträge)' 
    } 
  } 
}); 
export class Paging extends SampleBase { 
  render() { 
    return ( 
      <div className="control-pane"> 
        <div className="control-section"> 
          <GridComponent 
            dataSource={data.slice(0, 1)} 
            locale="en-US" 
            allowPaging={true} 
            height={365} 
            pageSettings={{ pageCount: 4, pageSizes: true }} 
          > 
            <ColumnsDirective> 
            </ColumnsDirective> 
            <Inject services={[Page]} /> 
          </GridComponent> 
        </div> 
      </div> 
    ); 
  } 
 
render(<Paging />, document.getElementById('sample')); 

We have prepared a sample based on this for your reference.

Sample: https://stackblitz.com/edit/react-xyyjcr
 
Note:  “totalItemInfo” Locale key word is not be included in Localization documentation. Therefore, We have logged a documentation task to update our documentation and it will be refreshed online as soon as possible.  
 
We suggest you to achieve your requirement using above solution. Please get back to us if you need further assistance.

Regards,
Praveenkumar G
 


Marked as answer

SP Spyros June 14, 2021 09:09 AM UTC

Dear Praveenkumar G,

Thank you for your reply, the provided locale word (totalItemInfo) works great!
Have a great day!

Best regards,
Spyros


PG Praveenkumar Gajendiran Syncfusion Team June 15, 2021 10:20 AM UTC

Hi Spyros, 

You are welcome. We glad that the provided solution resolved your requirement. 

Please get back to us if you need further assistance. 

Regards, 
Praveenkumar G 


Loader.
Up arrow icon