Posts

Showing posts from August, 2020

How to Internationalizing your Flutter apps ?

Image
First Reading: https://flutter.dev/docs/development/accessibility-and-localization/internationalization Steps: 1. add flutter_localizations dependencies into pubspec.yaml dependencies : flutter : sdk : flutter flutter_localizations : sdk : flutter 2. add localizationsDelegates and supportedLocales into MaterialApp Applocalizations.delegate is your app-specific localization delegate. will be introduced in next step. Widget build ( BuildContext context) { return MaterialApp ( localizationsDelegates: [ AppLocalizations .delegate, GlobalMaterialLocalizations .delegate, GlobalWidgetsLocalizations .delegate, GlobalCupertinoLocalizations .delegate, ], supportedLocales: [ const Locale . fromSubtags (languageCode: 'zh' ), // generic Chinese 'zh' const Locale . fromSubtags ( languageCode: 'zh' , scriptCode: 'Hans' ), // generic simplified Chinese 'z