flutter_string_extractor 1.1.2
flutter_string_extractor: ^1.1.2 copied to clipboard
A command-line tool for extracting translatable strings from Flutter projects. It finds strings marked with .tr or tr() in Dart files.
import 'package:flutter_string_extractor/flutter_string_extractor.dart';
void main() {
// Example strings in our source code:
// "Hello".tr
// tr("Welcome")
// 'Settings'.tr
// tr('Goodbye')
// Extract strings from the lib directory
FlutterStringExtractor.extractStrings('lib', 'translations.json');
// This will create a translations.json file with content like:
// {
// "Hello": "Hello",
// "Welcome": "Welcome",
// "Settings": "Settings",
// "Goodbye": "Goodbye"
// }
}