JsonComparator class

Compares code keys against JSON translation files.

Constructors

JsonComparator({required String i18nPath, String referenceLocale = 'en', void onLog(String message)?})

Properties

hashCode int
The hash code for this object.
no setterinherited
i18nPath String
Path to i18n assets directory (e.g., 'assets/i18n').
final
onLog → void Function(String message)?
Callback for logging messages.
final
referenceLocale String
Reference locale to compare against (e.g., 'en').
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

compare(ExtractionResult extracted) Future<ComparisonResult>
Compare extraction result against JSON translations.
detectShard(String key, String? sourceFilePath) String
Detect which shard a key should belong to based on source file path.
loadJsonKeys() Future<Set<String>>
Load all keys from JSON files for the reference locale.
loadTranslations() Future<Map<String, dynamic>>
Load full translation data (for placeholder/plural analysis).
loadTranslationsByFile() Future<Map<String, Map<String, dynamic>>>
Load translations organized by shard file.
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