fluent icon indicating copy to clipboard operation
fluent copied to clipboard

Referencing parameterized terms without parameters

Open stasm opened this issue 6 years ago • 3 comments

Referencing parameterized terms is legal syntax in Fluent 1.0:

-term = {$case ->
    [lower] value
   *[upper] Value
}

## All three messages format to the same value.
hello1 = Hello, {-term}
hello2 = Hello, {-term()}
hello3 = Hello, {-term(case: "upper")}

Without parameters, the default variant is selected. Should the resolver also report an error / warning?

stasm avatar Jun 07 '19 14:06 stasm

This probably depends on the resolution of #272.

eemeli avatar Jun 09 '19 06:06 eemeli

In the case of multi-variant branding, I think it's OK for some variations to have sub-optimal term shapes. Think of an online shop system (or Firefox/Thunderbird).

I'd say that all three ways in the example are OK.

There is the scenario where you have hello4 = Hello, {-term(casa: "upper")}, and you'd like to know. I think the solutions for this lie in tooling/editing support, though, and not the runtime.

There are variations of the "tooling/editing" story that are "build time", remembering the elm impl, for example. But I look at that as a build time static analysis much more than a build time resolver.

Pike avatar Jun 27 '19 13:06 Pike

From what I can tell, this works as described in the description. Can this issue be closed?

image

caridy avatar Nov 24 '21 20:11 caridy