forked from projectfluent/fluent
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix projectfluent#62. Private messages are similar to regular messages but they can only be used as references in other messages. Their identifiers start with at least one dash `-`, e.g. `-brand-name`. The runtime cannot retrieve private messages directly. They are best used to define glossary terms which can be used consistently across the localization of the entire product. Private messages can store some grammatical information about themselves in tags. Private messages are not allowed to have attributes.
- Loading branch information
Showing
10 changed files
with
88 additions
and
38 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Private Messages | ||
|
||
``` | ||
-brand-name = Firefox | ||
app-title = { -brand-name } | ||
has-updated = { -brand-name } has been updated. | ||
``` | ||
|
||
Private messages are similar to regular messages but they can only be used as | ||
references in other messages. Their identifiers start with at least one dash | ||
`-` like in the example above: `-brand-name`. The runtime cannot retrieve | ||
private messages directly. They are best used to define terms which can be | ||
used consistently across the localization of the entire product. | ||
|
||
Private messages can store some grammatical information about themselves in | ||
[tags](tags.html) which are the topic of the next chapter. | ||
|
||
Private messages are not allowed to have [attributes](attributes.html). |
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,21 +1,26 @@ | ||
# Message References | ||
|
||
``` | ||
brandName = Loki | ||
installing = Installing { brandName }. | ||
Another use-case for placeables is referencing one message in another one. | ||
|
||
``` | ||
menu-save = Save | ||
help-menu-save = Click "{ menu-save }" to save the file. | ||
``` | ||
|
||
Strings in FTL may use special syntax to incorporate small pieces of | ||
programmable interface. Those pieces are denoted with curly braces `{` and `}` | ||
and are called placeables. | ||
Referencing other messages generally helps to keep certain translations | ||
consistent across the interface and makes maintenance easier. | ||
|
||
One example of a placeable is a reference to another message. | ||
It is also particularly handy for keeping branding separated from the rest of | ||
the translations, so that it can be changed easily when needed, e.g. during | ||
the build process of the application. This use-case is best served by | ||
defining a [private message](private.html) with a leading dash `-`, like | ||
`-brand-name` in the example below. | ||
|
||
Referencing other messages generally helps to keep certain translations | ||
consistent across the interface and makes maintenance easier. It is also | ||
particularly handy for keeping branding separated from the rest of the | ||
translations, so that it can be changed easily when needed, e.g. during the | ||
build process of the application. | ||
``` | ||
-brand-name = Firefox | ||
installing = Installing { -brand-name }. | ||
``` | ||
|
||
The use of the private message indicates to tools and to the localization | ||
runtime that `-brand-name` is not supposed to be used directly in the product | ||
but rather should be referenced in other messages. |
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
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