mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-24 07:54:13 +00:00
Update for API error i18n
See Iae0e2ce3. Since Echo master requires core master, this just depends on the master patch instead of trying to maintain BC. Depends-On: Iae0e2ce3bd42dd4776a9779664086119ac188412 Change-Id: Icc088b31bc99e03ac88dfb44329df55318bf99b5
This commit is contained in:
parent
1a0693d737
commit
f608d73287
|
@ -272,5 +272,8 @@
|
|||
"apihelp-query+unreadnotificationpages-param-grouppages": "Group talk pages together with their subject page, and group notifications not associated with a page together with the current user's user page.",
|
||||
"apihelp-query+unreadnotificationpages-param-limit": "The maximum number of pages to return.",
|
||||
"apihelp-query+unreadnotificationpages-param-wikis": "List of wikis to fetch pages with unread notifications from (defaults to only current wiki).",
|
||||
"apihelp-query+unreadnotificationpages-example-1": "List pages with (their amount of) unread notifications"
|
||||
"apihelp-query+unreadnotificationpages-example-1": "List pages with (their amount of) unread notifications",
|
||||
"apiwarn-echo-deprecation-timestampformat": "The MW timestamp output format is deprecated here. In the future, ISO 8601 will always be used for the output timestamp format. Adjust your client and set <var>timestampFormat</var> to <kbd>ISO_8601</kbd>.",
|
||||
"apiwarn-echo-deprecation-flyout": "<kbd>notformat=flyout</kbd> has been deprecated and will be removed soon. Use <kbd>notformat=model</kbd> to get the raw data or <kbd>notformat=special</kbd> for pre-rendered HTML.",
|
||||
"apiwarn-echo-deprecation-html": "<kbd>notformat=html</kbd> has been deprecated and will be removed soon. Use <kbd>notformat=special</kbd> instead."
|
||||
}
|
||||
|
|
|
@ -265,5 +265,8 @@
|
|||
"apihelp-query+unreadnotificationpages-param-grouppages": "{{doc-apihelp-param|query+unreadnotificationpages|grouppages}}",
|
||||
"apihelp-query+unreadnotificationpages-param-limit": "{{doc-apihelp-param|query+unreadnotificationpages|limit}}",
|
||||
"apihelp-query+unreadnotificationpages-param-wikis": "{{doc-apihelp-param|query+unreadnotificationpages|wikis}}",
|
||||
"apihelp-query+unreadnotificationpages-example-1": "{{doc-apihelp-example|query+unreadnotificationpages}}"
|
||||
"apihelp-query+unreadnotificationpages-example-1": "{{doc-apihelp-example|query+unreadnotificationpages}}",
|
||||
"apiwarn-echo-deprecation-flyout": "{{doc-apierror}}",
|
||||
"apiwarn-echo-deprecation-html": "{{doc-apierror}}",
|
||||
"apiwarn-echo-deprecation-timestampformat": "{{doc-apierror}}"
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ class ApiEchoMarkRead extends ApiBase {
|
|||
|
||||
$user = $this->getUser();
|
||||
if ( $user->isAnon() ) {
|
||||
$this->dieUsage( 'Login is required', 'login-required' );
|
||||
$this->dieWithError( 'apierror-mustbeloggedin-generic', 'login-required' );
|
||||
}
|
||||
|
||||
$notifUser = MWEchoNotifUser::newFromUser( $user );
|
||||
|
|
|
@ -8,7 +8,7 @@ class ApiEchoMarkSeen extends ApiBase {
|
|||
|
||||
$user = $this->getUser();
|
||||
if ( $user->isAnon() ) {
|
||||
$this->dieUsage( 'Login is required', 'login-required' );
|
||||
$this->dieWithError( 'apierror-mustbeloggedin-generic', 'login-required' );
|
||||
}
|
||||
|
||||
$params = $this->extractRequestParams();
|
||||
|
@ -20,10 +20,7 @@ class ApiEchoMarkSeen extends ApiBase {
|
|||
$outputTimestamp = wfTimestamp( TS_ISO_8601, $timestamp );
|
||||
} else {
|
||||
// MW
|
||||
$this->setWarning( 'The MW timestamp output format is deprecated' .
|
||||
' here. In the future, ISO 8601 will always be used for ' .
|
||||
'the output timestamp format. Adjust your client and ' .
|
||||
'set timestampFormat to \'ISO_8601\'.' );
|
||||
$this->addDeprecation( 'apiwarn-echo-deprecation-timestampformat' );
|
||||
|
||||
$outputTimestamp = $timestamp;
|
||||
}
|
||||
|
|
|
@ -16,23 +16,16 @@ class ApiEchoNotifications extends ApiCrossWikiBase {
|
|||
$this->getMain()->getVal( '_' );
|
||||
|
||||
if ( $this->getUser()->isAnon() ) {
|
||||
$this->dieUsage( 'Login is required', 'login-required' );
|
||||
$this->dieWithError( 'apierror-mustbeloggedin-generic', 'login-required' );
|
||||
}
|
||||
|
||||
$params = $this->extractRequestParams();
|
||||
|
||||
/* @deprecated */
|
||||
if ( $params['format'] === 'flyout' ) {
|
||||
$this->setWarning(
|
||||
"notformat=flyout has been deprecated and will be removed soon.\n".
|
||||
"Use notformat=model to get the raw data or notformat=special\n".
|
||||
"for pre-rendered HTML."
|
||||
);
|
||||
$this->addDeprecation( 'apiwarn-echo-deprecation-flyout' );
|
||||
} elseif ( $params['format'] === 'html' ) {
|
||||
$this->setWarning(
|
||||
"notformat=html has been deprecated and will be removed soon.\n".
|
||||
"Use notformat=special instead."
|
||||
);
|
||||
$this->addDeprecation( 'apiwarn-echo-deprecation-html' );
|
||||
}
|
||||
|
||||
if ( $this->allowCrossWikiNotifications() ) {
|
||||
|
|
|
@ -15,14 +15,14 @@ class ApiEchoUnreadNotificationPages extends ApiCrossWikiBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* @throws UsageException
|
||||
* @throws ApiUsageException
|
||||
*/
|
||||
public function execute() {
|
||||
// To avoid API warning, register the parameter used to bust browser cache
|
||||
$this->getMain()->getVal( '_' );
|
||||
|
||||
if ( $this->getUser()->isAnon() ) {
|
||||
$this->dieUsage( 'Login is required', 'login-required' );
|
||||
$this->dieWithError( 'apierror-mustbeloggedin-generic', 'login-required' );
|
||||
}
|
||||
|
||||
$params = $this->extractRequestParams();
|
||||
|
|
Loading…
Reference in a new issue