LocalizationEntry class
Represents a localization entry with key, original text, and translations
- Annotations
-
- @immutable
Constructors
-
LocalizationEntry({required String key, required String originalText, required String description, required Map<
String, String> translations, required ExtractedString extractedString, Map<String, dynamic> ? metadata}) -
const
- LocalizationEntry.fromExtractedString(ExtractedString extractedString, String key, String description)
-
Creates a localization entry from an extracted string
factory
Properties
- contextType → StringContextType?
-
Returns the string context type
no setter
- description → String
-
The description for the ARB file
final
- extractedString → ExtractedString
-
The extracted string this entry was generated from
final
- filePath → String
-
Returns the file path where this string was found
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- key → String
-
The generated localization key
final
- lineNumber → int
-
Returns the line number where this string was found
no setter
-
metadata
→ Map<
String, dynamic> ? -
Additional metadata for the ARB file
final
- originalText → String
-
The original English text
final
- parameterName → String?
-
Returns the parameter name context
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
translations
→ Map<
String, String> -
Map of language codes to translated text
final
- widgetType → String?
-
Returns the widget type context
no setter
Methods
-
addTranslation(
String languageCode, String translation) → LocalizationEntry - Adds a translation for a specific language
-
copyWith(
{String? key, String? originalText, String? description, Map< String, String> ? translations, ExtractedString? extractedString, Map<String, dynamic> ? metadata}) → LocalizationEntry - Creates a copy with updated fields
-
getTranslation(
String languageCode) → String - Gets the translation for a specific language, fallback to English
-
hasAllTranslations(
List< String> requiredLanguages) → bool - Returns true if all required languages have translations
-
isValid(
) → bool - Validates the localization entry
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toArbEntry(
) → Map< String, dynamic> - Generates the ARB entry for this localization
-
toArbEntryForLanguage(
String languageCode) → Map< String, dynamic> - Generates the ARB entry for a specific language
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override