Page MenuHomePhabricator

Improve the Server Switch message so that translators don't need to change the date
Closed, ResolvedPublic

Description

Issue

Follow up of T287546: CommRel support for September 2021 Switchover.

During the last maintenance server switch, I checked on translations, and I noticed the base of the Luxembourish translation of the message: this message has two obsolete translations. They both provide a different outdated date and time.

TN.jpg (1,735×555 px, 433 KB)

This language, so as others (I see the case with Greek, Hebrew, Marathi...), don't have many translators. To reduce translators' burden, we should have a solution that remains stable, and doesn't requires a new translation each time we change a date or a time.

Possible solution

We can use Tech News' dates system, which has been proven as effective, and can be easily fixed by anyone if a translation is incorrect.

What we add to the source message:
{{#time:<tvar name="defaultformat">j xg</tvar>|<tvar name="date1">2021-09-14</tvar>|<tvar name="format_language_code">{{TRANSLATIONLANGUAGE}}</tvar>}}

What people see when they translate:
{{#time:$defaultformat|$date1|$format_language_code}}
(Looks tricky, but translators are used to it, and this code is used on every translation, meaning we can fix it anytime.)

What readers see:

  • in English: 14 September
  • In French: 14 septembre
  • in Japanese: は9月14日に
  • etc.
Next steps
  • check if it is possible to add the hour to this date format
  • discuss if this solution is the most reasonable one
  • apply it before the next server switch

Event Timeline

Hour is easy, docs at https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#.23time - Briefly: Just need to

  • replace the j xg with j xg H:i e
  • and use the full timestamp, e.g. 2021-08-25T06:00

However, see also what I setup at https://meta.wikimedia.org/w/index.php?title=Tech/Read-only_limited_announcement&action=edit - as that could perhaps be improved by swapping to this more complex method (to allow better localization, per the comments in this translators-l thread)

Elitre subscribed.

Assigning because this needs an owner, however I'd like this to be resolved soon - right now we don't have the capacity to investigate the best solution ever.

I implemented the solution.

While it is universal, for some languages the wikitext has a lot of unexpected wikitext in the source. Example to display the date in Hungarian:
{{#time:Y. F j|2021-10-20|hu}}{{#switch:{{#time:j|2021-10-20|hu}}|1=-jén|2|3|6|8|13|16|18|20|23|26|28|30=-án|#default=-én}}, {{#switch:{{#time:N|2021-10-20|hu}}|1=hétfőn|2=kedden|3=szerdán|4=csütörtökön|5=pénteken|6=szombaton|7=vasárnap}}

We will have to think about a solution to cover these languages, but for the majority of them, this date system now works.