npm / gettext-parser
gettext-parser
What changed in gettext-parser 2 to 10, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-25.
11 breaking1 security3 new APIs and options5 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initgettext-parser 103 changes
Breaking changes 1
foldLength now represents page width, like msgcat --width, and defaults to 79 instead of 76; 0 or false still disables folding.
Fixes and other changes 2
Folding no longer splits escape sequences such as \t across lines, which could produce an unparsable .po file.
Compiled strings are now wrapped exactly like GNU gettext's msgcat; version-controlled compiled .po files are rewrapped once without content changes.
gettext-parser 96 changes
Breaking changes 3
Validation throws when the multiline format is invalid.
Invalid PO format is no longer silently ignored.
Support for Node.js versions below 20 is dropped.
Security 1
Fixes possible prototype pollution during parsing.
Fixes and other changes 2
Fixes parsing of multiline strings.
Parsing and compilation now handle
#~|previous-msgid comments in obsolete entries.
gettext-parser 82 changes
Breaking changes 2
The package switched to ESM; use import instead of require to use gettext-parser.
Support for Node.js versions 17 and below was dropped.
gettext-parser 73 changes
Breaking changes 2
The method signature changes from accepting defaultCharset to accepting options.
The method signature changes from accepting defaultCharset to accepting options; transformOptions remains the second argument.
New APIs and options 1
Adds a validation option to PO parsing; it is disabled by default.
gettext-parser 62 changes
Breaking changes 1
Support for Node versions below 12 is dropped through the readable-stream dependency update.
Fixes and other changes 1
PO output now ends with a newline.
gettext-parser 52 changes
Breaking changes 1
When line folding is disabled by setting it to 0, folding still occurs on newline characters (\n).
New APIs and options 1
Added support for obsolete messages, whose lines start with #~.
gettext-parser 22 changes
Breaking changes 1
The parameter formerly named sortByMsgId was renamed to sort, requiring callers to update their code.
New APIs and options 1
The sort parameter can also accept a custom function.