Recent Releases of fluent
fluent - fluent.runtime 0.4.0
- Drop support for Python 2.7 and 3.5 & support for Python 3.6 through 3.9 (#163)
- Add type hints (#180)
- Python
Published by eemeli over 2 years ago
fluent - fluent.syntax 0.19.0
- Drop support for Python 2.7 and 3.5 & support for Python 3.6 through 3.9 (#161)
- Treat tab as text, not whitespace (#179)
- Add type hints (#180)
- Python
Published by eemeli over 2 years ago
fluent - fluent.syntax 0.18.1
Fix serialization of multiline patterns starting with special characters. (#156)
The built-in behavior of
FluentSerializeris to serialize multiline patterns starting on a new line:properties key = Foo BarThis used to lead to syntax errors if the pattern started with one of the special characters in the Fluent Syntax: a curly brace, a period, an asterisk, or a square bracket, and if it was originally written with the first line on the same line as the identifier:
properties key = *Foo BarSuch a pattern must not be serialized as following, because the asterisk has a special meaning if placed at the beginning of a line.
```properties
Syntax Error
key = *Foo Bar ```
The fix preserves the original layout of the pattern, i.e. it is now serialized starting inline with the identifier
- Python
Published by stasm over 5 years ago
fluent - fluent.pygments 1.0
Documentation and package metadata updated.
- Python
Published by Pike about 6 years ago
fluent - fluent.runtime 0.3.1
Updated documentation and package metadata.
- Python
Published by Pike about 6 years ago
fluent - fluent.syntax 0.18.0
- Documentation is now on https://projectfluent.org/python-fluent/fluent.syntax/.
- Removal of deprecated
BaseNode.traversemethod. - Refactor
VisitorandTransformerintofluent.syntax.visitor(from.ast)
- Python
Published by Pike about 6 years ago
fluent - fluent.runtime 0.3.0
- Added
fluent.runtime.FluentResourceandfluent.runtime.FluentBundle.add_resource. - Removed
fluent.runtime.FluentBundle.add_messages. - Replaced
bundle.format()withbundle.format_pattern(bundle.get_message().value). - Added
fluent.runtime.FluentLocalizationas main entrypoint for applications.
- Python
Published by Pike over 6 years ago
fluent - fluent.runtime 0.2.0
- Release a version with compatibility with the latest
fluent.syntax0.17.0. - First release with Fluent Syntax 1.0
- Next release should revise APIs to be aligned with other implementations.
- Python
Published by Pike over 6 years ago
fluent - fluent.syntax 0.17.0
Parser fix for whitespace before call arguments.
This includes the fixes for https://github.com/projectfluent/fluent/issues/281.
- Python
Published by Pike over 6 years ago
fluent - fluent.pygments 0.1.0
Initial release of fluent.pygments.
Use this module to add syntax highlighting to documentation written in Sphinx and other tools that use pygments underneath.
- Python
Published by Pike almost 7 years ago
fluent - fluent.syntax 0.16.0
Parser fix for selector expressions being too lenient.
This includes the fixes for https://github.com/projectfluent/fluent/issues/279.
- Python
Published by Pike almost 7 years ago
fluent - fluent.syntax 0.15.1
Comment Serializer fix.
The serializer had a bug when asked to serialize empty comments.
- Python
Published by Pike almost 7 years ago
fluent - fluent.syntax 0.15.0
Support Fluent Syntax 1.0.
Fluent Syntax 1.0 has been published today. There are no changes to the grammar nor the AST compared to the Syntax 0.9.
- Python
Published by stasm about 7 years ago
fluent - fluent.syntax 0.14.0
This release of fluent.syntax brings support for version 0.9 of the Fluent
Syntax spec. The API remains unchanged. Files written in valid Syntax 0.8 may
parse differently in this release. See the compatibility note below. Consult
the full Syntax 0.9 changelog for details.
Flatten complex reference expressions.
Reference expressions which may take complex forms, such as a reference to a message's attribute, or a parameterized reference to an attribute of a term, are now stored in a simplified manner. Instead of nesting multiple expression nodes (e.g.
CallExpressionof anAttributeExpressionof aTermReference), all information is available directly in the reference expression.This change affects the following AST nodes:
-
MessageReferencenow has an optionalattributefield, FunctionReferencenow has a requiredargumentsfield,TermReferencenow has an optionalattributefield and an optionalargumentsfield.
-
Remove
VariantLists.The
VariantListsand theVariantExpressionsyntax and AST nodes were deprecated in Syntax 0.9 and have now been removed.Rename
StringLiteral.rawtovalue.StringLiteral.valuecontains the exact contents of the string literal, character-for-character. Escape sequences are stored verbatim without processing. A new method,Literal.parse, can be used to process the raw value of the literal into an unescaped form.Rename
argstoarguments.The
argsfield ofMessageReference,TermReference,FunctionReference, andAnnotationhas been renamed toarguments.
Backward-incompatible changes:
VariantListsare no longer valid syntax. A syntax error is reported when aVariantListor aVariantExpressionis found in the parsed file
- Python
Published by stasm about 7 years ago
fluent - fluent.syntax 0.13.0
- Make
BaseNode.equalsstricter when comparing lists.
Starting from this version, BaseNode.equals now takes the order of
variants and attributes into account when comparing two nodes.
- Remove
FluentSerializer.serialize_expression.
The stateless equivalent can still be imported from fluent.syntax.serializer:
python
from fluent.syntax.serializer import serialize_expression
- Python
Published by stasm about 7 years ago
fluent - fluent.syntax 0.12.0
- Fixes to the
VisitorAPI
The Visitor API introduced in 0.11 was changed to align more with
what Python's ast.Visitor does. This also allows implementations
to have code after descending into child nodes.
- Python
Published by Pike over 7 years ago
fluent - fluent.syntax 0.11.0
- API enhancements
There are two new APIs in fluent.syntax.ast, Visitor and Transformer.
Use these APIs for read-only iteration over AST trees, and in-place mutation
of AST trees, respectively. There's also a new method BaseNode.clone,
which can be used to create a deep copy of an AST node.
- DEPRECATIONS
The API BaseNode.traverse is deprecated and will be removed in a future
release. Please adjust your code to the Visitor or Transformer APIs.
- Python
Published by Pike over 7 years ago
fluent - fluent.runtime 0.1
First release to PyPI of fluent.runtime. This release contains a FluentBundle implementation that can generate transaltions from FTL spec. It targets the Fluent 0.6 spec.
- Python
Published by spookylukey over 7 years ago
fluent - fluent.syntax 0.10.0
The fluent package which used to provide the fluent.syntax module has been renamed to fluent.syntax on PyPI. The code is identical to fluent 0.10.
- Python
Published by stasm over 7 years ago
fluent - fluent 0.10.0
This release brings support for version 0.8 of the Fluent Syntax spec. The API remains unchanged. Files written in valid Syntax 0.7 may not parse correctly in this release. See the summary of backwards-incompatible changes below.
Implement Fluent Syntax 0.8. (#303)
This is only a quick summary of the spec changes in Syntax 0.8. Consult the full changelog for details.
In multiline
Patterns, all common indent is now removed from each indented line in the final value of the pattern.properties multiline = This message has 2 spaces of indent on the second line of its value.Termscan now be parameterized via the call expression syntax.```properties
A parametrized Term with a Pattern as a value.
-thing = { $article -> *[definite] the thing [indefinite] a thing }
this = This is { -thing(article: "indefinite") }. ```
VariantListsare now deprecated and will be removed from the Syntax before version 1.0.All escapes sequences can only be used in
StringLiteralsnow (see below).\UHHHHHHis a new escape sequence format suitable for codepoints above U+FFFF, e.g.{"\U01F602"}.
Backward-incompatible changes:
- The backslash character (
\) is now considered a regular character inTextElements. It's no longer possible to use escape sequences inTextElements. Please useStringLiteralsinstead, e.g.{"\u00A0"}. - The closing curly brace character (
}) is not allowed inTextElementsnow. Please useStringLiteralsinstead:{"}"}. StringLiteral.valuewas changed to store the unescaped ("cooked") value.StringLiteral.rawhas been added to store the raw value.- The AST of
CallExpressionswas changed to better accommodate the introduction of parameterizedTerms. TheFunctionAST node has been replaced by theFunctionReferencenode. - The leading dash (
-) is no longer part of theIdentifiernode inTermsandTermReferences.
- Python
Published by stasm over 7 years ago
fluent - fluent 0.9.0
This release 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:
properties 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) orIdentifiers. TheVariantNamenode class has been removed. Variant keys with spaces in them produce syntax errors, e.g.[New York]. CRis not a valid EOL character anymore. Please useLForCRLF.Tabis not recognized as syntax whitespace. It can only be used in translation content.
- Python
Published by stasm over 7 years ago
fluent - fluent 0.8.0 (July 24, 2018)
Implement support for Fluent Syntax 0.6. (#69)
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.
- Python
Published by stasm almost 8 years ago
fluent - fluent 0.7.0 (April 11, 2018)
Remove
fluent.migrate.The migration code has been moved into its own repository: fluent-migration. See bug 1445881 for more information about the move.
Add the
reffield toVariantExpression. (#62)The
Identifier-typedidfield has been removed. The newreffield contains theMessageReferencenode rigt now. The range of valid expressions forrefmay be extended in the future.Fix missing
SpansonFunctionnodes.
- Python
Published by Pike about 8 years ago
fluent - fluent 0.6.4 (March 1, 2018)
- use compare-locales for plurals ordering (bug 1415844)
- create transforms when all dependencies have been met up to a changeset
- support variant keys in BaseNode.equals
- serialize select expressions on a new line
- Python
Published by Pike over 8 years ago
fluent - fluent 0.6.3 (February 13, 2018)
- Fix merge code to handle Terms properly
- Python
Published by zbraniecki over 8 years ago
fluent - fluent 0.6.2 (February 8, 2018)
Inline Patterns may start with any character. (#48)
},.,*and[are only special when they appear at the beginning of indented Pattern lines. When a Pattern starts on the same line asid =or[variant key], its first character doesn't carry any special meaning and it may be one of those four ones as well.This also fixes a regression from 0.6.0 where a message at the EOF without value nor attributes was incorrectly parsed as a message with an empty Pattern rather than produce a syntax error.
Require compare-locales to run and test fluent.migrate. (#47)
- Python
Published by stasm over 8 years ago
fluent - fluent 0.6.1 (February 6, 2018)
Various fixes to fluent.migrate for bug 1424682.
Accept
PatternsandPatternElementsinREPLACE. (#41)REPLACEcan now usePatterns,PatternElementsandExpressionsas replacement values. This makesREPLACEaccept the same Transforms asCONCAT.Never migrate partial translations. (#44)
Partial translations may break the AST because they produce
TextElementswithNonevalues. For now, we explicitly skip any transforms which depend on at least one missing legacy string to avoid serialization errors.Warn about unknown FTL entries in transforms. (#40)
Fix how files are passed to
hg annotate. (#39)
- Python
Published by stasm over 8 years ago
fluent - fluent 0.6.0 (January 31, 2018)
Implement Fluent Syntax 0.5.
- Add support for terms.
- Add support for
#,##and###comments. - Remove support for tags.
- Add support for
=after the identifier in message and term defintions. - Forbid newlines in string expressions.
- Allow trailing comma in call expression argument lists.
In fluent-syntax 0.6.x the new Syntax 0.5 is supported alongside the old Syntax 0.4. This should make migrations easier.
FluentParserwill correctly parse Syntax 0.4 comments (prefixed with//), sections and message definitions without the=after the identifier. The one exception are tags which are no longer supported. Please use attributed defined on terms instead.FluentSerializeralways serializes using the new Syntax 0.5.Expose
FluentSerializer.serializeExpression. (#134)Fix Bug 1428000 - Migrate: only annotate affected files (#34)
- Python
Published by stasm over 8 years ago
fluent - fluent 0.4.4 (November 29, 2017)
- Run Structure and Behavior tests in Python 3 (#22)
- Bug 1411943 - Fix Blame for Mercurial 4.3+ (#23)
- Bug 1412808 - Remove the LITERAL helper. (#25)
Bug 1321279 - Read target FTL files before migrations. (#24)
The reference file for the transforms must now be passed as the second argument to
add_transforms.Bug 1318960 - Migrate files only when their messages change (#26)
Bug 1366298 - Skip SelectExpression in PLURALS for one plural category (#27)
Bug 1321290 - Migrate HTML entities to Unicode characters (#28)
Bug 1420225 - Read legacy files when scanning for Sources in transforms (#30)
MergeContext.maybe_add_localizationis now automatically called internally when the context encounters a transforms which is a subclass of Source.
- Python
Published by stasm over 8 years ago
fluent - fluent 0.4.3 (October 9, 2017)
- Bug 1397234 - Allow blank lines before attributes, tags and multiline patterns
- Bug 1406342 - Trim trailing newline in Comment and Section spans
- Python
Published by stasm over 8 years ago
fluent - fluent 0.4.2 (September 11, 2017)
Add an intermediate
Placeablenode forExpressionswithinPatterns.This allows storing more precise information about the whitespace around the placeable's braces.
See https://github.com/projectfluent/fluent/pull/52.
Serializer: Add newlines around standalone comments.
- Python
Published by stasm over 8 years ago
fluent - fluent 0.4.1 (June 27, 2017)
Add
BaseNode.equalsfor deep-equality testing.Nodes are deeply compared on a field by field basis. If possible,
Falseis returned early. When comparing attributes, tags and variants inSelectExpressions, the order doesn't matter. By default, spans are not taken into account. Other fields may also be ignored if necessary:py message1.equals(message2, ignored_fields=['comment', 'span'])
- Python
Published by stasm over 8 years ago