Skip to content

SPARQL: Item label does not seem to follow configured language, "en" hard-coded #5855

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nicolas-raoul opened this issue Oct 15, 2024 · 6 comments · Fixed by #5858
Closed
Assignees

Comments

@nicolas-raoul
Copy link
Member

https://github.com/commons-app/apps-android-commons/blob/main/app/src/main/resources/queries/query_for_item.rq#L21

Problem: "en" is hard-coded for item label

Replacing with "${LANG}" might be enough to fix the issue.

@ChristoJobyAntony
Copy link
Contributor

Could I have a go at this ?

@nicolas-raoul
Copy link
Member Author

After replacing, please test with various languages and post screenshots showing Nearby with a famous Wikidata item selected, for instance https://www.wikidata.org/wiki/Q243

Thanks!

@ChristoJobyAntony
Copy link
Contributor

I have been able to implement the required changes. But I would like to clarify the expected behaviour for testing. My understanding of the test is to select a famous Wikidata item in the nearby page and ensure that the tags with the native language is given preference. Is this correct ?

@ChristoJobyAntony
Copy link
Contributor

ChristoJobyAntony commented Oct 15, 2024

Since the explore page doesn't have a search button, I found a nearby item that had a tag in French and English. I had swapped the languages to check if the label that closely matches the user language is retrieved.

Item Wikidata

English

French:

@ChristoJobyAntony
Copy link
Contributor

Couple more tests were done with the Bust of Gustave Eiffel link, The langages tested were, French, Armenian, Arabic & Turkish. Before each screenshot was taken, language preference was updated and then the item was located in Nearby.

P.S: I tried real hard to locate and retrieve info about Eiffel Tower however, despite mocking the exact co-ordinates of its location, I was unable to locate / retrieve its details.

@nicolas-raoul
Copy link
Member Author

Looks great!
Would you mind sending a pull request?

ChristoJobyAntony added a commit to ChristoJobyAntony/apps-android-commons that referenced this issue Oct 16, 2024
nicolas-raoul added a commit that referenced this issue Oct 19, 2024
…ation of Wiki Item (#5864)

* (fixes #5855) fetch item label in nearby based on user configured language.

* implement a method to delete Place entity from database

* clear the cache for a item when a wikiItem is updated.

* fix style issue

* Update placesRepository on successful WikiItemEdit

* Revert the delete operations added to the PlaceDAO

* Set name of the place to avoid race condition with NearbyParentFragment. Update Success Notification to show only after the pin has been updated.

* Clean-up

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants