shouldLocalizeString method
Enhanced method to check if a string should be localized
Implementation
bool shouldLocalizeString(
String content,
List<String> contextLines,
String filePath,
int lineNumber,
) {
// Skip obviously non-localizable content
if (_shouldSkipString(content)) {
if (verbose) {
print('❌ Skipped non-localizable: "$content" at $filePath:$lineNumber');
}
return false;
}
// Check if it's in a UI context
if (!isInUiContext(content, contextLines)) {
if (verbose) {
print('❌ Skipped non-UI context: "$content" at $filePath:$lineNumber');
}
return false;
}
if (verbose) {
print('✅ Should localize: "$content" at $filePath:$lineNumber');
}
return true;
}