Page MenuHomePhabricator

Show error in case of save attempt for a non-supported language
Open, Needs TriagePublic

Event Timeline

I have a feeling this is already done, I saw it when I tried saving some languages in the API. Can you elaborate @WMDE-leszek if I'm missing something here?

I have a feeling this is already done, I saw it when I tried saving some languages in the API. Can you elaborate @WMDE-leszek if I'm missing something here?

Since Leszek is on vacation. @Jakob_WMDE do you have more context on this? It would be great.

@Ladsgroup Yes, as far as I know showing / getting errors was not the issue, rather the fact that there were non-supported languages :)

@Ladsgroup Yes, as far as I know showing / getting errors was not the issue, rather the fact that there were non-supported languages :)

I know, the task has been broken down to three tasks, one of them is "avoid to save when the given language is unknown" (This task) but if I understand it correctly, it's already done:

amsa@amsa-Latitude-7480:~$ curl 'httpsxt/javascript, */*; q=0.01' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Referer: https://www.wikidata.org/wiki/Q4115189' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' --data 'action=wbsetlabel&format=json&id=Q4115189&value=Foo&language=tokipona&baserevid=974041385&bot=1&assertuser=Ladsgroup&token=youdontthinkIgiveoutmytokensoeasilyright'

{"error":{"code":"unknown_language","info":"Unrecognized value for parameter \"language\": tokipona.","*":"See https://www.wikidata.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."},"servedby":"mw1312"}

It might be that it is already handled as intended in all contexts (all API endpoints etc, all special pages) but then this task would at least about checking and ensuring it (e.g. automated tests) in a systematic way

Do the checking as mentioned in {T227082#5353160} and decide afterwards where to move with this