-
Notifications
You must be signed in to change notification settings - Fork 45
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
Can Terms reference variables passed to the parent Message? #272
Comments
I asked a related issue about this earlier in the fluent.js repo, as I wasn't certain to start with if it was a spec or implementation issue: projectfluent/fluent.js#372. My preference would be for variable's default values to be fetched from the parent message scope, rather than just assumed empty. That would probably be the least surprising thing to happen, from the point of view of a translator who's adding their first parameterised term. |
Falling back to the calling message's scope might lead to unexpected naming conflicts when a term with a |
Is that sufficient reason to settle the answer to this issue's question as "no" then? |
I think terms should be isolated from the message. That's giving more power to localizers, in particular in scenarios where we want to have language-specific terms. Examples here would be terms that depend on the platform just for a single language, like in Japanese. I also think that most of the time, needing external variables in a term is probably a sign that you don't want a term, but translation memory. We're WET, after all ;-) |
I think so, yes! I'm leaving this open until I have a few tests in the reference implementation which verify the intended behavior. |
Certainly I favor the explicit variable. Passing variables from the message to the term seems to be a recurrent topic, and IMO should be resolved. I understand that for selection, pluralization, and such passing the corresponding value as literal is sufficient for the terms to be useful, but for things as the example described here, or for any number/datetime formatting, passing the variable from the message to the term in an explicit way (including renaming of it) is certainly useful. |
Or should we require that each variable be passed explicitly as a parameter? Related to #230.
The text was updated successfully, but these errors were encountered: