Multiline patterns first-line behavior question


(Zibi Braniecki) #1

Hi all,

We’re finalizing 0.7 syntax, and are still pondering over one small aspect of a multiline string normalization.

I created a gist which visualizes the syntactic difference we’re trying to decide on and has 3 questions.

Please, take a look at the gist and answer them to help us finalize the decision!

Gist: https://gist.github.com/zbraniecki/5848e7142cf9090edce5d48f80ad9b1f


(Axel) #2

I would be surprised. In particular if we’re comparing this to what we allow for, say, select expressions (see https://github.com/projectfluent/fluent/blob/a1ed83fea77c9da7456545cac70dd45e76813379/test/fixtures/select_indent.ftl#L72-L95 for the glory details).

In 0.6 and earlier,

foo = zero
     three
   two
 one

is a perfectly fine text.

My expectation is for Fluent to try as hard as it can to make sense of that gibberish.


(Heidi Kasemir) #3
  1. I think I would be surprised if I could not use variant 2. Especially if I were in an ftl file and was updating it manually, I would expect that I could start with the key, the equals, and then start typing out my message without adding a new line.
  2. similar response to 1 ^^
  3. I would probably be more likely to choose the first, simply because I don’t develop on sites that would make use of a variably indented multiline message. If I were to guess, I would say this detail would not affect the large majority of projects. I can definitely see, however, that for the few that do want this level of precision, that variant 1 would likely provide the most control / clarity of the indentation pattern.