Page MenuHomePhabricator

Support creating language-specific links in help text and descriptions
Closed, ResolvedPublic

Description

The AutoModerator community configuration form has a need to inject a parameter into some of the message strings such as help text and descriptions.

This is necessary to make it convenient to override messages used by the AutoModerator account when it takes action.

In the designs in T366016: Design UX copy for AutoModerator Community Configuration we have links to translate wiki and system message prefix searches in help text and descriptions of our form. These will need to reflect the fact that workflows and wording can vary per wiki as well as to make it convenient for users to update.

For example, the translatewiki link will send a user of trwiki to
https://translatewiki.net/w/i.php?title=Special:Translate&group=ext-automoderator&language=tr&action=translate&filter=%21translated

where the query parameter

language=tr

will need to correspond to the wiki $wgLanguageCode.

The system message on trwiki will send the user to
https://tr.wikipedia.org/w/index.php?title=%C3%96zel:T%C3%BCm%C4%B0letiler&filter=all&limit=50+system+messages&prefix=automoderator-wiki
which will also need to updated per wiki.

We are open to a variety of solutions that would help us meet this need; could we use wikitext with magic words {{CONTENTLANGUAGE}}? Update the url parameter with javascript? use a schema for the help text/descriptions?

Event Timeline

• Kgraessle moved this task from Ready to Eng review on the Moderator-Tools-Team (Kanban) board.

moving this here to get some engineering eyes on it! I know there was some mention of possibly using javascript as well.

Samwalton9-WMF renamed this task from [DRAFT] Support adding a parameter to help text and descriptions to Support adding a parameter to help text and descriptions.Aug 13 2024, 2:44 PM
Samwalton9-WMF updated the task description. (Show Details)

This is a blocker to our integration of Community Configuration into Automoderator (T365046) as we need to be able to link to the location where strings can be translated.

KStoller-WMF moved this task from Inbox to Estimated tasks backlog on the Growth-Team board.

Is this request to be able to pass any parameter or just the language one? The latter seems simpler and that could be quickly implemented. Thoughts? cc @Michael

Michael renamed this task from Support adding a parameter to help text and descriptions to Support creating language-specific links in help text and descriptions.Aug 15 2024, 8:19 AM

Change #1062963 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/core@master] feat(jqueryMsg): add CONTENTLANGUAGE magic word support

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

For the special page, you can use a relative external link on the local wiki with query params: [/wiki/%C3%96zel:T%C3%BCm%C4%B0letiler&filter=all&limit=50+system+messages&prefix=automoderator-wiki AutoModerater System Messages].

Adding only the language in a parameter would be very much not nice, because it would mean you'd had to inject the $1 in an external url. Also, it would be very hacky on the CommunityConfiguration side (though doable). The proper way to do this on our side would be something like the evergreen of T370534.

The simplest though is to just add support for the CONTENTLANGUAGE magic word to MediaWiki core's jQueryMsg. It already supports things like SERVERNAME, so this should be no big deal. I've created the change for you and attached it to this task. I added some people who previously worked with magic words in jQueryMsg in case I missed some considerations.

Change #1062963 merged by jenkins-bot:

[mediawiki/core@master] feat(jqueryMsg): add CONTENTLANGUAGE magic word support

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

Thanks to quick review of the above change, [https://translatewiki.net/w/i.php?title=Special%3ATranslate&group=ext-automoderator&language={{CONTENTLANGUAGE}}&action=translate&filter= translatewiki] now does what you expect it to do.

Michael claimed this task.

Both teams have this in their "Triaged" column and I think this is actually done, so I'm closing this. Please reopen if you think something is still missing here.