Page MenuHomePhabricator

Add translation disclaimer to REST API Sandbox
Closed, ResolvedPublic3 Estimated Story Points

Description

Description

Our REST API sandbox is built using Swagger UI, yet Swagger UI does not support native translation. This means that UI elements like table headers and navigation do support translation. We recently came to a decision to proceed with releasing REST sandbox with partial translation support. However, a stipulation of that release included adding a disclaimer about it being a known gap, as well as a link to [a phabricator](<PhabTBD>) ticket with more information about how we will solve it in the longer term.

Current page header description text reads:

This page provides a query builder for REST APIs. Note that API calls will interact with live wiki content.

Choose the API to explore.

Conditions of Acceptance

  • Update overall description header for the page. Message should read:

Use this page to experiment with the MediaWiki REST APIs. API calls made through this page will interact with live wiki content and may modify the wiki. Refer to the API documentation for further details about API usage.

Choose an API to explore.

  • When the page is accessed from a non-english wiki, include a disclaimer about the mixed translation support currently present in the REST Sandbox.
    • Only display the disclaimer message if the documentation is being viewed on non-english language projects.
    • Display this note before the "Choose an API to explore"
    • Display the translation note with "Information box" styling (blue i banner style -- see https://www.mediawiki.org/wiki/OOUI for an example)

Translation note: UI and navigation items do not yet support translation. We are aware and are [working towards a solution](<PhabricatorTBD>).

Details

Event Timeline

HCoplin-WMF updated the task description. (Show Details)
HCoplin-WMF set the point value for this task to 3.

From task description:

Use this page to experiment with the MediaWiki REST APIs. API calls made through the sandbox interface will interact with live wiki content and may modify the wiki. Refer to the API documentation for further details about API usage.

I suggest two changes:

  1. change "the sandbox interface" to "this page"
  2. link to the Overview page rather than the Reference page

In other words:

Use this page to experiment with the MediaWiki REST APIs. API calls made through this page will interact with live wiki content and may modify the wiki. Refer to the API documentation for further details about API usage.

Those changes look good to me! Thanks for the edits.

Change #1127019 had a related patch set uploaded (by BPirkle; author: BPirkle):

[mediawiki/core@master] REST: add translation disclaimer to REST Sandbox

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

Those changes look good to me! Thanks for the edits.

Thanks. It'd also be easier (at least at my limited skill level with OOUI) to display the disclaimer a little differently than the task specifies. How's this look (other than needing to add the actual Phab link)?

Screenshot 2025-03-12 at 9.15.04 AM.png (960×2 px, 198 KB)

Same thing, but in Dark Mode

Screenshot 2025-03-12 at 11.30.13 AM.png (800×2 px, 145 KB)

I created a phab ticket for the Codex request after following up with Matthew: https://phabricator.wikimedia.org/T388910

Can we pop that in for the "We are aware and working towards a solution" call out?

Regarding display style, I think that's fine. I'm sort of surprised that the blue style isn't automatically applied, but not the end of the world if it's grey. I'm pretty sure I've seen that in other wikis.

Just want to confirm it only shows up when the page is accessed from a non-english language project, too?

This styling looks right to me! Even when using OOUI, the documentation for the message component in Codex can guide decisions and this feels like it falls under the "Notice" message style, not "Warning" or any of the others.

Screenshot 2025-03-14 at 11.50.35 AM.png (638×1 px, 54 KB)

And I really like the idea of it only showing up when being viewed on non-english language projects - would almost be confusing if it showed up in English where it's working as expected.

Just want to confirm it only shows up when the page is accessed from a non-english language project, too?

That's how it is supposed to work, and does on my local. We'll want to confirm that on actual production before we roll out to additional wikis, just to make sure. Here are beta wikis in three different languages (English, French, Hebrew) that we can check after the change is merged.

https://en.wikipedia.beta.wmflabs.org/wiki/Special:RestSandbox
https://fr.wikipedia.beta.wmflabs.org/wiki/Sp%C3%A9cial:RestSandbox
https://he.wikipedia.beta.wmflabs.org/wiki/%D7%9E%D7%99%D7%95%D7%97%D7%93:RestSandbox

Change #1127019 merged by jenkins-bot:

[mediawiki/core@master] REST: add translation disclaimer to REST Sandbox

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