auto_localized
1.3.3, released 3 years ago by an unverified publisher
Runtime-safe Flutter localization tool using code generation for JSON and YAML files.
What it does
auto_localized simplifies Flutter app localization by using code generation to convert JSON or YAML translation files into typed Dart fields and methods. It performs generation-time validation for missing keys and blank values, and allows retrieving translations with or without a BuildContext.
AI-written summary of version 1.3.3, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want compile-time safety and type safety for your localization keys.
- You prefer generating Dart fields from JSON or YAML translation files.
- You want to access translations without needing a BuildContext.
Skip it when
- You prefer dynamic key lookups at runtime without code generation.
- You are already heavily invested in another localization solution like easy_localization or slang.
Strengths
- Runtime and type-safety through code generation.
- Generation-time validation catches missing keys and blank values.
- Supports fetching translations without a BuildContext.
- Supports safe arguments with validation.
Weaknesses
- Requires running build_runner for code generation.
- Limited to a maximum of 5 safe arguments per translation string.
Setup
- Kind
- Flutter widgets
- Effort
- Medium
- Code generation
- Yes (build_runner)
- Direct dependencies
- 1
Requires adding iOS localizations to Info.plist, configuring build_runner, creating a build.yaml file if translations are outside lib, and running the code generator.
Text(
Strings.welcome.get(context),
)Alternatives
Packages that do the same job and could replace auto_localized.
- slang
Another strong localization package using code generation with extensive features.
90Compare - easy_localization
Localization solution that does not require code generation.
64Compare