easy_localization
3.0.8, released a year ago by an unverified publisher
Easy and fast Flutter internationalization with JSON/CSV/… loaders
What it does
Provides a simple API to load translation files from assets or custom loaders, supports plural, gender, nesting, RTL and fallback locales, and offers extension methods on Text and BuildContext.
AI-written summary of version 3.0.8, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a quick, zero‑boilerplate solution for localizing a Flutter app
- You want to load translations from JSON, CSV, Yaml, or XML files
- You need runtime locale switching with persistence
- You want code generation for translation keys
Skip it when
- You already use a full‑featured i18n framework like intl or slang
- You need advanced features like message formatting with ICU or custom plural rules beyond what intl offers
- You want to avoid adding an assets folder to your project
Strengths
- Simple API with minimal boilerplate
- Supports multiple file formats via custom loaders
- Built‑in fallback and error handling
- Code generation for keys
Weaknesses
- Requires assets folder and iOS plist configuration
- Limited to Flutter (no pure Dart support)
- Not as feature‑rich as intl for complex formatting
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 6
Add easy_localization to pubspec, declare assets folder, call EasyLocalization.ensureInitialized(), wrap app with EasyLocalization widget
```dart
import 'package:easy_localization/easy_localization.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await EasyLocalization.ensureInitialized();
runApp(
EasyLocalization(
supportedLocales: [Locale('en'), Locale('de')],
path: 'assets/translations',
fallbackLocale: Locale('en'),
child: MyApp(),
),
);
}
```Alternatives
Packages that do the same job and could replace easy_localization.
- slang
Code‑generated localization with strong type safety
90Compare - flutter_localization
Official Flutter package for basic localization
82Compare
Works with
Packages commonly used together with easy_localization: ones it builds on, ones built on it, and its own family.
- argseasy_localization depends on itLibrary for parsing raw command-line arguments into options and values using GNU and POSIX styles.
- intleasy_localization depends on itA Dart library for internationalization and localization, providing message translation, plural/gender handling, and date/number formatting.
- shared_preferenceseasy_localization depends on itFlutter plugin for reading and writing simple key-value pairs. Wraps NSUserDefaults on iOS and SharedPreferences on Android.
- easy_loggereasy_localization depends on itA lightweight Flutter logger with configurable levels, build‑mode control and custom printer.