Trocco
Trocco

Reputation: 95

Change flutter generated localizations files directory

is there a way to change the directory that contains all the generated files about localization? When I run the app they are automatically generated in .dart_tool/flutter_gen/gen_l10n and I want to change it.

(directory photo) https://i.sstatic.net/DjqHp.png

This is my l10n.yaml:

arb-dir: lib/l10n
template-arb-file: app_en.arb
output-localization-files: app_localizations.dart # auto generated

Upvotes: 9

Views: 3169

Answers (2)

dante
dante

Reputation: 1254

Need to add both output-dir and synthetic-package parameters.

This is my l10n.yaml

arb-dir: lib/l10n
template-arb-file: app_en.arb
output-localization-file: s.dart
output-class: S
output-dir: lib/l10n
synthetic-package: false

Run flutter gen-l10n to generate file

Upvotes: 14

Alaindeseine
Alaindeseine

Reputation: 4413

Take a look to the output of:

flutter gen-l10n --help

Normally, you can put any of these parameters in l10n.yaml

I have not tried, tell me if it is ok !

I think output-dir parameter will help

Upvotes: 1

Related Questions