pull/1522/head
Ellet 1 year ago
parent dd7cc47104
commit 58c0a454a6
No known key found for this signature in database
GPG Key ID: C488CC70BBCEF0D1
  1. 4
      README.md
  2. 0
      doc/code_introduction.md
  3. 2
      doc/translation.md
  4. 3
      example/lib/main.dart
  5. 4
      example/lib/pages/home_page.dart
  6. 5
      lib/src/models/config/shared_configurations.dart
  7. 2
      lib/src/widgets/utils/localizations.dart

@ -26,7 +26,7 @@
FlutterQuill is a rich text editor and a [Quill] component for [Flutter]. FlutterQuill is a rich text editor and a [Quill] component for [Flutter].
This library is a WYSIWYG editor built for the modern Android, iOS, web and desktop platforms. Check out our [Youtube Playlist] or [Code Introduction] to take a detailed walkthrough of the code base. You can join our [Slack Group] for discussion. This library is a WYSIWYG editor built for the modern Android, iOS, web and desktop platforms. Check out our [Youtube Playlist] or [Code Introduction](./doc/code_introduction.md) to take a detailed walkthrough of the code base. You can join our [Slack Group] for discussion.
Pub: [FlutterQuill] Pub: [FlutterQuill]
@ -339,6 +339,6 @@ You can check the [Todo](./doc/todo.md) list if you want to
[Youtube Playlist]: https://youtube.com/playlist?list=PLbhaS_83B97vONkOAWGJrSXWX58et9zZ2 [Youtube Playlist]: https://youtube.com/playlist?list=PLbhaS_83B97vONkOAWGJrSXWX58et9zZ2
[Slack Group]: https://join.slack.com/t/bulletjournal1024/shared_invite/zt-fys7t9hi-ITVU5PGDen1rNRyCjdcQ2g [Slack Group]: https://join.slack.com/t/bulletjournal1024/shared_invite/zt-fys7t9hi-ITVU5PGDen1rNRyCjdcQ2g
[Sample Page]: https://github.com/singerdmx/flutter-quill/blob/master/example/lib/pages/home_page.dart [Sample Page]: https://github.com/singerdmx/flutter-quill/blob/master/example/lib/pages/home_page.dart
[Code Introduction]: https://github.com/singerdmx/flutter-quill/blob/master/doc/CodeIntroduction.md <!-- [Code Introduction]: https://github.com/singerdmx/flutter-quill/blob/master/doc/code_introduction.md -->
[FluentUI]: https://pub.dev/packages/fluent_ui [FluentUI]: https://pub.dev/packages/fluent_ui

@ -1,6 +1,6 @@
# Translation # Translation
The package offers translations for the quill toolbar and editor, it will follow the system locale unless you set your own locale with: The package offers translations for the quill toolbar and editor, it will follow the locale that is defined in your `WidgetsApp` for example `MaterialApp` which usually follow the system local and it unless you set your own locale with:
```dart ```dart
QuillProvider( QuillProvider(

@ -33,9 +33,8 @@ class MyApp extends StatelessWidget {
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate, GlobalCupertinoLocalizations.delegate,
FlutterQuillLocalizations.delegate, // FlutterQuillLocalizations.delegate,
], ],
locale: const Locale('ar'),
supportedLocales: FlutterQuillLocalizations.supportedLocales, supportedLocales: FlutterQuillLocalizations.supportedLocales,
home: const HomePage(), home: const HomePage(),
); );

@ -632,9 +632,7 @@ class _HomePageState extends State<HomePage> {
controller: _controller, controller: _controller,
sharedConfigurations: QuillSharedConfigurations( sharedConfigurations: QuillSharedConfigurations(
animationConfigurations: QuillAnimationConfigurations.enableAll(), animationConfigurations: QuillAnimationConfigurations.enableAll(),
locale: const Locale( locale: const Locale('fr'),
'de',
),
), ),
), ),
child: Column( child: Column(

@ -31,7 +31,10 @@ class QuillSharedConfigurations extends Equatable {
final QuillDialogTheme? dialogTheme; final QuillDialogTheme? dialogTheme;
/// The locale to use for the editor and toolbar, defaults to system locale /// The locale to use for the editor and toolbar, defaults to system locale
/// More https://github.com/singerdmx/flutter-quill#translation /// More https://github.com/singerdmx/flutter-quill/blob/master/doc/translation.md
/// this won't used if you defined the [FlutterQuillLocalizations.delegate]
/// in the `localizationsDelegates` which exists in
/// `MaterialApp` or `WidgetsApp`
final Locale? locale; final Locale? locale;
/// To configure which animations you want to be enabled /// To configure which animations you want to be enabled

@ -19,7 +19,7 @@ class FlutterQuillLocalizationsWidget extends StatelessWidget {
return child; return child;
} }
return Localizations( return Localizations(
locale: context.quillSharedConfigurations?.locale ?? locale: context.requireQuillSharedConfigurations.locale ??
Localizations.localeOf(context), Localizations.localeOf(context),
delegates: FlutterQuillLocalizations.localizationsDelegates, delegates: FlutterQuillLocalizations.localizationsDelegates,
child: child, child: child,

Loading…
Cancel
Save