ArbHelper class
Enhanced ARB file operations with comprehensive validation and error handling.
This class provides robust methods for reading, writing, and validating ARB (Application Resource Bundle) files with detailed error reporting.
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
-
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
Static Methods
-
analyzeArbFiles(
Map< String, Map< arbFiles) → ArbAnalysisResultString, dynamic> > - Analyzes ARB files for missing translations and inconsistencies.
-
extractTranslationContext(
Map< String, dynamic> arbContent, String key, {int contextRadius = 2}) → Map<String, dynamic> - Extracts context information for a translation key.
-
getMetadata(
Map< String, dynamic> content) → Map<String, dynamic> - Gets metadata entries from ARB content.
-
getTranslations(
Map< String, dynamic> content) → Map<String, dynamic> - Gets translation entries from ARB content.
-
readArbFile(
String filePath) → Future< Map< String, dynamic> > -
Reads an ARB file from the given
filePathand returns its content as a Map. -
suggestMissingTranslations(
Map< String, Map< arbFiles, String targetLocale) → Map<String, dynamic> >String, String> - Suggests translations for missing keys based on similar existing translations.
-
validateArbContent(
Map< String, dynamic> content) → List<String> - Validates the structure of an ARB file content.
-
writeArbFile(
String filePath, Map< String, dynamic> content, {bool prettyPrint = true, bool createBackup = false}) → Future<void> -
Writes the given
contentMap to an ARB file at the specifiedfilePath.