Skip to content

Releases: projectfluent/fluent.js

fluent 0.9.1

23 Oct 10:38
Compare
Choose a tag to compare
fluent 0.9.1 Pre-release
Pre-release
  • Forbid messages with null values and no attributes. (#299)

    Fix a parser behavior which caused it to parse messages without values nor attributes as "message-id": null. This skewed the return values of FluentBundle.hasMessage which would report true for messages which were null. This, in turn, would break code which assumed FluentBundle.getMessage would always return non-null values if it was guarded by a call to hasMessage first.

fluent 0.9.0

23 Oct 08:05
Compare
Choose a tag to compare
fluent 0.9.0 Pre-release
Pre-release

This release of fluent brings support for version 0.7 of the Fluent Syntax spec. The FluentBundle API remains unchanged. Files written in valid Syntax 0.6 may parse differently in this release. See the compatibility note below.

  • Implement Fluent Syntax 0.7. (#287)

    The major new feature of Syntax 0.7 is the relaxation of the indentation requirement for all non-text elements of patterns. It's finally possible to leave the closing brace of select expressions unindented:

    emails = { $unread_email_count ->
        [one] You have one unread email.
       *[other] You have { $unread_email_count } unread emails.
    }
    

    Consult the changelog to learn about other changes in Syntax 0.7.

  • Re-write the runtime parser. (#289)

    Syntax 0.7 was an opportunity to completely re-write the runtime parser, which was originally created in the pre-0.1 era of Fluent. It's now less than a half of the code size of the old parser and also slightly faster.

    The parser takes an optimistic approach to parsing. It focuses on minimizing the number of false negatives at the expense of increasing the risk of false positives. In other words, it aims at parsing valid Fluent messages with a success rate of 100%, but it may also parse a few invalid messages which the reference parser would reject. The parser doesn't perform strict validation of the all productions of the Fluent grammar. It may thus produce entries which wouldn't make sense in the real world. For best results users are advised to validate translations with the
    fluent-syntax parser pre-runtime (e.g. by using Pontoon or compare-locales).

Backward-incompatible changes

  • Variant keys can now be either numbers (as previously) or identifiers. Variant keys with spaces in them produce syntax errors, e.g. [New York].
  • CR is not a valid EOL character anymore. Please use LF or CRLF.
  • Tab is not recognized as syntax whitespace. It can only be used in translation content.

fluent-syntax 0.9.0

23 Oct 07:32
Compare
Choose a tag to compare
fluent-syntax 0.9.0 Pre-release
Pre-release

This release of fluent-syntax brings support for version 0.7 of the Fluent Syntax spec. The API remains unchanged. Files written in valid Syntax 0.6 may not parse correctly in this release. See the summary of backwards-incompatible changes below.

  • Implement Fluent Syntax 0.7. (#287)

    The major new feature of Syntax 0.7 is the relaxation of the indentation requirement for all non-text elements of patterns. It's finally possible to leave the closing brace of select expressions unindented:

    emails = { $unread_email_count ->
        [one] You have one unread email.
       *[other] You have { $unread_email_count } unread emails.
    }

    Consult the changelog to learn about other changes in Syntax 0.7.

Backward-incompatible changes:

  • Variant keys can now be either NumberLiterals (as previously) or Identifiers. The VariantName node class has been removed. Variant keys with spaces in them produce syntax errors, e.g. [New York].
  • CR is not a valid EOL character anymore. Please use LF or CRLF.
  • Tab is not recognized as syntax whitespace. It can only be used in translation content.

fluent 0.8.1

27 Sep 07:34
Compare
Choose a tag to compare
fluent 0.8.1 Pre-release
Pre-release
  • Expose FluentResource as an export. (#286)

    FluentResource is a data structure representing a parsed Fluent document.
    It can be used to cache resources which can then be added to FluentBundle
    via the addResource method. To create a FluentResource given a string
    of Fluent translations, use the static FluentResource.fromString method.

    let resource = FluentResource.fromString(text);
    bundle.addResource(resource);

    The undocumented _parse export was also removed in favor of
    FluentResource.fromString.

fluent-react 0.8.1

28 Aug 16:31
Compare
Choose a tag to compare
fluent-react 0.8.1 Pre-release
Pre-release
  • Change the fluent peer dependency to 0.8.x.

    Pin down the version of the fluent peer dependency to 0.8.x in case there
    are any breaking API changes in its future versions.

fluent-react 0.8.0

21 Aug 13:45
Compare
Choose a tag to compare
fluent-react 0.8.0 Pre-release
Pre-release
  • Rename the messages prop to bundles. (#222)

    <LocalizationProvider> now expects an iterable of FluentBundles to be
    passed as the bundles prop, rather than messages.

  • Allow custom parseMarkup functions. (#233)

    By default, fluent-react uses a <template> element to parse and
    sanitize markup in translations. In some scenarios like server-side
    rendering (SSR) or apps written in React Native, <template> is not
    available natively. In these situations a custom parseMarkup can be
    passed as a prop to <LocalizationProvider>. It will be used by all
    <Localized> components under it. See the wiki for details.

  • Drop support for IE and old evergreen browsers. (#133)

    Currently supported are: Firefox 52+, Chrome 55+, Edge 15+, Safari 10.1+,
    iOS Safari 10.3+ and node 8.9+.

  • Add the cached-iterable runtime dependency.

    CachedSyncIterable is now available from its own package rather than
    from the fluent package.

  • Add the fluent-sequence runtime dependency.

    mapBundleSync is now available from its own package rather than from
    the fluent package.

  • Define fluent >= 0.8.0 as a peer dependency.

fluent 0.8.0

20 Aug 14:37
Compare
Choose a tag to compare
fluent 0.8.0 Pre-release
Pre-release
  • Rename MessageContext to FluentBundle. (#222)

    The following renames have been made to the public API:

    • Rename MessageContext to FluentBundle.
    • Rename MessageArgument to FluentType.
    • Rename MessageNumberArgument to FluentNumber.
    • Rename MessageDateTimeArgument to FluentDateTime.
  • Move mapContext* functions to fluent-sequence. (#273)

    The mapContextSync and mapContextAsync functions previously exported
    by the fluent package have been moved to the new fluent-sequence
    package. fluent-sequence 0.1.0 corresponds to the exact
    implementation of these functions from fluent 0.7.0.

    In later versions of fluent-sequence, these functions are called
    mapBundleSync and mapBundleAsync, which is consistent with the naming
    used in fluent 0.8.0.

fluent-sequence 0.2.0

20 Aug 14:49
Compare
Choose a tag to compare
fluent-sequence 0.2.0 Pre-release
Pre-release
  • Rename mapContextSync to mapBundleSync. (#276)

  • Rename mapContextAsync to mapBundleAsync. (#276)

  • Declare fluent as peer dependency.

    fluent-sequence works well with any fluent version of 0.4.0 or above.

fluent-sequence 0.1.0 (August 17, 2018)

17 Aug 10:43
873b409
Compare
Choose a tag to compare
Pre-release

The initial release based on fluent 0.7.0.

fluent-dom 0.4.0 (August 8, 2018)

08 Aug 23:07
Compare
Choose a tag to compare
Pre-release
  • Drop support for IE and old evergreen browsers. (#133)

    Currently supported are: Firefox 52+, Chrome 55+, Edge 15+, Safari 10.1+,
    iOS Safari 10.3+ and node 8.9+.

  • Add the cached-iterable runtime dependency.

    CachedAsyncIterable is now available from its own package rather than
    from the fluent package.

  • Modify the constructor to not require window element to be passed.