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

Standardise handling language tags #152

Open
jamiefeiss opened this issue Sep 8, 2023 · 0 comments
Open

Standardise handling language tags #152

jamiefeiss opened this issue Sep 8, 2023 · 0 comments

Comments

@jamiefeiss
Copy link
Collaborator

jamiefeiss commented Sep 8, 2023

Each endpoint in the API handles language tags for labels differently. We should keep this behaviour consistent for all endpoints.

Here's the current behaviour:

  • /v/<vocab_curie>/all - Return either @en or labels with no language tags, ignore all other languages
  • /v/<vocab_curie>/top-concepts - this one is strange. The same concept that has multiple languages shows up as multiple items: first returns alphabetically the first label regardless of language and @en, then @en, then first label in the order (or alphabetically first language tag) and @en.
  • /v/<vocab_curie>/<concept_curie> - Return all labels
  • /c/catalogs/<catalog_curie> - Return either @en or labels with no language tags, ignore all other languages

I'll continue to add to this list over time.

Ideally the backend should return all languages, and the frontend can get the browser preferred language and display the appropriate language in the following priority order:

  1. Preferred language
  2. @en
  3. @en-* (e.g. @en-us, @en-gb, etc.)
  4. no language tag
  5. Other language tags

This frontend functionality (except for using the browser language) was added in RDFLib/prez-ui#105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant