Last modified: 2014-09-24 01:28:06 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 T25006, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 23006 - create #speciale parser function
create #speciale parser function
Status: REOPENED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: need-parsertest, patch, patch-reviewed
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-03-30 15:00 UTC by Umherirrender
Modified: 2014-09-24 01:28 UTC (History)
7 users (show)

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


Attachments
add speciale parser function (1.97 KB, patch)
2010-10-29 21:48 UTC, Umherirrender
Details

Description Umherirrender 2010-03-30 15:00:59 UTC
Please create a parser function, that give the localized encoded special pagename (#special -> #speciale). There is already a parser function for namespace (ns -> nse).

This is relevant for use in the param list of fullurl, like 'Centralauth-merge-notlogged'.

Thanks.
Comment 1 Umherirrender 2010-10-29 21:48:41 UTC
Created attachment 7765 [details]
add speciale parser function

The attachment add a speciale parser function, to get the urlencode name of a special page.
Comment 2 Bawolff (Brian Wolff) 2010-10-29 21:55:34 UTC
Whats wrong with {{urlencode:{{#special:Foo}}}}. I understand the rationale behind really common variables like {{PAGENAME}} having {{PAGENAMEE}} equivelents, but for something like {{#special:}} thats barely ever used in itself, whats the point (read usecase)?
Comment 3 Umherirrender 2010-10-30 10:34:55 UTC
You are right, but urlencode replace spaces by + and that does not look like other pagenames. Yes, it works, but it is not the best, I think, because there is also a nse parser function.

Using urlencode also make the wikitext more complex, for example when using fullurl and the special pagename is part of the query.
Comment 4 Niklas Laxström 2010-10-30 10:44:07 UTC
How about {{urlencode:.|WIKI}}. Btw that should be documented in http://www.mediawiki.org/wiki/Help:Magic_words
Comment 5 Umherirrender 2010-11-02 20:38:03 UTC
(In reply to comment #4)
> How about {{urlencode:.|WIKI}}. Btw that should be documented in
> http://www.mediawiki.org/wiki/Help:Magic_words

No problem with that, but we have for many function an encoding opposite:

pagename -> pagenamee
namespace -> namespacee
fullurl -> fullurle
localurl -> localurle
ns -> nse
special -> ???
Comment 6 Krinkle 2010-11-02 23:29:13 UTC
Perhaps add a {{rawurlencode:}} (to equivalant the PHP version) that will enable this (space to _ or %20 instead of +) for not just this but also for other things. See also:
http://meta.wikimedia.org/wiki/Talk:Interwiki_map#google
Comment 7 Niklas Laxström 2010-11-03 07:03:00 UTC
(In reply to comment #6)
> Perhaps add a {{rawurlencode:}} (to equivalant the PHP version) that will
And that's {{urlencode:.|PATH}}
Comment 8 Niklas Laxström 2011-08-05 06:27:03 UTC
Patch looks fine, but I'm not convinced that we actually need this shortcut.
Comment 9 Sumana Harihareswara 2011-11-25 03:05:44 UTC
Umherirrender, can you talk more about the use case for this?  Thanks.
Comment 10 Umherirrender 2011-11-27 11:11:50 UTC
'Centralauth-merge-notlogged' has changed, so there is no need for this parser function in that message, but there can be use case where a #speciale parser function makes the template programming code easy on wiki. I have no pratical use case at the moment, but when the function exist, it will be used, I am sure.
Comment 11 Umherirrender 2012-04-05 17:24:41 UTC
patch commited with Gerrit change #4340
Comment 12 Antoine "hashar" Musso (WMF) 2012-04-06 14:23:59 UTC
Merged. Please make sure to update only documentation at www.mediawiki.org.
Comment 13 Lejonel 2012-05-20 10:34:02 UTC
How does this work with Italian and Albanian translations "#speciale" of old magic word "#special"?
Comment 14 Dan Collins 2012-05-20 14:40:58 UTC
They need to have the desired name of this function translated in their MessagesXx.php, as you can see was done with 'speciale' in the patch, attached to this bug, for MessagesEn.php.
Comment 15 Umherirrender 2012-05-20 18:31:22 UTC
You have to add new aliases to the software. You can do it on translatewiki.net

[[translatewiki:Special:AdvancedTranslate]], choose your language and "Magic words".

Looking at that page shows your problem for 'it'. The word "speciale" is already given to "special" as alias. I have no idea, to handle that case.
Comment 16 Krinkle 2012-05-20 20:56:54 UTC
For sake of portability there should be no translation value conflicting with a canonical value. Otherwise "#speciale" might mean #special on an "it" content-language wiki and #speciale on an any other content-language wiki.

Revert?
Comment 17 Umherirrender 2012-05-25 14:16:55 UTC
Canonical form wins over the aliases. So there is no problem with portability. The problem is, that existing use of #speciale (as it alias) will now act like #speciale (as canonical form). This can break thinks or not.

Maybe ask a i18n people? Feel free to revert, if you think, that a revert is the best.

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


Navigation
Links