localizer 1.0.2 copy "localizer: ^1.0.2" to clipboard
localizer: ^1.0.2 copied to clipboard

A plugin to localize your dart project. It is purely written in Dart and supports loading json and yaml files.

example/localizer_example.dart

import 'package:localizer/localizer.dart';

void main() {
  var localizer = Localizer();
  localizer.loadMap("en", {
    "hello": ["Hello world!"]
  });
  localizer.loadMap("es", {"hello-world": "Hola mundo!"});
  localizer.loadMap("fr", {"hello-world": "Bonjour le monde!"});
  localizer.loadMap("de", {"hello-world": "Hallo Welt!"});

  print("EN: ${localizer.get("en", "hello.0")}");
  print("ES: ${localizer.get("es", "hello.0")}");
  print("FR: ${localizer.get("fr", "hello-world")}");
  print("DE: ${localizer.get("de", "hello-world")}");
}
1
likes
120
pub points
12%
popularity

Publisher

verified publisherlinwood.dev

A plugin to localize your dart project. It is purely written in Dart and supports loading json and yaml files.

Repository (GitHub)
View/report issues

Documentation

Documentation
API reference

License

Apache-2.0 (LICENSE)

Dependencies

meta, sprintf, yaml

More

Packages that depend on localizer