v4.0.0-alpha.2
Pre-release
Pre-release
lzurbriggen
released this
07 Aug 18:59
·
0 commits
to master
since this release
What's Changed
Enhancements ✨
- new simplified parser
Breaking Changes
- removed the long deprecated
<translate>
component andv-translate
directive - removed
disableHtmlEscaping
option - introduced
parserOptions
, removedjsExtractorOpts
- declare global types in
vue
instead of@vue/runtime-core
(this seems to work with current dev toolings) flat
output is now enabled by default
New Parser
I finally got around to replacing the parse5
based parser in favor of a simple, regex-based parser. It has not yet been extensively tested but for now seems to be more robust when dealing with some of the issues the community found.
- It can extract messages from non-js files
- It can extract custom keywords but is otherwise not very flexible. I'm trying to keep this as simple as possible so it may not work for languages with non C-like syntax.
- At this time, it will extract anything in the shape of
$npgettext("foo", "bar", "bars"
- It does pattern match and not fully parse files, this has some caveats:
- It will extract messages from comments
- It will ignore the context surrounding the message and extract even if it is syntactically invalid. One example:
foo$gettext("bar"