-
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
Require = after the identifier #63
Comments
I'm not a big fan of this. Also the value would be different in
|
|
I think of the role of
but I believe that it's forward compatible to require it now and drop this requirement later, so if stas is committed to this change, I'm not going to block. I'd just like to see an issue filed for syntactic sugar of dropping it later ;) |
I don't have a strong opinion on this, I could see it making a lot of sense either way, but aesthetically I somewhat prefer without the
|
@stasm gathering more feedback on 0.5 changes this one stands out as something users don't see a value in. Is there a chance we could consider the syntax sugar to become available in 0.5 alongside this change? |
I'll think about it. I'd prefer to start with a single approach but I'd like to consider the wider context. I'll update this issue in a few days. |
I filed #71 to discuss the syntax sugar. I found a few more reasons in favor of requiring
|
In #71 (comment), @flodolo wrote: foo-bar =
.attr = Attribute Value
foo-bar = .attr = Attribute Value
Wouldn't the same be true for the simple case of: foo = Foo Value
.attr = Foo Attribute Does this read like the value of |
In #71 (comment), @zbraniecki wrote:
I acknowledge that "you believe" these things, but I don't know how to address them without understanding the reasons. Are they purely subjective? What do you think about the second point from my comment #63 (comment) about mistaking the end of the identifier for the end of the translation?
You can do the following which is consistent with how we treat leading whitespace: # The value is " Foo".
foo = {" "}Foo
# The value is an empty string.
bar = {""}
.attr = Bar Attribute |
No, because there's a clear visual separation between the value, and the attribute declaration (and yes, I'm weirdly aware that contradicts the "stripping whitespaces" comment). For example, in this case I'd consider foo = Foo Value
.attr = Foo Attribute |
I'd like to put this on the talking points for tomorrow's tech call. Note, I've removed my tick because I'm not sure what it should mean, and if my tick meant that. At this point I also don't see a tick by gandalf, but one of my tabs says it had one. Can't find the history of the tick marks for the love of it. |
Can we reschedule this? I'll be traveling and won't be joining the calls tomorrow.
I'd like the tick to say: I'm OK with this becoming part of Fluent.
Yes, I remember that at one point this issue had 3 ticks :) That's why when I proposed the signoff process in #62 (comment) I also suggested that we explicitly comment with an |
It's quite scary and amusing how closely we follow Walder's Law Can't wait to get to #16 :) |
At risk of pointing out the obvious: we have 4 FTL strings in Firefox 59, two of them fall into this bucket, a lot more in the other patch for Preferences chrome. What happens to 59 if we introduce |
For the existing strings, I've researched the compatibility of MessageContext shipped in Firefox 59 in bug 1426463. The conclusion is:
I'd like for us to update the Preferences patch (bug 1424682) to the new syntax before we land it. |
Thanks, I missed that was covered as well (I assumed it was only comments) |
Good point! Updated. |
That conclusion only works for the comment sigils, but not for the required equals sign in browser/preferences/main.ftl. |
Let's move this to bug 1426463 and keep this issue about the proper change in the Syntax, please. |
I made the call to go ahead with this proposal. The There were valid arguments for and against the proposal. In the end I was convinced by how the required When someone not acquainted with the syntax looks at an FTL file for the first time, they look for patterns which will help them discover the rules governing the syntax. The more coherent the syntax is, the easier it is to discover these rules. The For the same reason of discoverability, going forward I will be likely against introducing any syntax sugar into the Fluent Syntax. Syntax sugar can save a few key strokes but for someone not familiar with the syntax it creates cognitive burden—it looks like something new which needs to be understood and learned independently. It's the simple vs. easy dilemma. Syntax sugar is easy to use once you know the underlying concepts, but it makes the syntax less simple by introducing complexity and choice. Explicit syntax without shortcuts improves the discoverability. In fact, as @jakobkappel suggested in https://gist.github.com/flodolo/164ae39703d5479d799954e4b0da8f76, the most readable and discoverable syntax would explicitly define the null value. Something like: message-key = { NONE }
.attr = Attribute Value Or without the need for a reserved keyword like message-key = {}
.attr = Attribute Value These suggestions are well in line with my intent to improve the discoverability of the syntax. If the user feedback about Syntax 0.5 and the required |
Right now the equals sing following the identifier
=
is part of thevalue
production in the EBNF. Message without values are thus written like this:foo-bar .attr = Attribute
I would like to change this to always require the
=
after the identifier. This would clearly demarcate the identifier and the indented body of the message, similar to Python's:
.In the rare cases when the message should have an empty string for its value, the same explicit syntax as in #32 can be used:
Signoffs
The text was updated successfully, but these errors were encountered: