This allows the participating user to select Wikidata items that will be values for the depicts statements added.
Note: The UI elements for this feature still need to be added to the mockups. They will be added here as soon as they are done
- The user should be able to select which language to search in, directly next to the search box and independent of their own language settings (this should be confirmed, for first version we should probably just use the users' default language setting)
- The language selected is used as the main search language in the API call, as well as for the labels & descriptions of results returned.
- The language chosen should remain as the default for the rest of the 'Participate session'.
Note: the search API call described below has some very good fallbacks built in. So any language selected will always have an English fallback, but it will also return matches from any language. E.g. a search for "Εμπάιρ Στέιτ Μπίλντινγκ" returns the Empire States Building even when searching in English.
Use the wbsearchentities module to generate a list of dropdown search results for the user the choose from.
We pass the search term (entered by the user) and the selected language. The selected language should be used for both the language and uselang parameters
e.g. To search for "chat" in French use https://www.wikidata.org/w/api.php?action=wbsearchentities&search=chat&language=fr&uselang=fr