Page MenuHomePhabricator

Localized precision in geocoordinate inputs
Closed, ResolvedPublic

Description

(see screenshot in parent task)

BDD
GIVEN an input field for geocoordinates
WHEN entering a value
THEN the precision is shown in the UI language

the currently shown label for the coordinate precision is hardcoded here: https://gerrit.wikimedia.org/g/data-values/value-view/+/d1456b6f967248cfdc2c93b7d7f317f2823bbf27/src/experts/GlobeCoordinateInput.js#37
interestingly WikibaseMediaInfo seems to be doing a good job there already https://gerrit.wikimedia.org/g/mediawiki/extensions/WikibaseMediaInfo/+/705a2a550d48f5e25c1e259292705313604cafaa/resources/statements/inputs/GlobeCoordinateInputWidget.js#462

Event Timeline

Change 645335 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[data-values/value-view@master] Change GlobeCoordinateInput helper functions to methods

https://gerrit.wikimedia.org/r/645335

Change 645336 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[data-values/value-view@master] Translate globe coordinate precision

https://gerrit.wikimedia.org/r/645336

Change 645337 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] Add and use value-view precision messages

https://gerrit.wikimedia.org/r/645337

@Lydia_Pintscher the hard-coded precisions have one value that doesn’t look like the others:

  • to an arcminute
  • to an arcsecond
  • to 1/10 of an arcsecond
  • to 1/100 of an arcsecond
  • to 1/1000 of an arcsecond
  • 1/10000'

Should we make that last one translatable as well? Apparently it was added (in DataValues #99) because it can be auto-detected by the backend, but it’s not usually offered as a choice in the dropdown list. (The pull request description doesn’t say what input would make the backend detect that precision, and I haven’t found one yet, which makes this a bit more difficult to reason about.)

Change 645335 merged by jenkins-bot:
[data-values/value-view@master] Change GlobeCoordinateInput helper functions to methods

https://gerrit.wikimedia.org/r/645335

Change 645336 merged by jenkins-bot:
[data-values/value-view@master] Translate globe coordinate precision

https://gerrit.wikimedia.org/r/645336

Change 645337 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Add and use value-view precision messages

https://gerrit.wikimedia.org/r/645337

@Lydia_Pintscher the hard-coded precisions have one value that doesn’t look like the others:

  • to an arcminute
  • to an arcsecond
  • to 1/10 of an arcsecond
  • to 1/100 of an arcsecond
  • to 1/1000 of an arcsecond
  • 1/10000'

Should we make that last one translatable as well? Apparently it was added (in DataValues #99) because it can be auto-detected by the backend, but it’s not usually offered as a choice in the dropdown list. (The pull request description doesn’t say what input would make the backend detect that precision, and I haven’t found one yet, which makes this a bit more difficult to reason about.)

@thiemowmde can you help shed some light on the above?

  • 1/10000'

Should we make that […] translatable as well?

Yes, I suggest to make it translatable. One might want to localize this as "1/10000 of a second", or something like "1/10.000 Sekunde" in German.

It appears like the Geo library was heavily changed in 2019. I can't tell how much the precision detection changed as well when this happened. I found a bit of code that limits seconds to at most 4 decimal places, i.e. 0.0001 or 1/10,000.

This is deployed on Wikidata now, but the version that’s deployed has no translations yet, so it effectively makes no difference. There are some translations on translatewiki.net and in the source code repository by now, but we need to update the Git submodule in Wikibase to pull them in. Since there won’t be a deployment train for the next few weeks (and we unfortunately missed this week’s train), I think we can do that submodule update a bit later (first days of January), to leave some more time for translations to come in.

Change 655432 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/Wikibase@master] Update data-values/value-view submodule

https://gerrit.wikimedia.org/r/655432

Change 655432 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Update data-values/value-view submodule

https://gerrit.wikimedia.org/r/655432

@Lydia_Pintscher the hard-coded precisions have one value that doesn’t look like the others:

  • (snip)
  • 1/10000'

Should we make that last one translatable as well? Apparently it was added (in DataValues #99) because it can be auto-detected by the backend, but it’s not usually offered as a choice in the dropdown list. (The pull request description doesn’t say what input would make the backend detect that precision, and I haven’t found one yet, which makes this a bit more difficult to reason about.)

After @Amire80 asked me about it, I figured out how to reproduce it.

  1. Go to the sandbox item (potentially in one of the languages where that message has a custom translation, such as Portuguese)
  2. Add a P625 statement or edit an existing one
  3. Make sure that the “set manually” (precision) checkbox is unchecked
  4. Set the value to e.g. 35°16'39.7928"S, 149°6'55.7267"E
  5. The precision will now say something like “special (1/10000')” (English) or “especial (1/10000 de segundo de arco)” (Portuguese)

Notice that the message shows up in a different way than the other ones, even when it shows up at all. (And AFAICT the old comment is correct in claiming that it will never show up as a choice when it’s not autodetected.)

Also, the Portuguese translation doesn’t fully fit into the select:

image.png (550×768 px, 202 KB)

Given all this, I’m personally still undecided whether the message should be changed to include “to … of an arcsecond” (which I’m not sure we decided for or against four years ago).

A precision of 1 arcsecond corresponds to approximately 31 meters near the equator, or less when not near the equator. 1/1000 of an arcsecond is 3 centimeters, which is a precision actually used by land surveyors. 1/10000' is equivalent to 3 millimeters, which is absurd for any real-world use case, considering factors like continents moving multiple centimeters per year. That's why the decision was made to not offer it in the drop down.

It might indeed make more sense to keep the message "special" and intentionally a little ugly.