-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Require the message body to be indented
Fix #12, #17, #18. With this change, the entire body of a message must be indented. This makes error recovery very easy: finding the next message definition is as simple as finding the next identifier with no indentation. It also opens up a number of opportunities: we can remove the `|` syntax for multiline blocks of text and allow line breaks inside of placeables safely. The change also allows the value to be defined on a new line, making the following examples equivalent: lipsum = Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi pellentesque congue metus, non mattis sem faucibus sit amet. lipsum = Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi pellentesque congue metus, non mattis sem faucibus sit amet. Lastly, quoted patterns are only available inside of placeables, cannot contain aother placeables and cannot be used directly as values. The exact semantics of \ escapes will be defined in #22.
- Loading branch information
Showing
8 changed files
with
76 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,16 @@ | ||
# Working With Text: Multiline and Quotes | ||
# Working With Text | ||
|
||
``` | ||
about = About Our Software | ||
description = | ||
| Loki is a simple micro-blogging | ||
| app written entirely in <i>HTML5</i>. | ||
| It uses FTL to implement localization. | ||
more-info = " Read more about us! " | ||
Loki is a simple micro-blogging | ||
app written entirely in <i>HTML5</i>. | ||
It uses FTL to implement localization. | ||
``` | ||
|
||
The value of an FTL message is usually a simple string. | ||
The value of an FTL message is usually a simple string. It begins after the | ||
`=` and may continue over multiple lines as long as it is indented by at least | ||
one space. | ||
|
||
By default, a string begins after a `=` and ends with the end of line. You can | ||
also define easy-to-read, multiline strings with a pipe mark-up, as can be seen | ||
in the `description` message. | ||
|
||
FTL ignores leading whitespaces in front of the value allowing localizers to | ||
align their messages for readability. For multiline strings, whitespaces both | ||
before and after the pipe are ignored. In rare cases where leading whitespaces | ||
should be part of the value, FTL allows for special quote delimited strings as | ||
can be seen in the `more-info` message. | ||
Leading and trailing white-space is ignored. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters