Page MenuHomePhabricator

REST: Update translation strings with improved versions from api.wikimedia.org
Closed, ResolvedPublic2 Estimated Story Points

Description

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

  1. Go through every string in en.json whose message key begins with "rest-param-desc" (see checklist below).
  2. For each string, see if there is an equivalent api.wikimedia.org string that would be superior.
  3. 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.
  4. Load the raw spec locally to ensure the strings appear as desired
  5. 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.

Details

Related Changes in Gerrit:

Event Timeline

FGoodwin changed the task status from Open to In Progress.Dec 10 2024, 2:01 PM

Change #1108770 had a related patch set uploaded (by Fgoodwin; author: Fgoodwin):

[mediawiki/core@master] Update translation strings in MW rest.api

https://gerrit.wikimedia.org/r/1108770

I'm going to go through a second time, but I think I found the most obvious strings to update. I'm wondering if those that aren't in the specs should be updated/rewritten, as well.

Change #1108770 merged by jenkins-bot:

[mediawiki/core@master] Update translation strings in MW rest.api

https://gerrit.wikimedia.org/r/1108770

Remaining work:

  • Update ticket to reflect current status; recent changes were just merged.
  • Some strings do not have equivalent values in the API portal.
    • Need to make a list of outstanding strings/values that don't have a match in the spec.
  • Clean up and close out.