aboutsummaryrefslogtreecommitdiffstats
path: root/includes/Rest/Handler
diff options
context:
space:
mode:
authorfrankie <fgoodwin@wikimedia.org>2025-02-05 10:53:32 -0500
committerfrankie <fgoodwin@wikimedia.org>2025-02-05 19:57:07 -0500
commit1a39f00d25d4121f7daa8e9ee71d50575d1a9a2f (patch)
tree846d98c2bfa906c9d89a474d8f13540686a9cdb3 /includes/Rest/Handler
parentda6e91937610ae0bb323c518f05cc23b67fe4fc5 (diff)
downloadmediawikicore-1a39f00d25d4121f7daa8e9ee71d50575d1a9a2f.tar.gz
mediawikicore-1a39f00d25d4121f7daa8e9ee71d50575d1a9a2f.zip
Translate request body parameters for 'page' endpoints
As part of an effort to increase translation coverage over automated OpenAPI spec generation, use established translation strings for all request body parameters. Bug: T378375 Change-Id: If678d7177bd09e3bdc5bc0cd1605a43dc825eb5c
Diffstat (limited to 'includes/Rest/Handler')
-rw-r--r--includes/Rest/Handler/CreationHandler.php9
-rw-r--r--includes/Rest/Handler/UpdateHandler.php5
2 files changed, 9 insertions, 5 deletions
diff --git a/includes/Rest/Handler/CreationHandler.php b/includes/Rest/Handler/CreationHandler.php
index 5cbc193892a6..5912c0a74784 100644
--- a/includes/Rest/Handler/CreationHandler.php
+++ b/includes/Rest/Handler/CreationHandler.php
@@ -3,6 +3,7 @@
namespace MediaWiki\Rest\Handler;
use MediaWiki\Request\WebResponse;
+use MediaWiki\Rest\Handler;
use MediaWiki\Rest\LocalizedHttpException;
use MediaWiki\Rest\Response;
use Wikimedia\Message\MessageValue;
@@ -32,25 +33,25 @@ class CreationHandler extends EditHandler {
self::PARAM_SOURCE => 'body',
ParamValidator::PARAM_TYPE => 'string',
ParamValidator::PARAM_REQUIRED => true,
- self::PARAM_DESCRIPTION => 'The intended content of the page',
+ Handler::PARAM_DESCRIPTION => new MessageValue( 'rest-param-desc-source' )
],
'title' => [
self::PARAM_SOURCE => 'body',
ParamValidator::PARAM_TYPE => 'string',
ParamValidator::PARAM_REQUIRED => true,
- self::PARAM_DESCRIPTION => 'The title of the page to create',
+ Handler::PARAM_DESCRIPTION => new MessageValue( 'rest-param-desc-create-title' )
],
'comment' => [
self::PARAM_SOURCE => 'body',
ParamValidator::PARAM_TYPE => 'string',
ParamValidator::PARAM_REQUIRED => true,
- self::PARAM_DESCRIPTION => 'A comment describing the reason for creating the page',
+ Handler::PARAM_DESCRIPTION => new MessageValue( 'rest-param-desc-comment' )
],
'content_model' => [
self::PARAM_SOURCE => 'body',
ParamValidator::PARAM_TYPE => 'string',
ParamValidator::PARAM_REQUIRED => false,
- self::PARAM_DESCRIPTION => 'The content model to use to interpret the source',
+ Handler::PARAM_DESCRIPTION => new MessageValue( 'rest-param-desc-contentmodel' )
],
]
+ $this->getTokenParamDefinition();
diff --git a/includes/Rest/Handler/UpdateHandler.php b/includes/Rest/Handler/UpdateHandler.php
index 2fbc089237eb..c6fc9b67fde4 100644
--- a/includes/Rest/Handler/UpdateHandler.php
+++ b/includes/Rest/Handler/UpdateHandler.php
@@ -61,17 +61,19 @@ class UpdateHandler extends EditHandler {
self::PARAM_SOURCE => 'body',
ParamValidator::PARAM_TYPE => 'string',
ParamValidator::PARAM_REQUIRED => true,
- Handler::PARAM_DESCRIPTION => new MessageValue( 'rest-param-desc-update-source' )
+ Handler::PARAM_DESCRIPTION => new MessageValue( 'rest-param-desc-source' )
],
'comment' => [
self::PARAM_SOURCE => 'body',
ParamValidator::PARAM_TYPE => 'string',
ParamValidator::PARAM_REQUIRED => true,
+ Handler::PARAM_DESCRIPTION => new MessageValue( 'rest-param-desc-comment' )
],
'content_model' => [
self::PARAM_SOURCE => 'body',
ParamValidator::PARAM_TYPE => 'string',
ParamValidator::PARAM_REQUIRED => false,
+ Handler::PARAM_DESCRIPTION => new MessageValue( 'rest-param-desc-contentmodel' )
],
'latest' => [
self::PARAM_SOURCE => 'body',
@@ -81,6 +83,7 @@ class UpdateHandler extends EditHandler {
[ 'id' => 'integer' ],
[ 'timestamp' => 'string' ], // from GET response, will be ignored
),
+ Handler::PARAM_DESCRIPTION => new MessageValue( 'rest-param-desc-update-latest' )
],
] + $this->getTokenParamDefinition();
}