Monarch sample code and stories using intl package and tools.
Monarch is a tool for building Flutter widgets in isolation. It makes it easy to build, test and debug complex UIs. Find out more at https://monarchapp.io
To use intl tools with Monarch you have to annotate the generated LocalizationsDelegate
with the MonarchLocalizations
annotation. To annotate it, you will have to
create a new dart library in your lib directory, then import the generated
source file so you can annotate an instance of your LocalizationsDelegate
.
You can see the sample implementation in lib/intl_localizations_delegate.dart
This LocalizationsDelegate
definition is only for Monarch. Your intl app
won't need it.
To run the intl sample stories:
flutter pub get
- Run the intl code generation:
flutter pub run build_runner build
- Run monarch:
monarch run
- Once the Monarch UI launches, select a story, then change the locale using the Locale dropdown, see how the story changes based on the locale selected.
If you need more details, here are the Monarch internationalization docs.