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

Fallback chain for language selection of website (P856) #331

Open
Ainali opened this issue Nov 30, 2023 · 5 comments
Open

Fallback chain for language selection of website (P856) #331

Ainali opened this issue Nov 30, 2023 · 5 comments
Labels
enhancement 🥇 New feature or request

Comments

@Ainali
Copy link
Member

Ainali commented Nov 30, 2023

The feature

Right now, we just take the first language available, but we could choose which language a bit smarter. We need to discuss which order it should be, though. Until we have a fully multilingual website, I suggest the following selection chain.

  1. The language of the user's browser
  2. English
  3. Official language of the place the page is about
  4. The first entry delivered by Wikidata

However, for 1. we need to do it dynamically, so perhaps we should just start with 2-4.

Why?

So that we serve the users more relevant links.

Examples and inspiration

On German Wikivoyage, they have Module:GetP856 to select language. They have this selection chain:

  1. The language of the wiki
  2. English
  3. Official language of the place the article is about
  4. The first entry delivered by Wikidata

So obviously, they have some logic to be inspired by.

@Ainali Ainali added the enhancement 🥇 New feature or request label Nov 30, 2023
@Abbe98
Copy link
Member

Abbe98 commented Nov 30, 2023

For most part we do try to first pick English then a local language (example).

The query that might need some tuning would be organization-optional.rq as it does not take the local language into account. We should fix that by making the language a query parameter:

https://github.com/govdirectory/website/blob/main/queries/organization-optional.rq#L54

@Ainali
Copy link
Member Author

Ainali commented Nov 30, 2023

For most part we do try to first pick English then a local language (example).

For labels, yes. As the title suggests, I was thinking specifically for the website.

@Ainali
Copy link
Member Author

Ainali commented Nov 30, 2023

Could we set a language in the VALUES in countries.rq to use later? Like this?

VALUES (?uri ?name ?safeName ?description ?lang) {
    (wd:Q34 'Sweden' 'sweden' 'All Swedish government agencies are included.' 'sv')

Sure, it will only be one language per country (and for some countries this might be important), but it is perhaps an improvement anyway.

@Abbe98
Copy link
Member

Abbe98 commented Dec 1, 2023

I'm thinking we make it a comma separated list fi,se,....

@Ainali
Copy link
Member Author

Ainali commented Dec 1, 2023

Oh, yes. At least that is putting them in the conversation. I guess in some countries, the order might be debatable and contentious, but that is one step closer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🥇 New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants