Page MenuHomePhabricator

Update Tech News module to add a translatable title
Closed, ResolvedPublic

Description

MassMessage has been improved so that it is now possible to have a section on the text to be used as a message title (T164503).

At the moment, during the distribution, we select a section named like technews-2022-W10 to get the text on MassMessage. The title remains in English.

The idea would be to have a new section for the title. The module that preloads Tech News contents would have <section begin="technews-2022-W10-title"/> and <section end="technews-2022-W10-title"/> to be added to the preload, so that we can use technews-2022-W10-title as the message title for week 10 of 2022.

Maybe consider to change the section name for the text to <section begin="technews-2022-W10-text"/> and <section end="technews-2022-W10-text"/> -- but the best option is to keep this section as it is now, only work on the title.

Ideally, the title would rely on variables for week and year. This way, most translators would not have to change it, or only a few times a year. Examples:

  • English: Tech News: $year-$week
  • French: Actualités techniques : semaine $week de $year

Details

Other Assignee
Trizek-WMF

Event Timeline

Maybe consider to change the section name for the text to <section begin="technews-2022-W10-text"/> and <section end="technews-2022-W10-text"/>

I recall sections explicitly wanted by some project. This means that they probably depend on them, and renaming them would potentially be a breaking change. If it really is, I don’t think it’s worth the effort needed to clean up broken things. (But I’m far from being sure, I can well be wrong.)

Thank you for your comment @Tacsipacsi. However, I'm not sure to understand it entirely.

I recall sections explicitly wanted by some project. This means that they probably depend on them, and renaming them would potentially be a breaking change.

According to T254483: Support sending only the specified section of a translatable page using Special:MassMessage, it is possible to have multiple sections. I can't find feedback or a decision about having unique sections.
Or is it about changing the sections' names, that would break down some local filters, as also mentioned in T254483? In this case, we could announce the change before making it happen so that feedback can be collected and/or tools being adjusted.

If we lift off these blockers, how easy would it be for you or someone with your skills to edit Module:Tech News?

Re: Body section name - This is about the usage at https://en.wikipedia.org/wiki/Template:Latest_tech_news -- as discussed at https://meta.wikimedia.org/wiki/Talk:Tech/News/init#Changing_the_section_name_-_tech-newsletter-content
TLDR: That template currently expects a section named technews-2022-W10.
I don't know/remember if other wikis also utilize this feature, therefor it's probably easiest to just keep that "body" variable named the same way it currently is?

Re: Title - I was thinking that we were going to change the title to Tech/News/2022/10, per the discussion at https://meta.wikimedia.org/wiki/Talk:Tech/News#Numbering_scheme - Both to match the actual page URL, and to minimize the amount of translatable-content.

Re: Body section name - This is about the usage at https://en.wikipedia.org/wiki/Template:Latest_tech_news -- as discussed at https://meta.wikimedia.org/wiki/Talk:Tech/News/init#Changing_the_section_name_-_tech-newsletter-content
TLDR: That template currently expects a section named technews-2022-W10.
I don't know/remember if other wikis also utilize this feature, therefor it's probably easiest to just keep that "body" variable named the same way it currently is?

Yeah, that’s what I was thinking about, thanks for helping my memory! So I referred to the <section> parser tags, not the topic titles, @Trizek-WMF.

We can keep things like they are for the text, just add a <section> for titles, right?
How easy it is?

Not doing something (changing the body’s section name) is usually easier than doing it. 😉 I think all we need to do is updating Tech/News/init with

@@ -1,1 +1,1 @@
-{{Tech news/header}}
+{{Tech news/header|subject=<section begin="technews-subject" />XXX<section end="technews-subject" />}}

with XXX replaced by whatever text we come up with. rEMAM includes/MessageContentFetcher/LabeledSectionContentFetcher.php uses naïve regexes to find the content, including the subject in a template parameter doesn’t seem to be an issue. Not even if that template doesn’t output the parameter (but we probably should output it, so that translators see what they’ve translated). Since the subject is delivered without <section> tags anyway (see example), I think we can just use a general name and not bother with the module.

Thank you for the details!

Not doing something (changing the body’s section name) is usually easier than doing it. 😉

I can't agree more!

with XXX replaced by whatever text we come up with.

The source text would be Tech News: YYYY-WW, with the year and the week being taken from the page title. The goal is to avoid the burden of fixing manually the title when creating the page, and also to avoid too much translation work for translators.

Ideally, and as described in this task's description the title of the issue would be displayed to translators as Tech News: $year-$week so that they can play around with the parameters. A possible example in Spanish: Noticias Técnicas : $year, semana $week -->Noticias Técnicas : 2022, semana 10.

Since the subject is delivered without <section> tags anyway (see example), I think we can just use a general name and not bother with the module.

Our goal is to deliver a translatable title. IIRC, the only way to do it on a translated message is to have a section that wraps up the part of the message that is the title (example), and select this section when using MassMessage. So I'm not sure to get what you mean there: are you saying that it is possible to select a piece of text as a title without a section?

The <section> tags still need to be around the topic title, but – in contrast to the body’s <section> tags – it doesn’t matter if they’re unique each week or not. See the section linked above:

== Az Egyetemes Magatartási Kódex Végrehajtási Irányelvek megerősítési szavazása 2022. március 7. és 21. között zajlik. == <!-- no <section> in the delivered text here -->

<section begin="announcement-content" /> <!-- <-- here is a <section> tag -->
:''[[m:Special:MyLanguage/Universal Code of Conduct/Enforcement guidelines/Vote|Ez az üzenet további nyelvekre lefordítva megtalálható a Meta-wiki oldalon.]]

[…]

Wikimédia Alapítvány<section end="announcement-content" /> <!-- <-- here is another <section> tag -->

[[User:Xeno (WMF)|Xeno (WMF)]] 2022. március 8., 01:52 (CET)
<!-- Az üzenetet User:Xeno (WMF)@metawiki küldte a(z) https://meta.wikimedia.org/w/index.php?title=Movement_Strategy_and_Governance/Delivery&oldid=22962850 helyen található lista használatával -->

The body text’s <section> tags are distributed with the message, so their begin="" and end="" attributes need to be different each week in order for enwiki’s transclude-the-latest mechanism to work. However, title’s <section> tags aren’t distributed, so I propose to keep things simple and use the same begin="" and end="" attributes for the title each week, as the reason for using unique attributes (enwiki’s transclusion mechanism) doesn’t apply here.

Thank you! It is crystal clear. :)
Would you be nice and help us there once again, by changing the module and the preloading contents? It is far above our skills regarding templates. It is not urgent, we will announce it first, but we think it could be a nice to have a translated title being delivered to our communities.

@Trizek-WMF As I wrote, no module changes were necessary. I finally decided not to put it in the tech news header template, but below the languages bar, approximately to the same place where it appears after distribution. Does it look good to you? Feel free to revert even if yes but you don’t want to have it in the 11 April issue yet. (The 28 March and 4 April issues have already been generated, so they’re unaffected by the init page change.)

Quiddity assigned this task to Trizek-WMF.
Quiddity updated Other Assignee, added: Tacsipacsi.

First delivery was a success. Thanks again, Tacipacsi et al. :)

Trizek-WMF updated Other Assignee, added: Trizek-WMF; removed: Tacsipacsi.
  NODES
Idea 3
idea 3
Note 1
Project 3