Page MenuHomePhabricator

Make API error messages translatable
Closed, ResolvedPublic

Description

Currently, if we do a call such as
https://pt.wikipedia.org/w/api.php?action=LOREM+IPSUM&format=jsonfm
there will be an error message

"info": "Unrecognized value for parameter 'action': LOREM IPSUM"

This kind of messages from API (errors and warnings) should be translatable into the user language.


Version: 1.19
Severity: enhancement
URL: https://www.mediawiki.org/w/index.php?title=Requests_for_comment/API_roadmap#Internationalizing_API_warnings_and_errors
See Also:

Details

Reference
bz35074

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 22 2014, 12:19 AM
bzimport set Reference to bz35074.
bzimport added a subscriber: Unknown Object (MLST).
He7d3r created this task.Mar 9 2012, 1:17 AM

We should not complicate API itself with i18n too much, but we can certainly make it easier for applications using API by providing localised error message through an API module or RL module for example.

Reedy added a comment.Mar 9 2012, 4:32 PM

(In reply to comment #1)

We should not complicate API itself with i18n too much, but we can certainly
make it easier for applications using API by providing localised error message
through an API module or RL module for example.

I'd agree with something along those lines.

Just because someone is using it on a non english wiki (especially in WMFs case), doesn't mean they want their error messages localised.

Having some map (though, we probably need to ensure unique error codes), to be able to request a localised version would be sane

Anomie added a comment.Mar 5 2013, 9:25 PM
  • Bug 45753 has been marked as a duplicate of this bug. ***
Restricted Application removed a subscriber: Mjbmr. · View Herald TranscriptJun 20 2015, 11:26 AM
Anomie moved this task from Unsorted to Blocked on the MediaWiki-API board.Jun 20 2015, 12:16 PM
Tgr updated the task description. (Show Details)Oct 24 2016, 7:46 PM
Tgr set Security to None.

Change 321406 had a related patch set uploaded (by Anomie):
API: i18n for warnings and errors

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

Anomie moved this task from Blocked to Needs Review on the MediaWiki-API board.Nov 14 2016, 6:32 PM
daniel added a subscriber: daniel.Nov 16 2016, 8:45 PM

Change 321406 merged by jenkins-bot:
API: i18n for warnings and errors

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

Anomie closed this task as Resolved.Dec 6 2016, 8:17 PM
Anomie claimed this task.
Anomie closed subtask T47843: Rework API error reporting as Resolved.