tl;dr: use strings from api.wikimedia.org in the MW REST API en.json file instead of the current strings.
Context
As part of the 5.1.8 hypothesis, we are adding translation strings for various descriptions that appear in MediaWiki REST API OpenAPI specs, and therefore also in the REST Sandbox.
The initial strings were largely created quickly by developers, and in many cases could be improved. On api.wikimedia.org, there is documentation for a number of MW REST endpoints, containing various strings that could be used for this purpose.
Implementation
- Go through every string in en.json whose message key begins with "rest-param-desc" (see checklist below).
- For each string, see if there is an equivalent api.wikimedia.org string that would be superior.
- Replace any such strings with the equivalent from api.wikimedia.org. Note that some strings may need a little rewording for use in the spec.
- Load the raw spec locally to ensure the strings appear as desired
- Load the REST Sandbox locally to ensure the strings appear in the REST Sandbox as desired.
Checklist
Strings to be checked, along with the class in which they are used:
RevisionContentHelper:
- rest-param-desc-revision-id
HtmlInputTransformHelper:
- rest-param-desc-html-input-title
- rest-param-desc-html-input-oldid
- rest-param-desc-html-input-from
- rest-param-desc-html-input-format
- rest-param-desc-html-input-contentmodel
- rest-param-desc-html-input-language
HtmlOutputRendererHelper:
- rest-param-desc-html-output-stash
- rest-param-desc-html-output-flavor
PageContentHelper:
- rest-param-desc-page-content-title
- rest-param-desc-page-content-redirect
UpdateHandler:
- rest-param-desc-update-source
- rest-param-desc-update-title
CompareHandler:
- rest-param-desc-compare-from
- rest-param-desc-compare-to
LanguageLinksHandler:
- rest-param-desc-language-links-title
MediaFileHandler:
- rest-param-desc-media-file-title
MediaLinksHandler:
- rest-param-desc-media-links-title
ModuleSpecHandler:
- rest-param-desc-module-spec-module
- rest-param-desc-module-spec-version
OpenSearchDescriptionHandler
- rest-param-desc-opensearch-ctype
PageHistoryCountHandler
- rest-param-desc-pagehistory-count-title
- rest-param-desc-pagehistory-count-type
- rest-param-desc-pagehistory-count-from
- rest-param-desc-pagehistory-count-to
PageHistoryHandler
- rest-param-desc-pagehistory-title
- rest-param-desc-pagehistory-older-than
- rest-param-desc-pagehistory-newer-than
- rest-param-desc-pagehistory-filter
SearchHandler
- rest-param-desc-search-q
- rest-param-desc-search-limit
TransformHandler
- rest-param-desc-transform-from
- rest-param-desc-transform-format
- rest-param-desc-transform-title
- rest-param-desc-transform-revision
Notes
- https://learn.openapis.org/specification/docs.html explains the OpenAPI "description" field, including some formatting and markup options that we have not yet used, but which might be interesting to explore
- it should be unnecessary to change any message keys. Only the message strings (the part shown to users in the spec) should need changed.
- it should be unnecessary to change anything in any other file. Only en.json should need changes. The exception is that if there are cases where a string is currently reused in multiple endpoints and it would be preferable to use separate strings so that each could be customized for that endpoint. The task author is unaware of any such cases.