string_literal_finder 1.3.0+1 copy "string_literal_finder: ^1.3.0+1" to clipboard
string_literal_finder: ^1.3.0+1 copied to clipboard

Find non translated strings: Searches all dart files for string literals, excluding non translatable strings. Useful for i18n/l10n.

example/lib/example.dart

library example;

import 'package:logging/logging.dart';
import 'package:string_literal_finder_annotations/string_literal_finder_annotations.dart';

final _logger = Logger('example');

class Example {
  // ignore: avoid_unused_constructor_parameters
  const Example(@NonNls String test);
}

void exampleFunc(@NonNls String ignored, String warning) {}

// parameters to annotations are ignored.
@SomeAnnotation('test')
void main() {
  const Example('Lorem ipsum');
  exampleFunc('Hello world', 'not translated');
  exampleFunc('lorem'.split('').join(''), 'not translated2'.split('').join(''));
  _logger.finer('Lorem ipsum');

  nonNls({
    'nonNlsKey1': 'nonNlsValue1',
  });

  @NonNls
  final testMap = nonNls({
    'key': 'value',
  });
  // since `testMap` is annotated with @NonNls, accessing the key with
  // a string literal will be ignored.
  print(testMap['key']);
}

class SomeAnnotation {
  const SomeAnnotation(String test);
}
11
likes
120
pub points
86%
popularity

Publisher

verified publishercodeux.design

Find non translated strings: Searches all dart files for string literals, excluding non translatable strings. Useful for i18n/l10n.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

analyzer, analyzer_plugin, args, glob, logging, logging_appenders, path, recase, source_gen, string_literal_finder_annotations, yaml

More

Packages that depend on string_literal_finder