flutter_ai_i18n_extractor library

Flutter AI i18n Extractor

Automatically detect, extract, and intelligently translate hardcoded text in Flutter projects using AI-powered abbreviation generation and professional translations, fully compatible with Flutter's intl utils system.

Classes

AbbreviationGenerator
Generates intelligent abbreviations and keys for localization using AI
AiClient
Abstract base class for AI clients
AnthropicAiClient
Anthropic client implementation
ArbFileGenerator
Generates ARB (Application Resource Bundle) files for Flutter localization
ArgosTranslateClient
Argos Translate client implementation (Free, local)
BingTranslateClient
Microsoft Bing Translate client implementation (Free)
CodeReplacer
Replaces hardcoded strings in Dart files with localization calls
CohereAiClient
Cohere AI client implementation
ContextAnalyzer
Analyzes the context of extracted strings to determine their UI purpose
DartFileScanner
Scanner that finds and extracts strings from Dart files using AST parsing
DeepLTranslateClient
DeepL Translate client implementation (API Key Required)
DeepSeekAiClient
DeepSeek AI client implementation
ExtractedString
Represents a string extracted from source code with its context
ExtractorConfig
Configuration class for the Flutter AI i18n Extractor
FileUtils
Utility functions for file operations and path management
GoogleAiClient
Google AI client implementation
GoogleTranslate2Client
Google Translate 2 client implementation (Free, alternative endpoint)
GoogleTranslateClient
Google Translate client implementation (Free)
GroqAiClient
Groq AI client implementation (fast inference)
HuggingFaceAiClient
Hugging Face AI client implementation
ImportManager
Manages import statements in Dart files for localization
L10nConfig
L10n configuration settings
LibreTranslateClient
LibreTranslate client implementation (Free)
LocalizationEntry
Represents a localization entry with key, original text, and translations
LocalizationEntryCollection
Utility class for managing collections of localization entries
OllamaAiClient
Ollama AI client implementation (local models)
OpenAiClient
OpenAI client implementation
ProcessingConfig
Processing configuration settings
ProfessionalTranslator
Professional translator that uses AI to generate high-quality translations
PromptTemplates
Utility class for AI prompt templates
RateLimiter
Rate limiter for AI API calls
ReplacementResult
Result of string replacement operation
StringContext
Represents the UI context of a string
StringParser
Parser that analyzes and processes extracted string literals
StringReplacementVisitor
AST visitor that performs string replacements
StringUtils
Utility functions for string processing and validation
TextReplacement
Represents a text replacement operation
ValidationResult
Result of a validation operation
ValidationUtils
Utility class for validation operations

Enums

StringContextType
Enumeration of string context types

Extensions

StringContextTypeExtension on StringContextType
Extension to get display names for context types

Exceptions / Errors

AiClientException
Exception thrown by AI clients
DirectoryNotFoundException
Exception thrown when a directory is not found