-
Notifications
You must be signed in to change notification settings - Fork 46
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
Allow selectors to be lists #4
Comments
I've removed this issue from the 0.3 milestone. I'd like to release 0.3 shortly after 0.2 and I don't want to block it with this issue. It's something that we all agree is desirable but it's also pretty big in scope. As the proposal is backwards-compatible, we can add it in a future milestone—when we're ready. |
I agree that having full sentences is better, but that will only be workable if you need only a few of the rules - it's a lot of typing otherwise. So, as an option, great, but it should not be made mandatory. e.g. for gd we would get 4x4 = 16 entries for such a string. |
The last time I talked to @zbraniecki about this, we considered the following syntax for list-typed variant keys: key = { $items, $buckets ->
[one][one] Found 1 item in 1 bucket.
[one][other] Found 1 item in { $buckets } buckets.
[other][one] Found { $items} items in 1 bucket.
*[other][other] Found { $items} items in { $buckets } buckets.
} It would be similar, but not equivalent, to the exploded version: key = { $items ->
[one] { $buckets ->
[one] Found 1 item in 1 bucket.
*[other] Found 1 item in { $buckets } buckets.
}
*[other] { $buckets ->
[one] Found { $items} items in 1 bucket.
*[other] Found { $items} items in { $buckets } buckets.
}
} The key difference between the two is that in the first one, A variant expression of the form key = { $items ->
[one][one] Found 1 item in 1 bucket.
[one] { $buckets ->
[one] Found 1 item in 1 bucket.
}
…
} |
The syntax idea which I mentioned in #4 (comment) has drawbacks related to the whitespace relaxation (#87): key = { $items, $buckets ->
[one][one] Found 1 item in 1 bucket.
[one][other] Found 1 item in { $buckets } buckets.
[other][one] Found { $items} items in 1 bucket.
*[other][other] Found { $items} items in { $buckets } buckets.
} To stay consistent with the rest of the grammar, This leads me to strongly prefer the following syntax, which was made possible by #127: key = { $items, $buckets ->
[one, one] Found 1 item in 1 bucket.
[one, other] Found 1 item in { $buckets } buckets.
[other, one] Found { $items} items in 1 bucket.
[other, other] Found { $items} items in { $buckets } buckets.
} This, in turn, offers a use-case for #90, in which I proposed allowing key = { $errorCode, $count ->
["0xDEADBEEF", one] One fatal error has occurred.
…
} If there are still reasons to consider the |
I'm going to keep this issue untriaged for one more week to make sure I don't forget about this. |
Goal
Allow for alternative syntax for nested variants.
Description
Nested variants are currently hard to write and result in some repetition. ICU's experience with MessageFormat also suggests that it is easier for localizers to work with full sentences as variants.
The proposed solution is to allow lists as selectors in
select-expression
and as variant keys:Dependencies
#2, #3.
Discussion
https://groups.google.com/forum/#!topic/mozilla.tools.l10n/YBNCSp7J0zU
The text was updated successfully, but these errors were encountered: