Page MenuHomePhabricator

Grammatical display of units
Open, MediumPublic

Description

Right now, quantities with units are displayed by attaching unit name to the number. While it gives the idea of what is going on, it is somewhat ungrammatical in English (83 kilogramm, 185 centimetre, etc.) and in other languages - i.e. in Russian it's 83 килограмм, 185 сантиметр - instead of the correct "83 килограмма", "185 сантиметров". For some units, the norms are kind of tricky and fluid, and they are not even identical across all units in the same language, but the common theme is that there are grammatical rules on how to do it and we're ignoring them right now.

I think we do have some means to grammatically display numbers with units - for example, number of references is displayed correctly in English and Russian. As I understand, it is done by using certain formats in message strings, and these formats are supported in the code in Language classes. So, I wonder if we should maybe have an (optional) property that defines the same format for units? We could then reuse the same code to display units in proper grammatical way.

Note that this task is not the same as just displaying units in local language - while we can display units now in any language, we display them in an un-grammatical way, ignoring local rules for how one writes numbers with units.

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.
StatusSubtypeAssignedTask
OpenNone
OpenNone

Event Timeline

Smalyshev lowered the priority of this task from High to Medium.Jul 29 2016, 3:08 AM
Smalyshev created this task.

Please also note T77983 which suggest to use unit symbols instead of full unit labels. That potentially saves us the hassle of having to implement/ support plural rules.

@hoo True, if we assume all units will have short labels. Though, given as we use anything as unit (e.g.: https://www.wikidata.org/wiki/Q15720641#P2048 ) I'm not sure that will even help us.

I don't understand how this report differs from T86528; if it's meant to be about a specific proposed solution, see my proposal there.