mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CategoryTree
synced 2024-11-15 20:09:58 +00:00
Merge "Update for API error i18n"
This commit is contained in:
commit
640460b17c
|
@ -7,7 +7,11 @@ class ApiCategoryTree extends ApiBase {
|
|||
if ( isset( $params['options'] ) ) {
|
||||
$options = FormatJson::decode( $params['options'] );
|
||||
if ( !is_object( $options ) ) {
|
||||
$this->dieUsage( 'Options must be valid a JSON object', 'invalidjson' );
|
||||
if ( is_callable( [ $this, 'dieWithError' ] ) ) {
|
||||
$this->dieWithError( 'apierror-categorytree-invalidjson', 'invalidjson' );
|
||||
} else {
|
||||
$this->dieUsage( 'Options must be valid a JSON object', 'invalidjson' );
|
||||
}
|
||||
return;
|
||||
}
|
||||
$options = get_object_vars( $options );
|
||||
|
|
|
@ -39,5 +39,6 @@
|
|||
"categorytree-retry": "Please wait a moment and try again.",
|
||||
"apihelp-categorytree-description": "Internal module for the CategoryTree extension.",
|
||||
"apihelp-categorytree-param-category": "Title in the category namespace, prefix will be ignored if given.",
|
||||
"apihelp-categorytree-param-options": "Options for the CategoryTree constructor as a JSON object. The <var>depth</var> option defaults to <kbd>1</kbd>."
|
||||
"apihelp-categorytree-param-options": "Options for the CategoryTree constructor as a JSON object. The <var>depth</var> option defaults to <kbd>1</kbd>.",
|
||||
"apierror-categorytree-invalidjson": "Options must be valid a JSON object."
|
||||
}
|
||||
|
|
|
@ -57,5 +57,6 @@
|
|||
"categorytree-retry": "Instruction to try again later",
|
||||
"apihelp-categorytree-description": "{{doc-apihelp-description|categorytree}}",
|
||||
"apihelp-categorytree-param-category": "{{doc-apihelp-param|categorytree|category}}",
|
||||
"apihelp-categorytree-param-options": "{{doc-apihelp-param|categorytree|options}}"
|
||||
"apihelp-categorytree-param-options": "{{doc-apihelp-param|categorytree|options}}",
|
||||
"apierror-categorytree-invalidjson": "{{doc-apierror}}"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue