Skip to content
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

Adding translated place names using wikidata #174

Closed
wants to merge 1 commit into from

Conversation

whubsch
Copy link
Contributor

@whubsch whubsch commented Jul 15, 2023

I've written a little code to add an alternative, object sub-title for OSM objects that have a linked wikidata or brand:wikidata tag, which has an associated label in the user's language. This should also address #105 about translating place names. I am also toying with the idea of pulling into the description Wikipedia info for objects with a Wikipedia entry in the user's language, which is why I put some of the helper functions in the helper.tsx file, but that would be a separate PR somewhere down the line. Feel free to edit or clean up!

@vercel
Copy link

vercel bot commented Jul 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
osmapp ✅ Ready (Inspect) Visit Preview Jul 15, 2023 2:13am

@whubsch
Copy link
Contributor Author

whubsch commented Aug 14, 2023

@zbycz any thoughts or opinions?

@zbycz
Copy link
Owner

zbycz commented Aug 15, 2023

Hi @whubsch,

thanks for the contribution, it is a good idea. I agree that showing a local name is useful. Few remarks:

  1. data - I feel we need to have a strong preference for osm data first, and only fetch the wikidata api, when the user's language is not found.

    • first issue - Eg. if name:en does not exist, lets fetch wikidata. See also https://wiki.openstreetmap.org/wiki/Names#Language-specific_names - visible here
    • another issue here is harder to solve - this node has only name=xy, so we cant say what is its language. Do you see some way around it? I'd argue, that this kinda breaks the app, it adds unhelpful info. I would rather release a limited version of this PR, than one which also is wrong sometimes. My only idea would be to fetch wikidata only when there is a some name:* but not the user's one. I don't know how to solve the name=* only case.
  2. fetching - i load all the data for the initial view of the Feature panel in isomorphic way. That means it can be fetched during the page load (server side rendering) and final html markup sent to the browser so it appears instantly. I feel some difference Eg. with this PR Public transport labels #175 which is optional addon at the bottom of the panel. On the other hand, name is a key part of the feature, which should be consistent and should not jump the rest of UI.. 🤔

  3. loader - in current setup some loading skeleton is missing, and the UI can jump when the wikidata call resolves. But it would not be a problem with isomorphic fetching.

  4. design - i would prefer something subtler, similar to Google Maps. Also we could probably indicate if the name comes from wikidata. (small icon + tooltip), perhaps <Typography variant="body2"> or even caption

Original screenshot for reference:
image

@Dlurak
Copy link
Collaborator

Dlurak commented Oct 14, 2024

Isn't this irrelevant because of #608 which solves more or less the same problem but only using osm data?

@zbycz
Copy link
Owner

zbycz commented Oct 17, 2024

Yes, current solution merged in #608 is better for OsmAPP. After all, it should be osm-first app 😃

@zbycz zbycz closed this Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants