message-format-wg icon indicating copy to clipboard operation
message-format-wg copied to clipboard

How do we handle and represent selection for a multi-select message?

Open echeran opened this issue 4 years ago • 1 comments

For a multi-select message, there is the step of selecting a single pattern from the available patterns, followed by the formatting of that selected pattern. This concerns the first step, which is how do we select, and how do we represent that in a data model?

The topic of how to perform selection came up specifically in https://github.com/zbraniecki/message-format-2.0-rs/issues/9, with the specific case of the uneven branches problem. It offers alternatives for structuring the data model in ways that can represent a hierarchy/ordering of preference for selection among the patterns.

A different perspective to the problem is to represent selection as a function / interface / trait as suggested in https://github.com/unicode-org/message-format-wg/issues/99. This requires us to consider defining functions/interfaces either alongside or within a data model, but it potentially decouples selection logic from affecting the shape of input data.

Details of how the algorithmic logic for selection might be defined is described in https://github.com/unicode-org/message-format-wg/issues/101. This covers cases where one selector arg is needed and many selector args are needed in the multi-select message.

echeran avatar Aug 08 '20 03:08 echeran

Also relevant is whether we may need to utilize values only known at runtime for selection https://github.com/unicode-org/message-format-wg/issues/98.

echeran avatar Aug 08 '20 04:08 echeran