Introduce distinct language parameters for search and response #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In both
find_item
andfind_property
there is currently only one language parameter. In spite of what the current documentation suggests, this is not "the language to return the labels and descriptions in", but rather the language in which the search is conducted. Indeed, labels and description are currently always returned in English, no matter what language is set to.Search language is important, as the same string gives different results when searching in a different language. However, having the label and description always in English may be undesirable.
With this pull request, I suggest introducing a new parameter,
response_language
, to define this aspect. The API call this "uselang", which you may prefer. Indeed, thewbsearchentities
API have alanguage
and auselang
parameter, see: https://www.wikidata.org/w/api.php?action=help&modules=wbsearchentitiesSee below reprex that illustrates the difference:
Created on 2022-03-09 by the reprex package (v2.0.1)