Background information
/page/summary doesn't return description in the correct language variant
How
Request the description in the correct language variant from Wikidata based on the accept language header.
For example, requesting https://sr.wikipedia.org/api/rest_v1/page/summary/Србија with Accept-Language: en, sr-Latn;q=0.9, sr-Cyrl;q=0.8 should return Serbian (Latin script) description from Wikidata. It would achieve this by passing sr-el as the languages parameter to wbgetentities since sr-Latn is higher than sr-Cyrl in the list of preferred languages.
https://wikidata.org/w/api.php?action=wbgetentities&format=json&ids=Q403&languages=sr-el
Open questions
As proposed, /page/summary would only return content in one of the language variants associated with the wiki in the request. In the example above, English could be requested from Wikidata since it's the most preferred language. However, given the domain of the request is sr.wikipedia.org, it should only return one of the Serbian variants.
Acceptance criteria
- For wikis that have language variants, the correct description is returned from /page/summary based on the Accept-Language header.
Other examples
https://zh.wikipedia.org/api/rest_v1/page/summary/中國 with zh-Hans as the most preferred Chinese language variant in the Accept-Language header would return the Simplified Chinese description from https://www.wikidata.org/wiki/Q29520 and with zh-Hant as the most preferred Chinese language variant in the Accept-Language header would return the Traditional Chinese description.