Python implementation of Project Fluent

Overview

Project Fluent

This is a collection of Python packages to use the Fluent localization system.

python-fluent consists of these packages:

fluent.syntax

The syntax package includes the parser, serializer, and traversal utilities like Visitor and Transformer. You’re looking for this package if you work on tooling for Fluent in Python.

fluent.runtime

The runtime package includes the library required to use Fluent to localize your Python application. It comes with a Localization class to use, based on an implementation of FluentBundle. It uses the tooling parser above to read Fluent files.

fluent.pygments

A plugin for pygments to add syntax highlighting to Sphinx.

Discuss

We’d love to hear your thoughts on Project Fluent! Whether you’re a localizer looking for a better way to express yourself in your language, or a developer trying to make your app localizable and multilingual, or a hacker looking for a project to contribute to, please do get in touch on the mailing list and the IRC channel.

Get Involved

python-fluent is open-source, licensed under the Apache License, Version 2.0. We encourage everyone to take a look at our code and we’ll listen to your feedback.

Comments
  • Implement MessageContext.format

    Implement MessageContext.format

    Implementation of #65

    This is incomplete, but at a reviewable level - the remaining work to be done shouldn't influence the overall design that much.

    I'm unlikely to get back to this soon, but leaving this here so that others are aware that a start has been made, and if anyone wants to give feedback then they can.

    opened by spookylukey 31
  • AttributeError: 'FluentBundle' object has no attribute 'add_messages'

    AttributeError: 'FluentBundle' object has no attribute 'add_messages'

    I'm shopping around for gettext replacements. Is the python fluent client (and fluent more broadly) still being maintained?

    I mainly ask because even the happy path described in the docs does not work properly right now:

    pip install fluent.runtime
    python
    
    from fluent.runtime import FluentBundle
    bundle = FluentBundle(['en-US'])
    bundle.add_messages("""""")
    Traceback (most recent call last):
      File "/park/server/env/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3331, in run_code
        exec(code_obj, self.user_global_ns, self.user_ns)
      File "<ipython-input-2-2a5756cb5134>", line 4, in <module>
        bundle.add_messages("""""")
    AttributeError: 'FluentBundle' object has no attribute 'add_messages'
    

    Looks like it was yanked out in the 0.3.0 "pre-release" and the docs weren't updated.

    Anyway, Fluent seems cool, but I'd rather not go through the heartache of using it only to learn in 6 months that Mozilla has abandoned it. Thanks for any insight you have!

    opened by plowman 13
  • Migrate empty translations

    Migrate empty translations

    Migrate empty translations as {""}. See https://bugzil.la/1441942.

    Empty plural variants are also kept as {""} to preserve as much of the original intent as possible. Dropping them could result in different behavior when the default variant is displayed instead.

    This doesn't address migrating leading and trailing whitespace in non-whitespace-only legacy translations. See https://bugzil.la/1374246.

    See https://github.com/projectfluent/python-fluent/pull/54#issuecomment-371536006.

    opened by stasm 10
  • Implement BaseNode.visit API

    Implement BaseNode.visit API

    BaseNode.traverse can be costly because it clones the entire tree under the node it ran on. We should add a new method just for non-destructive visiting. This will be useful for the equals methods, as well as for the compare-locales checks.

    fluent.syntax 
    opened by stasm 9
  • Docs and/or status of project

    Docs and/or status of project

    At first I was going to ask for docs on how to actually use this package. On further inspection it doesn't look like it has yet reached minimum functionality. If would be great if the README could be updated to indicate the project status.

    Thanks!

    opened by spookylukey 9
  • Compiling MessageContext

    Compiling MessageContext

    This is a second implementation of MessageContext using a compile-to-python strategy. The PR builds on top of #67 and should be reviewed after that has been merged.

    My idea is that both implementations will be available, with the compiler the default because it is much faster (some benchmarks included in the new benchmark script). The interpreter is much easier to add new things to (which could be important for other contributors) and has some features/behaviour that the compiler doesn't have (documented). In addition, the two implementations can help test each other to some extent, and if you have any planned extensions, having two implementations, although twice the work, can help to ensure that the new feature doesn't limit you to a specific implementation strategy.

    For example, I have an escapers feature that I need for django-ftl - see docs , which I've been able to implement for both the interpreter and compiler, but starting with the interpreter was easier. (That branch hasn't been updated for the 0.6 spec changes yet).

    This branch is mostly complete, but probably needs some final cleanup. I'm opening it now in order to make @stasm aware of its existence (especially as I'm away for a bit now). It doesn't change that much from the interpreter MessageContext already implemented, but does clean up and clarify a few things (e.g. the error handling strategy), and MessageContext gains a check_message method (currently undocumented).

    If you want to look at it, I imagine that starting with reading the tests/test_compiler.py tests will be the best way to go - it will illustrate the whole strategy, and the kind of optimizations that are implemented, which should explain a lot of the compiler.py and codegen.py code.

    opened by spookylukey 8
  • Attributes and tags and multiline patterns should allow blank lines before them

    Attributes and tags and multiline patterns should allow blank lines before them

    Currently, none of the following messages parses correctly:

    foo =
    
    
        Mutliline Foo Value
    
    
    bar1
    
    
        .attr = Attr
    
    
    bar2
    
    
        .attr1 = Attr1
    
    
        .attr2 = Attr2
    
    
    
    bar3 =
    
    
        Multiline Bar Value
    
    
        .attr = Attr
    
    
    bar4
    
    
        .attr =
    
    
            Multiline Attr Value
    
    
    qux1 = Qux
    
    
        #tag
    
    
    qux2 = Qux
    
    
        #tag1
    
    
        #tag2
    
    opened by stasm 8
  • Never migrate partial translations

    Never migrate partial translations

    Partial translations may break the AST because they produce TextElements with None values. For now, explicitly skip any transforms which depend on at least one missing legacy string.

    In the future we might be able to allow partial migrations in some situations, like migrating a subset of attributes of a message. See https://bugzilla.mozilla.org/show_bug.cgi?id=1321271.

    opened by stasm 7
  • Documentation is out of date

    Documentation is out of date

    Edit: It appeared that the fluent.runtime I installed with pip install fluent.runtime was actually a lot older than what I expected.

    When adding messages to Fluent bundles, the documentation at https://fluent-runtime.readthedocs.io/en/latest/index.html states you can directly add the messages as a template string like so:

    >>> bundle.add_messages("""
    ... welcome = Welcome to this great app!
    ... greet-by-name = Hello, { $name }!
    ... """)
    

    In reality, you have to wrap the template string into a FluentResource and use bundle.add_resource instead of bundle.add_messages because it does not exist. The add_resource function checks if there is a body key in the resource function parameter, which is generated by the FluentResource class.

    from fluent.runtime import FluentBundle, FluentResource
    
    bundle = FluentBundle(['en-us'])
    bundle.add_resource(FluentResource("""
    welcome = Welcome!
    """))
    

    Also, bundle.format() does not exist.

    opened by alehuo 5
  • Add the Placeable node

    Add the Placeable node

    WIP. Implement https://github.com/projectfluent/fluent/pull/52.

    This doesn't pass structure tests because the AST changes, obviously. All but one behavior tests pass. I'm trying to find the bug.

    opened by stasm 5
  • Add Spans to all Nodes

    Add Spans to all Nodes

    Most AST nodes can now have a Span. Use FluentParser(with_spans=True) to enable this behavior. The with_annotations config option to FluentParser has been removed. The parser always produces Annotations if necessary now.

    opened by stasm 5
  • Bump certifi from 2020.12.5 to 2022.12.7 in /docs

    Bump certifi from 2020.12.5 to 2022.12.7 in /docs

    Bumps certifi from 2020.12.5 to 2022.12.7.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Incorrect handling of tabs in message value

    Incorrect handling of tabs in message value

    As identified in https://github.com/mozilla/pontoon/issues/2470#issuecomment-1107451952, this happens:

    from fluent.syntax import ast, FluentParser, FluentSerializer
    parser = FluentParser()
    serializer = FluentSerializer()
    
    string = """places-open-in-container-tab =
        .label = Բացել նոր ներդիրում
        .accesskey =	
    """
    
    string
    'places-open-in-container-tab =\n    .label = Բացել նոր ներդիրում\n    .accesskey = \t\n'
    
    serializer.serialize(parser.parse(string))
    'places-open-in-container-tab =\n    .label = Բացել նոր ներդիրում\n    .accesskey = \n'
    

    Tabs should not be lost; they count as valid inline_text characters according to the spec.

    opened by eemeli 2
  • Bump babel from 2.9.0 to 2.9.1 in /docs

    Bump babel from 2.9.0 to 2.9.1 in /docs

    Bumps babel from 2.9.0 to 2.9.1.

    Release notes

    Sourced from babel's releases.

    Version 2.9.1

    Bugfixes

    • The internal locale-data loading functions now validate the name of the locale file to be loaded and only allow files within Babel's data directory. Thank you to Chris Lyne of Tenable, Inc. for discovering the issue!
    Changelog

    Sourced from babel's changelog.

    Version 2.9.1

    Bugfixes

    
    * The internal locale-data loading functions now validate the name of the locale file to be loaded and only
      allow files within Babel's data directory.  Thank you to Chris Lyne of Tenable, Inc. for discovering the issue!
    
    Commits
    • a99fa24 Use 2.9.0's setup.py for 2.9.1
    • 60b33e0 Become 2.9.1
    • 412015e Merge pull request #782 from python-babel/locale-basename
    • 5caf717 Disallow special filenames on Windows
    • 3a700b5 Run locale identifiers through os.path.basename()
    • 5afe2b2 Merge pull request #754 from python-babel/github-ci
    • 58de834 Replace Travis + Appveyor with GitHub Actions (WIP)
    • d1bbc08 import_cldr: use logging; add -q option
    • 156b7fb Quiesce CLDR download progress bar if requested (or not a TTY)
    • 613dc17 Make the import warnings about unsupported number systems less verbose
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Cannot read string beyond 1000 characters

    Cannot read string beyond 1000 characters

    When trying to access a string with the format_value() method, it returns the string normally given it's a relatively short string. But if a string longer than 73 lines is entered, it returns {???} instead of said string. PFA test case which will help reproduce the bug here.

    bug help wanted fluent.runtime 
    opened by GetPsyched 1
  • FluentLocalization swallows errors

    FluentLocalization swallows errors

    fluent_value does not provide a way to retrieve errors produced out of bundle - https://github.com/projectfluent/python-fluent/blob/c58681f1e90c14dd36c2ff35d7d487235b685177/fluent.runtime/fluent/runtime/fallback.py#L37

    This makes it really hard to debug them for the user :)

    bug help wanted fluent.runtime 
    opened by zbraniecki 0
  • [email protected](Sep 15, 2020)

    • Fix serialization of multiline patterns starting with special characters. (#156)

      The built-in behavior of FluentSerializer is to serialize multiline patterns starting on a new line:

      key =
          Foo
          Bar
      

      This 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:

      key = *Foo
          Bar
      

      Such a pattern must not be serialized as following, because the asterisk has a special meaning if placed at the beginning of a line.

      # 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

    Source code(tar.gz)
    Source code(zip)
  • [email protected](May 20, 2020)

    • Documentation is now on https://projectfluent.org/python-fluent/fluent.syntax/.
    • Removal of deprecated BaseNode.traverse method.
    • Refactor Visitor and Transformer into fluent.syntax.visitor (from .ast)
    Source code(tar.gz)
    Source code(zip)
  • [email protected](May 20, 2020)

  • [email protected](May 20, 2020)

  • [email protected](Oct 23, 2019)

    • Added fluent.runtime.FluentResource and fluent.runtime.FluentBundle.add_resource.
    • Removed fluent.runtime.FluentBundle.add_messages.
    • Replaced bundle.format() with bundle.format_pattern(bundle.get_message().value).
    • Added fluent.runtime.FluentLocalization as main entrypoint for applications.
    Source code(tar.gz)
    Source code(zip)
  • [email protected](Sep 10, 2019)

  • [email protected](Sep 10, 2019)

    • Release a version with compatibility with the latest fluent.syntax 0.17.0.
    • First release with Fluent Syntax 1.0
    • Next release should revise APIs to be aligned with other implementations.
    Source code(tar.gz)
    Source code(zip)
  • [email protected](Aug 15, 2019)

    Initial release of fluent.pygments.

    Use this module to add syntax highlighting to documentation written in Sphinx and other tools that use pygments underneath.

    Source code(tar.gz)
    Source code(zip)
  • [email protected](Aug 6, 2019)

  • [email protected](Aug 1, 2019)

  • [email protected](Apr 17, 2019)

  • [email protected](Mar 26, 2019)

    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. CallExpression of an AttributeExpression of a TermReference), all information is available directly in the reference expression.

      This change affects the following AST nodes:

      • MessageReference now has an optional attribute field,
      • FunctionReference now has a required arguments field,
      • TermReference now has an optional attribute field and an optional arguments field.
    • Remove VariantLists.

      The VariantLists and the VariantExpression syntax and AST nodes were deprecated in Syntax 0.9 and have now been removed.

    • Rename StringLiteral.raw to value.

      StringLiteral.value contains 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 args to arguments.

      The args field of MessageReference, TermReference, FunctionReference, and Annotation has been renamed to arguments.

    Backward-incompatible changes:

    • VariantLists are no longer valid syntax. A syntax error is reported when a VariantList or a VariantExpression is found in the parsed file
    Source code(tar.gz)
    Source code(zip)
  • [email protected](Mar 25, 2019)

    • Make BaseNode.equals stricter 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:

      from fluent.syntax.serializer import serialize_expression
      
    Source code(tar.gz)
    Source code(zip)
  • [email protected](Feb 15, 2019)

    • Fixes to the Visitor API

      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.

    Source code(tar.gz)
    Source code(zip)
  • [email protected](Feb 14, 2019)

    • 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.

    Source code(tar.gz)
    Source code(zip)
  • [email protected](Jan 21, 2019)

    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.

    Source code(tar.gz)
    Source code(zip)
  • [email protected](Jan 15, 2019)

    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.

    Source code(tar.gz)
    Source code(zip)
  • 0.10.0(Dec 13, 2018)

    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.

      multiline =
          This message has 2 spaces of indent
            on the second line of its value.
      

      Terms can now be parameterized via the call expression syntax.

      # A parametrized Term with a Pattern as a value.
      -thing = { $article ->
         *[definite] the thing
          [indefinite] a thing
      }
      
      this = This is { -thing(article: "indefinite") }.
      

      VariantLists are now deprecated and will be removed from the Syntax before version 1.0.

      All escapes sequences can only be used in StringLiterals now (see below). \UHHHHHH is 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 in TextElements. It's no longer possible to use escape sequences in TextElements. Please use StringLiterals instead, e.g. {"\u00A0"}.
    • The closing curly brace character (}) is not allowed in TextElements now. Please use StringLiterals instead: {"}"}.
    • StringLiteral.value was changed to store the unescaped ("cooked") value. StringLiteral.raw has been added to store the raw value.
    • The AST of CallExpressions was changed to better accommodate the introduction of parameterized Terms. The Function AST node has been replaced by the FunctionReference node.
    • The leading dash (-) is no longer part of the Identifier node in Terms and TermReferences.
    Source code(tar.gz)
    Source code(zip)
  • 0.9.0(Oct 23, 2018)

    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:

      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.
    Source code(tar.gz)
    Source code(zip)
  • 0.8.0(Jul 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.

    Source code(tar.gz)
    Source code(zip)
  • 0.7.0(Apr 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 ref field to VariantExpression. (#62)

      The Identifier-typed id field has been removed. The new ref field contains the MessageReference node rigt now. The range of valid expressions for ref may be extended in the future.

    • Fix missing Spans on Function nodes.

    Source code(tar.gz)
    Source code(zip)
  • 0.6.4(Mar 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
    Source code(tar.gz)
    Source code(zip)
  • 0.6.3(Feb 13, 2018)

  • 0.6.2(Feb 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 as id = 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)

    Source code(tar.gz)
    Source code(zip)
  • 0.6.1(Feb 6, 2018)

    Various fixes to fluent.migrate for bug 1424682.

    • Accept Patterns and PatternElements in REPLACE. (#41)

      REPLACE can now use Patterns, PatternElements and Expressions as replacement values. This makes REPLACE accept the same Transforms as CONCAT.

    • Never migrate partial translations. (#44)

      Partial translations may break the AST because they produce TextElements with None values. 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)

    Source code(tar.gz)
    Source code(zip)
  • 0.6.0(Jan 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.

      FluentParser will 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.

      FluentSerializer always serializes using the new Syntax 0.5.

    • Expose FluentSerializer.serializeExpression. (#134)

    • Fix Bug 1428000 - Migrate: only annotate affected files (#34)

    Source code(tar.gz)
    Source code(zip)
  • 0.4.4(Nov 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_localization is now automatically called internally when the context encounters a transforms which is a subclass of Source.

    Source code(tar.gz)
    Source code(zip)
  • 0.4.3(Nov 29, 2017)

    • Bug 1397234 - Allow blank lines before attributes, tags and multiline patterns
    • Bug 1406342 - Trim trailing newline in Comment and Section spans
    Source code(tar.gz)
    Source code(zip)
  • 0.4.2(Nov 29, 2017)

    • Add an intermediate Placeable node for Expressions within Patterns.

      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.

    Source code(tar.gz)
    Source code(zip)
  • 0.4.1(Nov 29, 2017)

    • Add BaseNode.equals for deep-equality testing.

      Nodes are deeply compared on a field by field basis. If possible, False is returned early. When comparing attributes, tags and variants in SelectExpressions, the order doesn't matter. By default, spans are not taken into account. Other fields may also be ignored if necessary:

      message1.equals(message2, ignored_fields=['comment', 'span'])
      
    Source code(tar.gz)
    Source code(zip)
Owner
Project Fluent
A localization paradigm designed to unleash the entire expressive power of natural language translations.
Project Fluent
Dynamic Slimmable Network (CVPR 2021, Oral)

Dynamic Slimmable Network (DS-Net) This repository contains PyTorch code of our paper: Dynamic Slimmable Network (CVPR 2021 Oral). Architecture of DS-

Changlin Li 197 Dec 09, 2022
PyTorch implementation of "PatchGame: Learning to Signal Mid-level Patches in Referential Games" to appear in NeurIPS 2021

PatchGame: Learning to Signal Mid-level Patches in Referential Games This repository is the official implementation of the paper - "PatchGame: Learnin

Kamal Gupta 22 Mar 16, 2022
Pytorch implementation of "Get To The Point: Summarization with Pointer-Generator Networks"

About this repository This repo contains an Pytorch implementation for the ACL 2017 paper Get To The Point: Summarization with Pointer-Generator Netwo

wxDai 7 Oct 14, 2022
This is a project based on ConvNets used to identify whether a road is clean or dirty. We have used MobileNet as our base architecture and the weights are based on imagenet.

PROJECT TITLE: CLEAN/DIRTY ROAD DETECTION USING TRANSFER LEARNING Description: This is a project based on ConvNets used to identify whether a road is

Faizal Karim 3 Nov 06, 2022
A complete end-to-end demonstration in which we collect training data in Unity and use that data to train a deep neural network to predict the pose of a cube. This model is then deployed in a simulated robotic pick-and-place task.

Object Pose Estimation Demo This tutorial will go through the steps necessary to perform pose estimation with a UR3 robotic arm in Unity. You’ll gain

Unity Technologies 187 Dec 24, 2022
DCT-Mask: Discrete Cosine Transform Mask Representation for Instance Segmentation

DCT-Mask: Discrete Cosine Transform Mask Representation for Instance Segmentation This project hosts the code for implementing the DCT-MASK algorithms

Alibaba Cloud 57 Nov 27, 2022
Music Generation using Neural Networks Streamlit App

Music_Gen_Streamlit "Music Generation using Neural Networks" Streamlit App TO DO: Make a run_app.sh Introduction [~5 min] (Sohaib) Team Member names/i

Muhammad Sohaib Arshid 6 Aug 09, 2022
The AugNet Python module contains functions for the fast computation of image similarity.

AugNet AugNet: End-to-End Unsupervised Visual Representation Learning with Image Augmentation arxiv link In our work, we propose AugNet, a new deep le

Ming 74 Dec 28, 2022
Unofficial pytorch implementation of 'Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization'

pytorch-AdaIN This is an unofficial pytorch implementation of a paper, Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization [Hua

Naoto Inoue 873 Jan 06, 2023
This repository contains the code for the ICCV 2019 paper "Occupancy Flow - 4D Reconstruction by Learning Particle Dynamics"

Occupancy Flow This repository contains the code for the project Occupancy Flow - 4D Reconstruction by Learning Particle Dynamics. You can find detail

189 Dec 29, 2022
MASS (Mueen's Algorithm for Similarity Search) - a python 2 and 3 compatible library used for searching time series sub-sequences under z-normalized Euclidean distance for similarity.

Introduction MASS allows you to search a time series for a subquery resulting in an array of distances. These array of distances enable you to identif

Matrix Profile Foundation 79 Dec 31, 2022
Face and Body Tracking for VRM 3D models on the web.

Kalidoface 3D - Face and Full-Body tracking for Vtubing on the web! A sequal to Kalidoface which supports Live2D avatars, Kalidoface 3D is a web app t

Rich 257 Jan 02, 2023
Code for reproducing experiments in "Improved Training of Wasserstein GANs"

Improved Training of Wasserstein GANs Code for reproducing experiments in "Improved Training of Wasserstein GANs". Prerequisites Python, NumPy, Tensor

Ishaan Gulrajani 2.2k Jan 01, 2023
Implementation of trRosetta and trDesign for Pytorch, made into a convenient package

trRosetta - Pytorch (wip) Implementation of trRosetta and trDesign for Pytorch, made into a convenient package

Phil Wang 67 Dec 17, 2022
The Agriculture Domain of ERPNext comes with features to record crops and land

Agriculture The Agriculture Domain of ERPNext comes with features to record crops and land, track plant, soil, water, weather analytics, and even trac

Frappe 21 Jan 02, 2023
This is an unofficial implementation of the paper “Student-Teacher Feature Pyramid Matching for Unsupervised Anomaly Detection”.

This is an unofficial implementation of the paper “Student-Teacher Feature Pyramid Matching for Unsupervised Anomaly Detection”.

haifeng xia 32 Oct 26, 2022
Source code for The Power of Many: A Physarum Swarm Steiner Tree Algorithm

Physarum-Swarm-Steiner-Algo Source code for The Power of Many: A Physarum Steiner Tree Algorithm Code implements ideas from the following papers: Sher

Sheryl Hsu 2 Mar 28, 2022
My freqtrade strategies

My freqtrade-strategies Hi there! This is repo for my freqtrade-strategies. My name is Ilya Zelenchuk, I'm a lecturer at the SPbU university (https://

171 Dec 05, 2022
Standalone pre-training recipe with JAX+Flax

Sabertooth Sabertooth is standalone pre-training recipe based on JAX+Flax, with data pipelines implemented in Rust. It runs on CPU, GPU, and/or TPU, b

Nikita Kitaev 26 Nov 28, 2022
Official PyTorch Implementation of HELP: Hardware-adaptive Efficient Latency Prediction for NAS via Meta-Learning (NeurIPS 2021 Spotlight)

[NeurIPS 2021 Spotlight] HELP: Hardware-adaptive Efficient Latency Prediction for NAS via Meta-Learning [Paper] This is Official PyTorch implementatio

42 Nov 01, 2022