Example pages:
Technical requirements:
Search suggestions should be based on a particular language? How to select one?
Just to clarify here, is this a technical question (i.e. how to prompt Fandom to return search results based on a particular language) or a design question (i.e. how to choose the language the user wants suggestions in)?
That's a very smart question.
Technically: /fr/api.php gives search suggestions based on French, so problem solved.
Design will be the harder part. I could go based on the language the user is currently browsing in? However, not all pages are available in all languages. This creates some problems, because if you're visiting (for example) an English page and wanting to search for a different French page, you'd first have to switch the current page's language, then use the search feature. However, if the current page isn't in French (maybe it's a niche topic that hasn't been translated yet) then this flow won't work, even when the desired destination page is available in French.
People would also have to wait a couple of seconds for the page to reload in the desired language before they can search.
I would love to figure out some user stories and use cases so that I can polish this design the right way, but since the languages feature has been in demand for almost a year now, it might be better to create an imperfect design if I can do it sooner.
- An API like this can provide the special page prefixes for other languages: https://hollowknight.fandom.com/fr/api.php?action=query&meta=siteinfo&siprop=namespaces|namespacealiases&format=jsonfm
Watch out for special page prefixes in other languages like Catégorie Do we need to? What does Breezewiki do with namespaces that we must remember the localised versions of namespaces?
If the person visits a URL on BreezeWiki that matches
/{}/wiki/Category:{}
it activates BreezeWiki's category page handler.