RDFLib / prez

Prez is a data-configurable Linked Data API framework that delivers profiles of Knowledge Graph data according to the Content Negotiation by Profile standard.
BSD 3-Clause "New" or "Revised" License
18 stars 7 forks source link

Standardise handling language tags #152

Open jamiefeiss opened 10 months ago

jamiefeiss commented 10 months ago

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:

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 https://github.com/RDFLib/prez-ui/pull/105