Page MenuHomePhabricator

Make protection reason localizable, display on wiki content language
Closed, ResolvedPublic

Description

At https://github.com/wikimedia/mediawiki-extensions-CentralNotice/blob/a5b313996b23484e29b9a6cd2a1cdbf091803214/includes/Banner.php#L1551 we can find the config that adds the protection reason displayed on CentralNotice.

We should make that a translatable message in the /i18n folder for CentralNotice, and said message to be output in the wiki content language (NOT user language) where CentralNotice actions are triggered.

Thanks.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 21 2018, 6:24 PM

Given that the protection reasons would only ever appear on meta wouldn't user language be better?

Given that "Autoprotected by..." is displayed as the plain text reason in the Special:Log/protect log, using user language would mean that my protections would be described in Spanish, yours in English and somebody elses' in another language. I don't think we want that to happen (also think about other non-WMF wikis using CentralNotice ;-) ).

I'm attempting to do this at https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/CentralNotice/+/475126/

I've not linked the task in the patch in case it's terribly wrong and needs to be reworked entirely, etc.

Change 475126 had a related patch set uploaded (by MarcoAurelio; owner: MarcoAurelio):
[mediawiki/extensions/CentralNotice@master] Make autoprotection log reason localisable

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

Thanks @MarcoAurelio and @Seddon! It seems that this is the right way to go. If I understand correctly, the i18n aspect would be mostly of use outside the WMF, on wikis that use CentralNotice and are in languages other than English... Is that correct?

I'm just looking into some minor suggestions for the patch, including how to make the reason contain a link to Special:CentralNotice (instead of just plain text) and making sure we are escaping things properly.

Thanks again!!

Thanks @MarcoAurelio and @Seddon! It seems that this is the right way to go. If I understand correctly, the i18n aspect would be mostly of use outside the WMF, on wikis that use CentralNotice and are in languages other than English... Is that correct?

You're welcome. That's it & that's why I'd prefer the message to display in the wiki content language.

I'm just looking into some minor suggestions for the patch, including how to make the reason contain a link to Special:CentralNotice (instead of just plain text) and making sure we are escaping things properly.

Thanks again!!

Ack. Indeed maybe a link to Special:CentralNotice could be good, and we certainly need to check if we're escaping properly, etc. Unfortunatelly my knowledge about coding does not yet go that far :-(

Thanks.

We could also fix T213565 at the same time.

Indeed maybe a link to Special:CentralNotice could be good, and we certainly need to check if we're escaping properly, etc.

I sent a new patch set to Gerrit, adding a link. ProtectionForm, which handles manual changes to page protection, just passes the protection reason directly through with no escaping. So, I think we're OK with no further escaping on input. Eventually the reason is parsed as wikitext.

Change 475126 merged by jenkins-bot:
[mediawiki/extensions/CentralNotice@master] Improve autoprotection log reason and make it localisable

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