Skip to content

Commit

Permalink
Merge pull request ilteoood#209 from pumano/feat/update-docs-about-wh…
Browse files Browse the repository at this point in the history
…ere-lang-delegates-is

docs: update readme about where to set localizationDelegates property
  • Loading branch information
ilteoood authored Aug 13, 2023
2 parents 4bbb2cc + 82b87ce commit 42a4da3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit 42a4da3

Please sign in to comment.