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 Medium.Nov 22 2014, 12:19 AM
bzimport set Reference to bz35074.
bzimport added a subscriber: Unknown Object (MLST).

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.

(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

  • 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
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

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

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

Anomie claimed this task.
Anomie closed subtask T47843: Rework API error reporting as Resolved.