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
Vrcwatch - Supply the local time to VRChat as Avatar Parameters through OSC

English: README-EN.md VRCWatch VRCWatch は、VRChat 内のアバター向けに現在時刻を送信するためのプログラムです。 使

Kosaki Mezumona 17 Nov 30, 2022
Learning to Reconstruct 3D Non-Cuboid Room Layout from a Single RGB Image

NonCuboidRoom Paper Learning to Reconstruct 3D Non-Cuboid Room Layout from a Single RGB Image Cheng Yang*, Jia Zheng*, Xili Dai, Rui Tang, Yi Ma, Xiao

67 Dec 15, 2022
Kaggle: Cell Instance Segmentation

Kaggle: Cell Instance Segmentation The goal of this challenge is to detect cells in microscope images. with simple view on how many cels have been ann

Jirka Borovec 9 Aug 12, 2022
PiCIE: Unsupervised Semantic Segmentation using Invariance and Equivariance in clustering (CVPR2021)

PiCIE: Unsupervised Semantic Segmentation using Invariance and Equivariance in Clustering Jang Hyun Cho1, Utkarsh Mall2, Kavita Bala2, Bharath Harihar

Jang Hyun Cho 164 Dec 30, 2022
Face detection using deep learning.

Face Detection Docker Solution Using Faster R-CNN Dockerface is a deep learning face detector. It deploys a trained Faster R-CNN network on Caffe thro

Nataniel Ruiz 181 Dec 19, 2022
arxiv-sanity, but very lite, simply providing the core value proposition of the ability to tag arxiv papers of interest and have the program recommend similar papers.

arxiv-sanity, but very lite, simply providing the core value proposition of the ability to tag arxiv papers of interest and have the program recommend similar papers.

Andrej 671 Dec 31, 2022
PyTorch image models, scripts, pretrained weights -- ResNet, ResNeXT, EfficientNet, EfficientNetV2, NFNet, Vision Transformer, MixNet, MobileNet-V3/V2, RegNet, DPN, CSPNet, and more

PyTorch Image Models Sponsors What's New Introduction Models Features Results Getting Started (Documentation) Train, Validation, Inference Scripts Awe

Ross Wightman 22.9k Jan 09, 2023
Unofficial Alias-Free GAN implementation. Based on rosinality's version with expanded training and inference options.

Alias-Free GAN An unofficial version of Alias-Free Generative Adversarial Networks (https://arxiv.org/abs/2106.12423). This repository was heavily bas

dusk (they/them) 75 Dec 12, 2022
Neighborhood Contrastive Learning for Novel Class Discovery

Neighborhood Contrastive Learning for Novel Class Discovery This repository contains the official implementation of our paper: Neighborhood Contrastiv

Zhun Zhong 56 Dec 09, 2022
Official PyTorch implementation of "RMGN: A Regional Mask Guided Network for Parser-free Virtual Try-on" (IJCAI-ECAI 2022)

RMGN-VITON RMGN: A Regional Mask Guided Network for Parser-free Virtual Try-on In IJCAI-ECAI 2022(short oral). [Paper] [Supplementary Material] Abstra

27 Dec 01, 2022
A short and easy PyTorch implementation of E(n) Equivariant Graph Neural Networks

Simple implementation of Equivariant GNN A short implementation of E(n) Equivariant Graph Neural Networks for HOMO energy prediction. Just 50 lines of

Arsenii Senya Ashukha 97 Dec 23, 2022
FairMOT - A simple baseline for one-shot multi-object tracking

FairMOT - A simple baseline for one-shot multi-object tracking

Yifu Zhang 3.6k Jan 08, 2023
UT-Sarulab MOS prediction system using SSL models

UTMOS: UTokyo-SaruLab MOS Prediction System Official implementation of "UTMOS: UTokyo-SaruLab System for VoiceMOS Challenge 2022" submitted to INTERSP

sarulab-speech 58 Nov 22, 2022
Barbershop: GAN-based Image Compositing using Segmentation Masks (SIGGRAPH Asia 2021)

Barbershop: GAN-based Image Compositing using Segmentation Masks Barbershop: GAN-based Image Compositing using Segmentation Masks Peihao Zhu, Rameen A

Peihao Zhu 928 Dec 30, 2022
U-Time: A Fully Convolutional Network for Time Series Segmentation

U-Time & U-Sleep Official implementation of The U-Time [1] model for general-purpose time-series segmentation. The U-Sleep [2] model for resilient hig

Mathias Perslev 176 Dec 19, 2022
Official implementation of "Variable-Rate Deep Image Compression through Spatially-Adaptive Feature Transform", ICCV 2021

Variable-Rate Deep Image Compression through Spatially-Adaptive Feature Transform This repository is the implementation of "Variable-Rate Deep Image C

Myungseo Song 47 Dec 13, 2022
I-BERT: Integer-only BERT Quantization

I-BERT: Integer-only BERT Quantization HuggingFace Implementation I-BERT is also available in the master branch of HuggingFace! Visit the following li

Sehoon Kim 139 Dec 27, 2022
Object Tracking and Detection Using OpenCV

Object tracking is one such application of computer vision where an object is detected in a video, otherwise interpreted as a set of frames, and the object’s trajectory is estimated. For instance, yo

Happy N. Monday 4 Aug 21, 2022
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context Code in both PyTorch and TensorFlow

Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context This repository contains the code in both PyTorch and TensorFlow for our paper

Zhilin Yang 3.3k Jan 06, 2023
Code, pre-trained models and saliency results for the paper "Boosting RGB-D Saliency Detection by Leveraging Unlabeled RGB Images".

Boosting RGB-D Saliency Detection by Leveraging Unlabeled RGB This repository is the official implementation of the paper. Our results comming soon in

Xiaoqiang Wang 8 May 22, 2022