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

Aperta Adatta ai principianti
#239 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

  • #258 di @ArefMozafari — chiusa senza merge

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
88/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
dart, flutter
Ambito
documentation

Direzione di ricerca

Aggiorna skills/flutter-setup-localization/SKILL.md, iniziando dallo snippet l10n.yaml, dalla sezione “Configure the App Entry Point” e da entrambi gli esempi completi. Esegui flutter gen-l10n su Flutter 3.47.2 per verificare la configurazione, quindi conferma che gli esempi utilizzino il percorso effettivo del file generato e non abilitino più synthetic-package.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Dart
Stelle
3.2k
Fork
196
Merge medio
21h 18m
PR unite (30g)
8

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di flutter/agent-plugins

Tutte le issue di flutter/agent-plugins

Issue simili

Altre issue su Dart

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.