Skip to content

[gen-l10n] Unable to export generated files from another package #109606

@ferraridamiano

Description

@ferraridamiano

I'm working on a flutter monorepo project and I faced many issues when I decided to put all the translation files in a separate package (I use intl). I tought I just need to export package:flutter_gen/gen_l10n/app_localizations.dart so that when I import the translation package I could just use all the translations. I tought it was a common use-case.
But that doesn't work! I think it is counter-intuitive. I would expect that if I export a genereated file and then I import it from another package it works (just like any other non generated file). To me it seems a major blocker for large projects. Are there any other ways to create a translation package?

Steps to Reproduce

  1. Clone the example repo: git clone https://github.com/ferraridamiano/fluttergen_export_issue
  2. Take a look to the errors reported by the IDE

Expected results:
Same behaviour for generated and non-generated files

Actual results:
Different behaviour for generated and non-generated files

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: internationalizationSupporting other languages or locales. (aka i18n)found in release: 3.0Found to occur in 3.0found in release: 3.1Found to occur in 3.1frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work ontoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions