Hi friends,
How can we custom translate or inject custom text for SfDataPager:
Thanks in advance!
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
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:
Thanks again for your great support!
Kind regards,
Dorin
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
Thanks a lot Tamilarasan for your great support, as well for considering this a good feature for SfGrids