Skip to content

flutter-setup-localization: sets synthetic-package: true, which gen-l10n now rejects #239

Description

@a-urel

skills/flutter-setup-localization/SKILL.md tells the agent to write an l10n.yaml with synthetic-package: true and to import the result from package:flutter_gen/gen_l10n/app_localizations.dart. Both the config snippet and both worked examples do this:

https://github.com/flutter/agent-plugins/blob/e89522a/skills/flutter-setup-localization/SKILL.md#L60
https://github.com/flutter/agent-plugins/blob/e89522a/skills/flutter-setup-localization/SKILL.md#L68
https://github.com/flutter/agent-plugins/blob/e89522a/skills/flutter-setup-localization/SKILL.md#L179
https://github.com/flutter/agent-plugins/blob/e89522a/skills/flutter-setup-localization/SKILL.md#L186

Synthetic packages have been removed. On Flutter 3.47.2 stable, following the skill as written fails at the first step:

$ flutter gen-l10n
l10n.yaml: Cannot enable "synthetic-package", this feature has been removed. See http://flutter.dev/to/flutter-gen-deprecation.

and flutter gen-l10n --help lists the flag only as:

--[no-]synthetic-package    DEPRECATED. This flag cannot be enabled and should be removed.

An agent following the skill therefore produces a project whose localization step errors out and whose imports point at a package that will never exist.

Suggested fix: drop synthetic-package from the config, set output-dir (for example lib/l10n), and change the imports to the generated file's real path (import 'l10n/app_localizations.dart'; or the package-relative equivalent). The "Configure the App Entry Point" section and both examples need the same change.

Found while reviewing the skills vendored into a project via npx skills add flutter/agent-plugins --skill '*' --agent universal.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions