Releases: projectfluent/fluent.js
fluent-syntax 0.8.1 (August 1, 2018)
fluent 0.7.0 (July 24, 2018)
-
Implement support for Fluent Syntax 0.6.
Syntax 0.6 keeps the syntax unchanged and makes many small changes to the
previousl underspecified areas of the spec. The runtime parser now
supports Unicode escapes and properly trims whitespace in TextElements. -
Add
FluentResource
. (#244)FluentResource
is a class representing a parsed Fluent document. It was
added with caching in mind. It's now possible to parse a Fluent document
inton an instance ofFluentResouce
once and use it to construct new
MessageContexts
. For this end,MessageContext
now has the
addResource
method which takes an instance ofFluentResource
. -
Add the
transform
option toMessageContext
. (#213)MessageContext
now accepts a new option,transform
, which may be a
function. If passed it will be used to transform the string parts of
patterns. This may be used to implement programmatic transformations of
translations, e.g. to create pseudo-localizations. -
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+. -
Move
CachedSyncIterable
andCachedAsyncIterable
to a dependency.They are now available from the
cached-iterable
package.fluent
depends on it for running tests.
fluent-syntax 0.8.0 (July 24, 2018)
-
Implement support for Fluent Syntax 0.6. (#253)
Syntax 0.6 keeps the syntax unchanged but makes many changes to the AST.
Consult https://github.com/projectfluent/fluent/releases/tag/v0.6.0
for the list of changes. -
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+.
fluent-react 0.7.0 (May 18, 2018)
-
Protect void elements against translated text content. (#174)
Text content found in the translated markup is now ignored when the
element passed as a prop to<Localized>
is a known void element. This
prevents the element is a void element tag and must neither have
children nor use dangerouslySetInnerHTML error in React.For instance,
<input>
is a known void element and it must not have the
text content set by the buggy translation in the following example:<Localized id="hello" text-input={<input type="text" />}> <div /> </Localized>
hello = Hello, <text-input>invalid text content</text-input>.
Due to this change some build setups might now require the
@babel/plugin-proposal-object-rest-spread
or the
@babel/plugin-syntax-object-rest-spread
plugin. -
Support HTML entities in translations. (#183)
Translations with HTML entities will now trigger the markup sanitization
logic and will be consequently parsed into the characters they represent. -
Re-render
withLocalization
-components on l10n changes. (#196)Components enhanced by the
withLocalization
are now re-rendered when
the enclosing<LocalizationProvider>
receives a new value of the
messages
prop. -
Use compat dependencies only in fluent-react/compat. (#193)
When
fluent-react
is imported asfluent-react
it will now use the
untranspiled version of itsfluent
dependency for consistency. When
it's imported asfluent-react/compat
it will usefluent/compat
too.Due to this change some build setups might now require the
@babel/plugin-proposal-async-generator-functions
or the
@babel/plugin-syntax-async-generators
plugin. -
Upgrade to Babel 7. (#126)
fluent-react/compat
is now built with Babel 7.
fluent-dom 0.3.0 (May 14, 2018)
fluent-syntax 0.7.0 (April 17, 2018)
-
Add the
ref
field toVariantExpression
.The
Identifier
-typedid
field ofVariantExpression
has been removed
and replaced by anExpression
-typedref
field. The newref
field
can now holdMessageReference
nodes. The range of valid expressions for
ref
may be extended in the future.
fluent 0.6.4 (April 11, 2018)
- Minor optimization to bidirectionality isolation
- Added error logging when attempting an already registered message id
fluent-dom 0.2.0 (April 11, 2018)
-
DOM Overlays v2 (#168)
Major refactor of DOM Overlays allowing developers to provide node elements as arguments. This is breaking change compared to
[email protected]
.In 0.1.0 only text-level elements were allowed in translations. Additionally, if a element of the same type was present in the source HTML, its functional attributes were copied to the translated element. This approach allowed translations to use the
<a>
element and have itshref
attribute copied from the source. It was limited, however, to text-semantic elements (<img>
or<button>
were not supported) and to overlaying child elements in the order defined by the source.0.2.0 introduces two separate use-cases:
-
Text-level elements. Localizers may want to use some HTML markup to make the translation correct according to the rules of grammar and spelling. For instance,
<em>
may be used for words borrowed from foreign languages,<sup>
may be used for ordinals or abbreviations, etc. -
Functional elements. Developers may want to pass elements as arguments to the translation and create rich language-agnostic UIs. For instance, they may define an
<img>
element which should be placed inline inside of the translation. Each language will need to decide where exactly the<img>
should go.
Text-Level Elements
For the first use-case, fluent-dom will now always allow a safe set of text-level elements such as
<em>
and<strong>
. Their contents will always be converted to pure text (no nesting is allowed) and their attributes will be sanitized using a well-defined list of safe attributes.hello = Hello, <em title="It's a wonderful world.">world</em>!
Functional Elements
For the latter use-case, developers may put child elements inside of the element which is the target of the translation. These child elements must be annotated with the data-l10n-name attribute. fluent-dom will look for corresponding child elements defined by the translation and clone them into the final translated result. The cloning preserves functional attributes defined in the source (
href
,class
,src
) but destroys any event listeners attached to the child element. (We may be able to relax this limitation in the future.) Safe attributes found on the matching child element from the translation will be copied to the resulting child.<p data-l10n-id="hello-icon"> <img data-l10n-name="world" src="world.png"> </p> hello-icon = Hello, <img data-l10n-name="world">!
-
-
Refactored error reporting (#160)
-
Fixed a minor bug which caused an extraneous retranslation when
data-l10n-id
was being removed from an element.
fluent-syntax 0.6.6 (March 19, 2018)
Function
AST nodes have a span now. (#167)
fluent-syntax 0.6.5 (March 8, 2018)
-
Temporarily relax the
engines
requirement. (#164)Include node 6.9.* LTS in the
engines
requirement to unblock
mozilla/addons-linter#1789 and thus unblock langpack signing for
Firefox 60.This is a temporary measure until
addons-linter
phases out the support
for node 6 which should happen in May 2018.