Change flutter generated localizations files directory
Asked Answered
D

2

9

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
Domenicadomenico answered 8/3, 2022 at 19:28 Comment(1)
Did you get any solution?Sally
S
13

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

Strand answered 17/7, 2022 at 13:36 Comment(0)
R
1

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

Rebirth answered 8/3, 2022 at 20:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.