apps-android-commons icon indicating copy to clipboard operation
apps-android-commons copied to clipboard

Wrong description language for Nearby upload

Open nicolas-raoul opened this issue 7 years ago • 7 comments

Steps to reproduce:

  1. Change the sandbox item's geolocation to somewhere near you (or use FakeGPS or scroll to its current location and press "Search in this area") and change its "instance of" to "embassy", remove its "image" if it has one.
  2. Change your Android language to Hebrew (might work with other non-English languages)
  3. Open the app, tap "Nearby"
  4. Find the sandbox item
  5. Tap the + and upload a picture for it.
  6. The proposed description is in Upper Sorbian instead of Hebrew.

There are two problems with this:

  • If "embassy" had no label for Hebrew and the app had to fallback to Upper Sorbian, then the description's language selection dropdown UI should have "hsb" selected instead of "iw"
  • Actually "embassy" (https://www.wikidata.org/wiki/Q3917681) HAS a label for Hebrew. Not sure why it was not used. Upper Sorbian is the latest language a label has been added for, that might be why (https://www.wikidata.org/w/index.php?title=Q3917681&action=history). In any case it is a bug.

Screenshot_20190313-123015

nicolas-raoul avatar Mar 19 '19 08:03 nicolas-raoul

Another example: description should not be set to en, it should be set to ja because the description is in Japanese. Screenshot_20190321-114650

nicolas-raoul avatar Mar 21 '19 06:03 nicolas-raoul

I think the cause of the problem is that the SPARQL request coalesces languages, and we have no way to know what language was used:

 SAMPLE(COALESCE(?itemLabelPreferredLanguage, ?itemLabelAnyLanguage)) as ?label

As you can see, the label in language itemLabelPreferredLanguage is used if it exists, but if it does not exist, a label in any other language is used (randomly and we don't know which one).

Solution

When the user proceed with uploading a picture for that nearby item, we should run another request on that particular item only, that gets us all language-label pairs, and either take only the one we had displayed to the user, or even add all of them.

nicolas-raoul avatar Jun 17 '19 04:06 nicolas-raoul

hello @nicolas-raoul and @Kota-Jagadeesh , if there's still room for this, I can take it up

joeMba avatar Oct 16 '26 11:10 joeMba

@joeMba You already have two assigned issues with no pull request. Better do one by one. Thanks :-)

nicolas-raoul avatar Oct 16 '26 14:10 nicolas-raoul

8. @joeMba You already have two assigned issues with no pull request. Better do one by one. Thanks :-)

Noted with thanks @nicolas-raoul . I left a comment on this issue though that was requesting for guidance on.

joeMba avatar Oct 16 '26 14:10 joeMba

Hi @nicolas-raoul, I looked into this and I'd like to work on it.

The COALESCE query from 2019 isn't used anymore. Wikidata now tells the app which language the label came from, so the original case should be gone. But two cases are still wrong:

  1. On the "Is this a picture of X?" prompt, the description is filled as "label (description)" but tagged with the label's language only. So if the label is in Hebrew and the description only exists in English, you get שדה פרפרים (sculpture by Dudu Gerstein) tagged as he (Q56696204, in Tel Aviv).
  2. If an item has no label in any of our fallback languages, the app pre-selects bug (Buginese) and puts the Q-id as the caption. This even overrides the default language set in settings.

Both come from Place.from in Place.java, so I'd fix it there:

  • if the label and description are in different languages, use only the label (like you suggested above, and the Nearby tab already shows only the label)
  • if the label has no language, fall back to the user's default language
  • add unit tests for both

Could you assign it to me?

Medhansh-741 avatar Nov 12 '26 19:11 Medhansh-741

Assigned to you, @Medhansh-741! Thanks!

nicolas-raoul avatar Nov 12 '26 19:11 nicolas-raoul