Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom functions with scope access #364

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

PPakalns
Copy link

@PPakalns PPakalns commented Jun 5, 2024

Tries to temporary solve complex translation cases mentioned in:
#268
projectfluent/fluent#80

  1. Support user implemented custom functions that can access current scope, can work as Message references.
    In future we could allow access in custom functions to additional information about current scope (developer arguments, local arguments, current errors)
    Message references are highly needed for more complex translation cases with a lot of possible message combinations.

  2. Additionally allow using expressions inside named arguments.
    (It looks like by default fluent doesn't allow it Playground )
    This functionality can be placed under boolean flag if we do not want to enable it by default.

See examples included in added tests.

Would like to get feedback if these changes can be upstreamed to fluent-rs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant