EasyLocalizationGenerator class

Generates easy_localization JSON translation files for a Flutter project.

Output structure inside the target project:

assets/
  translations/
    en.json   ← source locale (values from code, always regenerated)
    ar.json   ← other locales (existing translations preserved,
                 new keys appended as empty placeholders)
Inheritance

Constructors

EasyLocalizationGenerator()

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

escapeDartString(String value) → String
Escapes a string value for use inside a Dart single-quoted string literal.
inherited
escapeJsonString(String value) → String
Escapes characters that have special meaning inside JSON string values.
inherited
generate({required List<ExtractedString> strings, required String projectPath, required List<String> locales, required String sourceLocale}) → Future<void>
Writes localization output files into projectPath.
override
localeToVarName(String locale) → String
Converts a locale code to a lowerCamelCase Dart variable name.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited