gettext_parser 0.1.0 gettext_parser: ^0.1.0 copied to clipboard
Platform agnostic lib to parse and compile gettext po and mo files with dart
Parse Mo Files: #
import 'package:gettext_parser/gettext_parser.dart' as gettextParser;
Map translateTable = gettextParser.mo.parse(
file.readAsBytesSync(),
);
// with custom encoding
Map translateTable = gettextParser.mo.parse(
file.readAsBytesSync(),
encoding: latin1,
);
Parse Po Files: #
import 'package:gettext_parser/gettext_parser.dart' as gettextParser;
Map translateTable = gettextParser.mo.parse(
file.readAsStringSync()
);
// with custom encoding
Map translateTable = gettextParser.mo.parseRaw(
file.readAsBytesSync(),
encoding: latin1,
);