Last modified: 2011-01-25 00:58:46 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T18320, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 16320 - Central notice field names cannot contain national characters
Central notice field names cannot contain national characters
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
CentralNotice (Other open bugs)
unspecified
All All
: Normal minor with 1 vote (vote)
: ---
Assigned To: Tomasz Finc
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-12 16:42 UTC by Mormegil
Modified: 2011-01-25 00:58 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Mormegil 2008-11-12 16:42:09 UTC
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).
Comment 1 Tomasz Finc 2008-12-15 23:34:15 UTC
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.  
Comment 2 Ryan Kaldari 2010-06-09 01:44:56 UTC
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.
Comment 3 Ryan Kaldari 2010-06-23 17:24:49 UTC
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?
Comment 4 Mormegil 2010-06-23 17:43:26 UTC
(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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links