Skip to content

Conversation

@srueegger
Copy link
Contributor

The Flathub website has been redesigned with a new URL structure for search. This updates the dynamic search link to use the new format: https://flathub.org/{locale}/apps/search?q={query}

The system locale is automatically detected and the language code is extracted (e.g., "de" from "de_DE.UTF-8") to provide localized search results. Falls back to "en" if locale cannot be determined.

The Flathub website has been redesigned with a new URL structure
for search. This updates the dynamic search link to use the new
format: https://flathub.org/{locale}/apps/search?q={query}

The system locale is automatically detected and the language code
is extracted (e.g., "de" from "de_DE.UTF-8") to provide localized
search results. Falls back to "en" if locale cannot be determined.
@ryonakano
Copy link
Member

What if we do when the system locale isn't available on Flathub website? 🤔

@srueegger
Copy link
Contributor Author

@ryonakano That's a good question that I hadn't thought of. Currently, you also get an Error 404 if the language is not available on Flathub.

I see two possible solutions:

  1. Here is a list of all available languages: https://flathub.org/en/languages

We can create a config file with the languages and use an if query to check whether the OS language matches one of the languages – if so, everything is fine; if not, simply fall back to English.
The disadvantage of this solution is that we will have to keep updating this config file.

  1. We send a quick request to the URL using curl. If we receive a 404 status code, we use EN as a fallback. The disadvantage of this solution is that we establish a connection to Flathub from the computer without the user being aware of it.

Do you see any other options, and which solution would you prefer?

@tintou
Copy link
Member

tintou commented Nov 26, 2025

We could open a feature request to the flathub website to handle this for us 🤷‍♂️

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