GettextLocalizations.fromPO constructor

GettextLocalizations.fromPO(
  1. String poContent, {
  2. OnWarning? onWarning = print,
})

Write the translations from a PO file String to the Gettext instance.

onWarning receives a message for every msgid that has no translation in a non-English locale. Defaults to print. Pass null to silence the warnings, or your own sink to redirect them.

Implementation

GettextLocalizations.fromPO(String poContent, {OnWarning? onWarning = print})
  : _gt = Gettext(onWarning: onWarning) {
  _gt.addLocale(po.parse(poContent));
}