I'm trying to follow the internationalization documentation in https://flutter.dev/docs/development/accessibility-and-localization/internationalization#dart-tools and https://docs.google.com/document/d/10e0saTfAv32OZLRmONy866vnaw0I2jwL8zukykpgWBc/edit#heading=h.upcu5w85cvc2 but it's not generating any files.
Basically it says to make these mods to the pub spec.yaml
file:
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
intl: ^0.17.0-nullsafety.2
flutter:
generate: true
Then create a <project-root>/l10n.yaml
file containing:
arb-dir: lib/l10n
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart
And finally to create the app_en.arb
with something like this:
{
"@@locale": "en",
"helloWorld": "Hello World!",
"@helloWorld": {
"description": "The conventional newborn programmer greeting"
}
}
And from there the guides say that a flutter_gen/gen_l10n/app_localizations.dart
file will be automatically generated.
Except that nothing happens. I'm working in Android Studio and did a pub get
, and tried a flutter clean
and flutter build ios
and everything else I can't think of but nothing is building that file.
Any ideas?
i10n
instead ofl10n
for the file name and.yaml
config name. – Overblousel10n
(lowercase L) , noti10n
. If that worked for you, that means you messed it up with the name somewhere else. – Mccaslinl10n.yaml
inside thelib/
folder. But it clearly saysto the root directory of the Flutter project
. I changed the location and now it works as expected. – Mccaslin