Page MenuHomePhabricator

API example for wbladdsense is not valid
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

It gives an error saying the language code is not recognised:

{
    "error": {
        "code": "not-recognized-language",
        "info": "Unknown language \"en-US\" for term \"Some text value\" in field \"data\" at \"glosses/en-US\".",
        "parameterName": "data",
        "fieldPath": [
            "glosses",
            "en-US"
        ],
        "docref": "See https://test.wikidata.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes."
    },
    "servedby": "mw-api-ext.codfw.main-5974658687-r5kmp"
}

What should have happened instead?:

The API documentation should provide a valid example.

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

Apparently lowercase en-us and en-gb works. The code is in AddSense::getExamplesMessages(), if anyone wants to submit a patch to change the capitalization of the gloss languages. (AddForm / wbladdform might also be affected, not sure.)