- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 35
 
Open
Labels
FutureDeferred for future standardizationDeferred for future standardizationfunctionsIssue pertains to the default function setIssue pertains to the default function set
Description
Currently, :unit suffers from many of the same problems as, for example, u:locale, explained in #1006.
Since the unit being formatted is provided by the Measure input type (which I think is a good decision), the message formatter cannot know ahead of time which units are being formatted, so it needs to pessimistically link the data for all possible units. Unit display names are among the largest chunks of data, so requiring this behavior is a non-starter for ICU4X.
A few ways to mitigate this:
- Add the quantity to the unit function, such as 
:unit:length, as suggested by @eemeli. This would allow ICU4X to link only a smaller subset of units, which should be generally small enough to be manageable. - Require the quantity or the unit to be specified in the message. For example, 
:unit unit=meterwith a Number input is OK, as is:unit quantity=lengthwith a Measure unit. - Require a unit to be specified in the message, but allow the unit to be overridden by Measure so long as the quantity matches. For example, 
:unit unit=metercan be formatted with a Measure carryingfootbut not a Measure carryinggallon. - Require the context to be specified in the message, and tweak how context works. 
:unit context=lengthwould not do conversion, but conversion would happen with:unit context=length-road. 
Metadata
Metadata
Assignees
Labels
FutureDeferred for future standardizationDeferred for future standardizationfunctionsIssue pertains to the default function setIssue pertains to the default function set