Skip to content

Commit 661adfc

Browse files
intl: Migrate from package:flutter_gen; include generated files
`flutter` tool deprecated the `package:flutter_gen` synthetic package: https://flutter.dev/to/flutter-gen-deprecation The generated localization source files are now included in the repository and referenced directly. Without this change, `flutter run` generates the following warning: Synthetic package output (package:flutter_gen) is deprecated: https://flutter.dev/to/flutter-gen-deprecation. In a future release, synthetic-package will default to `false` and will later be removed entirely.
1 parent ae8aabc commit 661adfc

23 files changed

+2345
-17
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# Dart files generated from the files next to them, or by Pigeon:
44
*.g.dart -diff
55

6+
# Generated files for localizations.
7+
lib/generated/l10n/*.dart -diff
8+
69
# Generated files for testing migrations:
710
test/model/schemas/*.dart -diff
811
test/model/schemas/*.json -diff

docs/translation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ changes to the ARB file.
5656

5757
To use in our widgets, you need to import the generated bindings:
5858
```
59-
import 'package:flutter_gen/gen_l10n/zulip_localizations.dart';
59+
import '../generated/l10n/zulip_localizations.dart';
6060
```
6161

6262
Then in your widget code, pull the localizations object

l10n.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Docs on this config file:
22
# https://docs.flutter.dev/ui/accessibility-and-localization/internationalization#configuring-the-l10nyaml-file
33

4+
synthetic-package: false
45
arb-dir: assets/l10n
6+
output-dir: lib/generated/l10n
57
template-arb-file: app_en.arb
68
required-resource-attributes: true
79
output-localization-file: zulip_localizations.dart

0 commit comments

Comments
 (0)