Dart string literals become AppLocalizations getters, keys land in your ARB files (merged, never clobbered), and l10n.yaml drives Flutter's own code generation.
Flutter's official i18n is flutter gen-l10n: ARB catalogs in, generated AppLocalizations getters out. Polyglot automates the part the toolchain doesn't — finding your hardcoded strings and converting them.
import 'package:flutter/material.dart';
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Text("Welcome back");
}
}import 'package:flutter/material.dart';
import 'package:demo_app/l10n/app_localizations.dart';
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Text(AppLocalizations.of(context)!.welcome_back);
}
}const contexts are respected: a const Text(...) can't hold a runtime lookup, so those strings are skipped with a reason rather than broken.AppLocalizations import is added per file, and resolves via your l10n.yaml — which Polyglot scaffolds if missing.{
"@@locale": "en",
"welcome_back": "Welcome back"
}{
"@@locale": "de",
"@welcome_back": {
"description": ""
},
"welcome_back": "Willkommen zurück"
}{
"@@locale": "fr",
"@welcome_back": {
"description": ""
},
"welcome_back": "Bon retour"
}Existing ARB entries are read and preserved; keys are flat identifiers exactly as gen-l10n requires, so the generated getters always match the wrapped call sites.
$ curl -fsSL https://getpolyglot.ai/install.sh | sh
$ polyglot init --framework flutter
$ polyglot scan
$ polyglot wrap
$ polyglot translate --languages de # 50 strings free, no signupIm Terminal starten
Installieren Sie die CLI, führen Sie einen Scan durch und sehen Sie genau, was Ihnen fehlt. Kostenlos, kein Konto erforderlich.