Page MenuHomePhabricator

Move linkprefix out of $messages and use a simpler input convention
Closed, ResolvedPublic

Description

Years ago, in Messages*.php, linktrail was moved out of $messages and into a separate variable ($linkTrail) with a dedicated accessor in Language. This was because changing the link trail is potentially very disruptive, and the need for sysops to legitimately edit the link trail is very rare.

The same treatment should be given to linkprefix. However, after Iaa7eaa44 (and arguably before it), the regex is too complex to expect translators to be able to accurately maintain. I suggest taking advantage of the migration of linkprefix out of $messages to simultaneously change its definition, from a whole regex to a character class, similar to $wgLegalTitleChars. The actual implementation of the reverse search for characters not matching the character class would be in Parser.php rather than duplicated in 38 language files.

The /u modifier could be used unconditionally.

The few regexes that can't currently be expressed in this way (uk, cu, udm) are apparently not like that for any fundamental language-related reason -- they could just as easily include entire runs of quotation marks in the link text, like crh, cv and uz.


Version: 1.22.0
Severity: normal

Details

Reference
bz56031

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:26 AM
bzimport set Reference to bz56031.

Change 91425 had a related patch set uploaded by Anomie:
Remove linkprefix message, add $linkPrefixCharset

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

Change 91425 merged by jenkins-bot:
Remove linkprefix message, add $linkPrefixCharset

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