flutter_string_extractor 1.1.2 copy "flutter_string_extractor: ^1.1.2" to clipboard
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.

example/main.dart

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"
  // }
}
7
likes
160
points
78
downloads

Publisher

unverified uploader

Weekly Downloads

A command-line tool for extracting translatable strings from Flutter projects. It finds strings marked with .tr or tr() in Dart files.

Homepage
Repository (GitHub)

Topics

#cli #localization #flutter #i18n

Documentation

API reference

License

MIT (license)

Dependencies

args, glob

More

Packages that depend on flutter_string_extractor