gettext 1.1.0 gettext: ^1.1.0 copied to clipboard
Platform agnostic dart implementation of gettext, a localization framework.
import 'dart:convert';
import 'dart:io';
import "package:gettext/gettext.dart";
void main() async {
final data = await File("./en_US.json").readAsString();
final gt = new Gettext();
gt.addLocale(json.decode(data));
print(gt.gettext("Hello"));
print(gt.ngettext("An apple", "%d apples", 1));
print(gt.ngettext("An apple", "%d apples", 3));
}