From 13dcd0fc2c3f9b79d12f2249463cb2c0ec994ced Mon Sep 17 00:00:00 2001 From: Eemeli Aro Date: Wed, 6 Sep 2023 17:08:36 +0300 Subject: [PATCH 1/7] Add design document on number selection --- exploration/0006-number-selection.md | 127 +++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 exploration/0006-number-selection.md diff --git a/exploration/0006-number-selection.md b/exploration/0006-number-selection.md new file mode 100644 index 0000000000..3c559f6f6b --- /dev/null +++ b/exploration/0006-number-selection.md @@ -0,0 +1,127 @@ +# Selection on Numerical Values + +Status: **Proposed** + +
+ Metadata +
+
Contributors
+
@eemeli
+
First proposed
+
2023-09-06
+
Pull Request
+
#000
+
+
+ +## Objective + +Define how selection on numbers happens. + +## Background + +As discussed on numerous past occasions and explicitly identified in +#457, +it would be good for both plural and non-plural match selection to be supported in MF2. + +MF1 supported selection on either cardinal plurals or ordinal numbers, +via the `plural` and `selectordinal` selectors. +It also customized this selection beyond the capabilities of `com.ibm.icu.text.PluralRules` +by allowing for an `offset` parameter. + +As pointed out by @mihnita in particular, +category selection is not always appropriate for selection on a number: +the number may be representing some completely other quantity, +such as a four-digit year or the integer value of an enumerator. + +Furthermore, as pointed out by @ryzokuken +in #457 (comment), +ordinal values are not truly "plural", +even if they use categories with similar names and are determined by similar rules. + +## Use-Cases + +Put together, we have thus identified three different types of selection +we would like to support on numeric values: + +- cardinal plural selection +- ordinal selection +- exact match selection + +## Requirements + +- Enable cardinal plural selection. +- Enable ordinal number selection. +- Enable exact match selection. +- Support relevant formatting options, such as `minimumFractionDigits`. +- Encourage developers to use the same options for formatting and selection. + +## Constraints + +ICU MF1 messages using `plural` and `selectordinal` should be representable in MF2. + +## Proposed Design + +Given that we already have a `:number`, +it makes sense to add a `` to it with an option + +```xml +