Last modified: 2014-02-12 23:35:46 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T48100, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 46100 - Introduce new "language code" parameter type into API base
Introduce new "language code" parameter type into API base
Status: NEW
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.21.x
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-14 05:24 UTC by Yuri Astrakhan
Modified: 2014-02-12 23:35 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Yuri Astrakhan 2013-03-14 05:24:13 UTC
Many modules may require user to specify a "langcode", which we should provide in the base.

Invalid characters (validated as not matching ^[a-z:_\-]+$ or something similar by the Language classes) will cause an error to be reported.

The base class will autodetect if any params have the 'langcode' type and report the that module may return this error (similar to 'badcontinue')
Comment 1 Umherirrender 2013-04-02 12:12:42 UTC
Commited Gerrit change #57047
Comment 2 Gerrit Notification Bot 2013-04-05 13:53:18 UTC
https://gerrit.wikimedia.org/r/57047 (Gerrit Change I03008949d964dc7a122e2fce2deae19c997887d0) | change ABANDONED [by Umherirrender]
Comment 3 Umherirrender 2013-04-05 13:57:17 UTC
Abandon: There are different validation methods in the Language class for different use cases and work flows, so this should be done inside the modules, which than can choose the necessary validation.

In my opinion this is a WONTFIX, because it cannot provided by a base class.

Other ideas, when somebody want this in the base class:

- Provide a way, to get a language object for the param from given language code. Avoids factory calls inside the module.

- Allow a default value to get the user or the content language for the param. Avoids is_null checks inside the modules.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links