Page MenuHomePhabricator

Review Wikibase API error handling
Closed, ResolvedPublic

Description

The Wikibase API's error handling should be reviewed wrt two problems:

  • don't localize error messages. The core API doesn't. So this is inconsistent and potentially confusing.
  • make sure getPossibleErrors actually reports all possible errors, and provides a human readable description in english.

Version: master
Severity: normal

Details

Reference
bz38675

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:01 AM
bzimport set Reference to bz38675.
bzimport added a subscriber: Unknown Object (MLST).

Ask on wikitech-l if there are respective plans for core.

Talked with Siebrand and we should be localizing the error messages when they are used in the UI and do so in the JavaScript, in our case.

I really don't think we should assign this one without further discussion, this is a rather big task.

Can't find my notes on this but basically this is what needs to be fixed if we want a generalized approach that solves this in general

  • Change the calls to dieUsage to dieUsageMsg wheree applicable, or
  • Change the calls to wfMsg in dieUsage
  • Add the necessary arguments to the result in dieUsage where such arguments are needed for later processing, and
  • Make sure it is safe to report those arguments
  • Copy the now localized messages from the i18n-file to getPossibleErrors, or
  • Copy them to the actual call to dieUsage, or
  • Copy them to the actual call to dieUsageMsg (more trouble with args)
  • Investigate if the rest of the API is sufficiently well-behaved that we can localize in the user interface
  • Figure out which API error message we want to localize that is now in the details section, or (we could easily end up with a 3-figure number)
  • If we simply don't want to localize them at all, or
  • If we simply don't want to show error messages in the details section at all
  • Figure out which API error message we want to map to simplified UI messages

I don't think that this has an easy fix.

For later, please note the patchset https://gerrit.wikimedia.org/r/#/c/23154/1

We probably don't need to mark the ordinary messages, but we should probably mark the qqq descriptions. Or we should verify which one of them the i18n-people want us to mark.

Also see
https://gerrit.wikimedia.org/r/#/c/23078/
https://gerrit.wikimedia.org/r/#/c/21330/

(In reply to comment #5)

For later, please note the patchset https://gerrit.wikimedia.org/r/#/c/23154/1

We probably don't need to mark the ordinary messages, but we should probably
mark the qqq descriptions. Or we should verify which one of them the
i18n-people want us to mark.

Also see
https://gerrit.wikimedia.org/r/#/c/23078/
https://gerrit.wikimedia.org/r/#/c/21330/

If you have messages to be untranslated, please add a PHP comment like '# Do not translate' to it line in the English message section.

The i18n team (most of the time Siebrand or me) will add the keys to our config file https://gerrit.wikimedia.org/r/gitweb?p=translatewiki.git;a=blob;f=MediaWiki/mediawiki-defines.txt#l2055 once the patches are merged.

Ignored Messages will be deleted from the qqq section (beides all existing translations) during the daily export by our scripts.

Marking API error messages with a comment "#Do not translate"

https://gerrit.wikimedia.org/r/23298

  • Bug 41599 has been marked as a duplicate of this bug. ***

Adam: What's the status here? Can we close this or is something still needed?

As far as I can tell both points mentioned in the first comment on this big are resolved.