thiemowmde added a project: Regression.
thiemowmde added a comment.

API sandbox
-----------

I enter a search term and fill in the required "language" parameter:
F1910401: Screenshot from 2015-08-20 10:46:18.png 
<https://phabricator.wikimedia.org/F1910401>
The "language" parameter is described as "Search in this language". But this is 
not what's happening. The results I get are in an //other// language. A user of 
this API haves no idea of what's going on. He can not tell, not when looking at 
the Api sandbox, not when looking at the wbsearchentities API documentation, 
not even when looking //directly// at the SearchEntities.php code (that's what 
I did in the end).

There is a "Generic parameters" section with the "uselang" parameter. But this 
is described as "Language to use for message translations". Ok, so it is for 
exception messages? Fine. How are the labels and descriptions in the search 
results I requested "messages" that need "translation"? Search results are 
//content//. "uselang" is //not// for content.

Defaults
--------

Using the users language as a default is fine. It's clearly better than simply 
falling back to English.

But the "language" parameter does not even allow a default. It's a required 
parameter. The user //must// specify the language he wants. So why is this 
ignored and the results are delivered in an //other// language by default? Why 
is the default not the language the user explicitly requested?

Use cases
---------

What's the use case for the "feature" to ask for something in language A and 
get it back in language B? Which application //currently// uses this, why and 
for what?

I could think of a rare use case where a user happens to know the name of a 
city in Korean, does not know what it means //but// know it's Korean, and wants 
an intermediate translation in the search result: 
https://www.wikidata.org/w/api.php?format=jsonfm&action=wbsearchentities&search=서울특별시&language=ko&uselang=en.
 Two problems:

- This only works when the user knows the precise language (code) of the word 
he copy-pasted from somewhere.
- Did we gave up on the idea of aliases? This use case is in essence the reason 
we have aliases: 
https://www.wikidata.org/w/api.php?format=jsonfm&action=wbsearchentities&search=%EC%84%9C%EC%9A%B8%ED%8A%B9%EB%B3%84%EC%8B%9C&language=en&uselang=en

So again, what's the use case for having a default that returns search results 
in a language //different// from the language of the search term? As an option, 
why not. But why by default?

Solutions
---------

- Why is language A //suppressed//? Why aren't both included in the result, the 
original language of the search space and the translated language the user 
asked for (if he asked for one)?
- Simply default to the language given by the "language" parameter if no 
"uselang" parameter was set.
- Do not use "uselang" for content and do not confuse it with the language 
explicitely requested via the "language" API parameter.
- Introduce a new parameter and give it an expressive name, for example 
"translate" or "output-language".


TASK DETAIL
  https://phabricator.wikimedia.org/T109584

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Addshore, thiemowmde
Cc: gerritbot, Lydia_Pintscher, Jonas, Addshore, thiemowmde, Aklapper, 
Wikidata-bugs, aude, Malyacko



_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to