@@ -154,30 +154,30 @@ A message with a single selector:
154
154
155
155
{$count: number}
156
156
1 [You have one notification.]
157
- _ [You have {$count} notifications.]
157
+ * [You have {$count} notifications.]
158
158
159
159
A message with a single selector which is an invocation of
160
160
a custom function ` platform ` , formatted on a single line:
161
161
162
- {:platform} windows [Settings] _ [Preferences]
162
+ {:platform} windows [Settings] * [Preferences]
163
163
164
164
A message with a single selector and a custom ` hasCase ` function
165
165
which allows the message to query for presence of grammatical cases required for each variant:
166
166
167
167
{$userName: hasCase}
168
168
vocative [Hello, {$userName: person case=vocative}!]
169
169
accusative [Please welcome {$userName: person case=accusative}!]
170
- _ [Hello!]
170
+ * [Hello!]
171
171
172
172
A message with 2 selectors:
173
173
174
174
{$photoCount: number} {$userGender: equals}
175
175
1 masculine [{$userName} added a new photo to his album.]
176
176
1 feminine [{$userName} added a new photo to her album.]
177
- 1 _ [{$userName} added a new photo to their album.]
178
- _ masculine [{$userName} added {$photoCount} photos to his album.]
179
- _ feminine [{$userName} added {$photoCount} photos to her album.]
180
- _ _ [{$userName} added {$photoCount} photos to their album.]
177
+ 1 * [{$userName} added a new photo to their album.]
178
+ * masculine [{$userName} added {$photoCount} photos to his album.]
179
+ * feminine [{$userName} added {$photoCount} photos to her album.]
180
+ * * [{$userName} added {$photoCount} photos to their album.]
181
181
182
182
### Local Variables
183
183
@@ -192,7 +192,7 @@ A message defining two local variables:
192
192
$countInt = {$count: number maximumFractionDigits=0}
193
193
$itemAcc = {$item: noun count=$count case=accusative}
194
194
one [You bought {$color: adjective article=indefinite accord=$itemAcc} {$itemAcc}.]
195
- _ [You bought {$countInt} {$color: adjective accord=$itemAcc} {$itemAcc}.]
195
+ * [You bought {$countInt} {$color: adjective accord=$itemAcc} {$itemAcc}.]
196
196
197
197
### Complex Messages
198
198
@@ -208,17 +208,17 @@ A complex message with 2 selectors and 3 local variable definitions:
208
208
female 0 [{$hostName} does not give a party.]
209
209
female 1 [{$hostName} invites {$guestName} to her party.]
210
210
female 2 [{$hostName} invites {$guestName} and one other person to her party.]
211
- female _ [{$hostName} invites {$guestName} and {$guestsOther} other people to her party.]
211
+ female * [{$hostName} invites {$guestName} and {$guestsOther} other people to her party.]
212
212
213
213
male 0 [{$hostName} does not give a party.]
214
214
male 1 [{$hostName} invites {$guestName} to his party.]
215
215
male 2 [{$hostName} invites {$guestName} and one other person to his party.]
216
- male _ [{$hostName} invites {$guestName} and {$guestsOther} other people to his party.]
216
+ male * [{$hostName} invites {$guestName} and {$guestsOther} other people to his party.]
217
217
218
- _ 0 [{$hostName} does not give a party.]
219
- _ 1 [{$hostName} invites {$guestName} to their party.]
220
- _ 2 [{$hostName} invites {$guestName} and one other person to their party.]
221
- _ _ [{$hostName} invites {$guestName} and {$guestsOther} other people to their party.]
218
+ * 0 [{$hostName} does not give a party.]
219
+ * 1 [{$hostName} invites {$guestName} to their party.]
220
+ * 2 [{$hostName} invites {$guestName} and one other person to their party.]
221
+ * * [{$hostName} invites {$guestName} and {$guestsOther} other people to their party.]
222
222
223
223
## Productions
224
224
@@ -269,23 +269,24 @@ Examples:
269
269
```
270
270
$frac = {$count: number minFractionDigits=2}
271
271
1 [One apple]
272
- _ [{$frac} apples]
272
+ * [{$frac} apples]
273
273
```
274
274
275
275
### Variants
276
276
277
277
A variant is a keyed pattern.
278
278
The keys are used to match against the selectors defined in the preamble.
279
+ The key ` * ` is a "catch-all" key, matching all selector values.
279
280
280
281
``` ebnf
281
282
Variant ::= VariantKey* Pattern
282
- VariantKey ::= String | Nmtoken
283
+ VariantKey ::= String | Nmtoken | '*'
283
284
```
284
285
285
286
A well-formed message is considered valid if the following requirements are satisfied:
286
287
287
288
- The number of keys on each variant must be fewer or equal to the number of selectors defined in the preamble.
288
- - At least one variant's keys must all be equal to the catch-all key (` _ ` ).
289
+ - At least one variant's keys must all be equal to the catch-all key (` * ` ).
289
290
290
291
### Patterns
291
292
0 commit comments