Skip to content

Requirements for a messages function registry with types #3981

@jldec

Description

@jldec

Context

Messages can be defined with variable replacements or match selectors which contain functions.

E.g. message with a plurals function (from MESDK-77 here):

.input {$numProducts}
.match {$numProducts :plural}
zero {{No Products}}
one {{A product}}
other {{{$numProducts} products}}

(this example uses MF2, but inlang v2 Message type semantics are the same)

@loris.sigrist has implementated a registry here as an example to be used by paraglide-js

Requirements for the function registry

  1. list the available built-in functions (see MF2 default registry)
    1. plurals (e.g. as implemented by javascript Intl.PluralRules)
    2. string, number and date formatting functions
  2. inlude types for function parameters

Proposal

[add api proposal here]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions