A grab-bag of `@fluent/bundle` updates by eemeli · Pull Request #654 · projectfluent/fluent.js
This will need a rebase once #652 is merged. Only the latest six commits are really part of this PR.
-
Closes Loop detection could be done in message/term reference instead of pattern (?) #277
As suggested in the issue, loop detection is moved to message & term resolution. It now tracks expressions rather than patterns. -
Closes @fluent/bundle how to use FluentType.toString #426
While the type ofScopeis indeed public, it's here made an optional argument of all FluentType.p.toString() implementations. -
Closes Accept boolean variables in
Localizedcomponent #543
Boolean values are supported as argument values; internally, they are handled as strings, serialised as either"true"or"false". -
Closes Automatic Eastern Arabic numerals in Arabic translations?H #583
Formatting witharas the locale continues to default to Latin digits, but the numbering system can be customized for all messages via a locale extension (e.g.ar-u-nu-arab), or for a specific placeholder by wrapping the number in a FluentNumber and specifying itsnumberingSystemoption value. Tests are added to validate this. -
Closes Request Feature: Support prefix identifier for message #624
The parser is moved to a function outside the FluentResource class, which effectively makes it private within that module. It's also slightly optimised, e.g. removing repetitions of testing the same string with the same regexp. -
Additionally, a selector with no variants is now treated as a syntax error, as it should be.