Wikidata-Toolkit icon indicating copy to clipboard operation
Wikidata-Toolkit copied to clipboard

wbsearch entities with language set return english response

Open ajira86 opened this issue 8 years ago • 3 comments

Hello,

I'm trying to call the wikidata API with the following URL: https://www.wikidata.org/w/api.php?action=wbsearchentities&format=json&type=item&language=fr&strictlanguage=&search=orange

I excepted a french result for the french word but I get always an english result.

ajira86 avatar Aug 30 '16 16:08 ajira86

I believe the issue you are describing is tracked in T109584. To work around it you can add &uselang=fr to the URL you are using.

thiemowmde avatar Aug 30 '16 18:08 thiemowmde

Thanks @thiemowmde for your help. I took a look on the API documentation to ensure to not forget this kind of parameter before posting but the following sentence explain in a word why we have to add this parameter

Returns a label and description for the entity in the user language if possible

In my case, I doesn't have any user data because of the call from Ajax. For me this is more a documentation lake but apparently the issue is controverted :/

ajira86 avatar Aug 30 '16 20:08 ajira86

This thread and the wikimedia bug seem to have died. But I just ran into the same issue. I would like to add uselang as an optional property to WbGetEntitiesSearchData so I can pass it to WikiDataFetcher.searchEntities

Lhaaits avatar Sep 22 '22 17:09 Lhaaits