text_expressions 1.1.0+1 copy "text_expressions: ^1.1.0+1" to clipboard
text_expressions: ^1.1.0+1 copied to clipboard

outdated

A tiny, simple and complete tool to supercharge static JSON strings with the power of dynamic, user-defined expressions. – Ensure your translations are always grammatically and orthographically correct.

example/example.dart

import 'translation.dart';

final Translation translation = Translation();

void main() {
  translation.load(Language.english);

  print(translation.translate('ageCheck', named: {'age': 10}));
  print(translation.translate('ageCheck', named: {'age': 17}));
  print(translation.translate('ageCheck', named: {'age': 68}));
  print(translation.translate('ageCheck', named: {'age': 40}));
  testGreetings();

  translation.load(Language.polish);
  testGreetings();

  translation.load(Language.romanian);
  testGreetings();
}

void testGreetings() {
  print(translation.translate('userGreeting', named: {'number': 1}));
  print(translation.translate('userGreeting', named: {'number': 4}));
  print(translation.translate('userGreeting', named: {'number': 11}));
  print(translation.translate('userGreeting', named: {'number': 23}));
}
5
likes
0
pub points
0%
popularity

Publisher

verified publishervxern.dev

A tiny, simple and complete tool to supercharge static JSON strings with the power of dynamic, user-defined expressions. – Ensure your translations are always grammatically and orthographically correct.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

enum_as_string, sprint

More

Packages that depend on text_expressions