From 82b87ceccb885b3b1c44f97da4b9d1dd70fe4b31 Mon Sep 17 00:00:00 2001 From: Dmitry Zakharov Date: Sun, 13 Aug 2023 14:02:18 +0300 Subject: [PATCH] docs: update readme about where to set localizationDelegates property --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f3e8878..d9bfd5a 100644 --- a/README.md +++ b/README.md @@ -133,12 +133,14 @@ For example if your translation files located at `https://example.com/static/en.json` you should configure as follows: ```dart -localizationsDelegates: [ +MaterialApp( + localizationsDelegates: [ FlutterI18nDelegate(translationLoader: NetworkFileTranslationLoader(baseUri: Uri.https("example.com", "static")), GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate -], + ], +) ``` ### `NamespaceFileTranslationLoader` configuration @@ -164,12 +166,14 @@ For example `FileTranslationLoader` format: Example configuration: ```dart -localizationsDelegates: [ +MaterialApp( + localizationsDelegates: [ FlutterI18nDelegate(translationLoader: NamespaceFileTranslationLoader(namespaces: ["home_screen", "about_screen"]), GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate -], + ], +) ``` Below you can find the name and description of the accepted parameters.