Page MenuHomePhabricator

Central notice field names cannot contain national characters
Closed, ResolvedPublic

Description

It might be a deliberate design choice, but since it has bitten me right now, I’ll report anyway:

Special:NoticeTemplate gets the fields from the template text using a simple regex looking for /\{\{\{([A-Za-z0-9\_\-}]+)\}\}\}/, which means the field name must not use any national characters, space, or any other characters except English letters, numbers, and hyphen+underscore. If you do, the notice works correctly, but Special:NoticeTemplate does not show the fields in the translation list (and you can modify them only by editing the corresponding MediaWiki: pages, if you know where to look).


Version: unspecified
Severity: minor

Details

Reference
bz16320

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:26 PM
bzimport set Reference to bz16320.

That's not very useful for anyone who's trying to re-use this in a non English setting. I'm thinking of just stripping out the reg ex and instead matching {{{template-field}}} where template can be whichever character string a user so desires.

The regex has been changed to:
/\{\{\{([A-Za-z0-9\_\-\x{00C0}-\x{00D6}\x{00D8}-\x{00F6}\x{00F8}-\x{00FF}]+)\}\}\}/u
in r67680.

This matches all of the previous chars plus pretty much all accented latin characters. I tried experimenting with \p{L} and \w, but neither did what I was hoping. The alternative is to just open it up completely, as suggested by Tomasz. I imagine we would have to restrict it to MediaWiki-URL-valid characters, however, and I'm not sure complicated that is.

I've opened it up to extended Latin as well (r68458):
/\{\{\{([A-Za-z0-9\_\-\x{00C0}-\x{017F}]+)\}\}\}/u

That should cover pretty much all of the European languages at least, including Czech, Polish, etc.

Mormegil, does that meet your needs?

(In reply to comment #3)

Mormegil, does that meet your needs?

Actually, I do not have any “needs” regarding this bug. :-) I was just surprised to see the behavior, but the workaround of using basic Latin did not bother me too much. But yes, this solution eliminates the need for the workaround for me completely, thanks.