Custom translation of DataGrid Pagination fields "1 of 5 pages" and "Row per page"

Hi friends,

How can we custom translate or inject custom text for SfDataPager:
sfgriddata_pagination.png

Thanks in advance!​


4 Replies 1 reply marked as answer

TP Tamilarasan Paranthaman Syncfusion Team October 19, 2023 12:26 PM UTC

Hi Dorin Buraca,

Currently, the DataGrid doesn't support customizing the static labels in the SfDataPager directly. However, the SfDataGrid offers localization support, allowing you to translate these static labels into your preferred language. You can achieve this by configuring the `MaterialApp.locale` property to correspond with the desired locale.


As demonstrated in the attached sample, we have set the application's locale to Spanish. This example serves as a reference to help you implement the localization feature. If this approach does not meet your requirements, please provide more details about your specific customization needs, and we will be happy to assist further.

void main() {

  runApp(const MyApp());

}

 

class MyApp extends StatelessWidget {

  const MyApp({Key? key}) : super(key: key);

 

  @override

  Widget build(BuildContext context) {

    return const MaterialApp(

      localizationsDelegates: [

        GlobalMaterialLocalizations.delegate,

        GlobalCupertinoLocalizations.delegate,

        GlobalWidgetsLocalizations.delegate,

        SfGlobalLocalizations.delegate

      ],

      supportedLocales: [

        Locale('zh'),

        Locale('ar'),

        Locale('fr'),

        Locale('es'),

      ],

      locale: Locale('es'),

      title: 'Syncfusion DataGrid Demo',

      home: MyHomePage(),

    );

  }

}

 

class MyHomePage extends StatefulWidget {

  const MyHomePage({Key? key}) : super(key: key);

 

  @override

  MyHomePageState createState() => MyHomePageState();

}



Regards,

Tamilarasan


Attachment: sample_7f2b9ed.zip


DO Dorin October 19, 2023 01:41 PM UTC

Hello Tamilarasan,

I know you offer localizations for your widgets, but it's not supported for all languages, and in our project, we use a custom package for translations  easy_localization: ^3.0.3 ​, so we can't set the localizations delegates as you suggest unfortunately :(.

Example:
1.png

2.png


Thanks again for your great support!

Kind regards,
Dorin



TP Tamilarasan Paranthaman Syncfusion Team November 21, 2023 03:54 PM UTC

Dorin Buraca,


We have considered your request as a feature. We will implement this feature in any of our upcoming releases. At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. We will let you know when this feature is implemented. We appreciate your patience until then.  


Thank you for requesting this feature and helping us define it. We are always trying to make our products better and feature requests like yours are a key part of our product growth efforts.  


You can also communicate with us regarding the open features any time using our Feature Report page.   


Feedback link:  https://www.syncfusion.com/feedback/47936/support-for-setting-custom-text-for-datapager-static-labels 


If you have any more specification/suggestions to the feature request, you can add it as a comment in the portal and cast your vote to make it count.  


Regards,

Tamilarasan


Marked as answer

DO Dorin November 21, 2023 05:14 PM UTC

Thanks a lot  Tamilarasan for your great support, as well for considering this a good feature for SfGrids


Loader.
Up arrow icon