flutter_calendar icon indicating copy to clipboard operation
flutter_calendar copied to clipboard

Can it be configured to locale?

Open shaharsol opened this issue 6 years ago • 2 comments

i.e. display names of months in different languages? or be RTL?

shaharsol avatar Nov 14 '19 10:11 shaharsol

Hi.

I get it working with spanish language.

You should change your flutter app internationalization https://flutter.dev/docs/development/accessibility-and-localization/internationalization

Some changes in the application

import 'package:intl/intl.dart';
...


main() {
    ...
    Intl.defaultLocale = 'es_AR';
    ...
}


return MaterialApp(
      localizationsDelegates: [
        // ... app-specific localization delegate[s] here
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate,
      ],
      supportedLocales: [
//      const Locale('en'), // English
        const Locale('es'), // Español
      ],
    ...

A full reload is needed.

Good luck!

encubos avatar Mar 16 '20 21:03 encubos

Right, it should all be localizable. The calendar pieces it prints are all from the locale specific built in flutter pieces and there is no text it prints directly, you create your own widgets for the titles etc.

On Mon, 16 Mar 2020 at 14:01, encubos [email protected] wrote:

Hi.

I get it working with spanish language.

You should change your flutter app internationalization

https://flutter.dev/docs/development/accessibility-and-localization/internationalization

Some changes in the application

main() {

...

Intl.defaultLocale = 'es_AR';

...

}

return MaterialApp(

  localizationsDelegates: [

    // ... app-specific localization delegate[s] here

    GlobalMaterialLocalizations.delegate,

    GlobalWidgetsLocalizations.delegate,

    GlobalCupertinoLocalizations.delegate,

  ],

  supportedLocales: [

// const Locale('en'), // English

    const Locale('es'), // Español

  ],

...

A full reload is needed.

Good luck!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pinkfish/flutter_calendar/issues/17#issuecomment-599756711, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATOMMOHMMO36HFSTWS3QL3RH2HUFANCNFSM4JNJLWVA .

pinkfish avatar Mar 16 '20 22:03 pinkfish