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