Last modified: 2014-09-23 23:32:18 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 T12449, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 10449 - Add magic word(s) to get canonical name of a special page from the local one
Add magic word(s) to get canonical name of a special page from the local one
Status: NEW
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Low enhancement with 5 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
: i18n
: 28676 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-07-03 13:15 UTC by Purodha Blissenbach
Modified: 2014-09-23 23:32 UTC (History)
9 users (show)

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


Attachments
patch to add {{GENERICNAME}} magic word (1.95 KB, patch)
2007-07-30 01:20 UTC, Thomas "Tango" Dalton
Details
patch to add {{CANONICALNAME}} magic word (1.96 KB, patch)
2007-07-30 15:05 UTC, Thomas "Tango" Dalton
Details
Add second parameter C to ns, namepace, talkspace, subjectspace and special (7.81 KB, patch)
2010-10-29 21:32 UTC, Umherirrender
Details

Description Purodha Blissenbach 2007-07-03 13:15:56 UTC
See also: Bug # 10419

When used in a special page, {{PAGENAME}}, {{PAGENAMEE}}, etc., give the localized name of that page. For interwiki-linking to the corresponding special page in another language wiki of the same familiy, one would need the generic (english) page name of the special page.

While of course you can manually insert the individual generic page names into each page individually, having a general template serving many or all of them would be more convenient.

Suggested names: {{SPECIALNAME}}, {{GENERICPAGENAMEE}}, and similar.
Comment 1 Thomas "Tango" Dalton 2007-07-30 01:20:48 UTC
Created attachment 3951 [details]
patch to add {{GENERICNAME}} magic word

This should do what you want. I've never done anything with magic words before, though, so I may well have done something wrong. I haven't added a GENERICNAMEE since I'm not sure it's needed - can the canonical name of a special page contain anything that needs escaping?
Comment 2 Thomas "Tango" Dalton 2007-07-30 15:05:09 UTC
Created attachment 3954 [details]
patch to add {{CANONICALNAME}} magic word

changing magic word to more standard "canonical" not "generic"
Comment 3 Danny B. 2007-07-30 15:47:10 UTC
{{CANONICALNAME}} is confusing - is it Special, Special:Version or Version?

I'd rather suggest naming in less confusing way and create the entire set of magic words as well, since they could be useful too:

{{CANONICALFULLPAGENAME}} Special:Version
{{CANONICALNAMESPACE}} Special
{{CANONICALPAGENAME}} Version
etc.

Or use different approach, and add ":C" to related existing words on [[m:Help:Magic words#Page names and related info]] like it's used on eg. {{NUMBEROFPAGES:R}}

such as

{{FULLPAGENAME:C}} {{FULLPAGENAMEE:C}}
{{NAMESPACE:C}} {{NAMESPACEE:C}}
{{PAGENAME:C}} {{PAGENAMEE:C}}
{{SUBJECTSPACE:C}} {{SUBJECTSPACEE:C}}
{{TALKSPACE:C}} {{TALKSPACEE:C}}
etc.
Comment 4 Thomas "Tango" Dalton 2007-07-30 15:52:40 UTC
I'm not sure how useful CANONICALNAMESPACE (and, by extension, CANONICALFULLPAGENAME) would be, since it's a constant. It's always "Special".
Comment 5 Danny B. 2007-07-30 15:59:08 UTC
(In reply to comment #4)
> I'm not sure how useful CANONICALNAMESPACE (and, by extension,
> CANONICALFULLPAGENAME) would be, since it's a constant. It's always "Special".

You may want to use it elsewhere (for other namespaces), not only on special pages.
Comment 6 Thomas "Tango" Dalton 2007-07-30 16:03:37 UTC
Perhaps. Other pages don't have canonical names, so it would only be the namespace bit that's useful elsewhere.
Comment 7 Nicolas Dumazet 2008-10-19 03:25:56 UTC
http://www.mediawiki.org/wiki/Help:Magic_words#Miscellaneous : {{#special:userlogin}} does the trick for special pages

Is it still needed ?
Comment 8 Purodha Blissenbach 2009-04-07 13:05:58 UTC
@Nicolas Dumazet, {{#special:something}} does the reverse mapping of what is needed, and we want to find the canonical special page name of the page, where we are using a template, for instance. If we knew it, we could place it behind #special:, but it changes from page to page, so we have to have a magic name that tells us, what it actually is.
Comment 9 Umherirrender 2010-10-29 21:32:00 UTC
Created attachment 7764 [details]
Add second parameter C to ns, namepace, talkspace, subjectspace and special

I like the idea with a second parameter C (for canonical) for the parserfunctions.

The attached patch implements that second parameter for ns, namepace, talkspace, subjectspace and special (and each encoded variante).

It is hard to do the same for pagename, fullpagename, basepagename and subjectpagename because there is no support in Title for canonical namespace as output.

I move this to core, because there is no need for a parserfunction inside Extension Parserfunctions.
Comment 10 Gustronico 2011-07-23 00:08:45 UTC
To all English speaking users and devs:
When you go to a foreign language wiki and you don't know the local name of a particular special page, you just type {{#special:ThePageYouWant}}. And same with {{ns:}} for namespaces.

But, what about foreign users visiting a English wiki, or even a third language one? They *only* know their own-language namespaces and special pages names. How are them supposed to get the local correct page? May be they know a few canonical names, not all of them.

This functions, used in their own wikis as a previous step, will bring them those canonicals. Vote.
Comment 11 Gustronico 2011-08-29 20:21:27 UTC
*** Bug 28676 has been marked as a duplicate of this bug. ***
Comment 12 Sumana Harihareswara 2011-11-24 19:18:36 UTC
Comment on attachment 3954 [details]
patch to add {{CANONICALNAME}} magic word

Per automated testing http://lists.wikimedia.org/pipermail/wikitech-l/2011-November/056340.html patch no longer applies to MediaWiki trunk in Subversion.
Comment 13 Sumana Harihareswara 2011-11-24 19:18:55 UTC
Comment on attachment 7764 [details]
Add second parameter C to ns, namepace, talkspace, subjectspace and special

Per automated testing
http://lists.wikimedia.org/pipermail/wikitech-l/2011-November/056340.html patch
no longer applies to MediaWiki trunk in Subversion.
Comment 14 Sumana Harihareswara 2011-11-24 19:21:54 UTC
I'm sorry for the wait.  Because of the delay in reviewing these patches, MediaWiki's codebase has changed enough that they no longer apply cleanly to trunk.  I am bringing this to the attention of the parser rewrite team and the internationalisation team so they can advise on whether it would be better to update the patches submitted or to take a new approach.  Again, my regrets on the delay.
Comment 15 Nemo 2013-03-06 16:31:37 UTC
How does this differ from bug 9040?
Comment 16 Gustronico 2013-03-06 21:18:16 UTC
(In reply to comment #15)
> How does this differ from bug 9040?

They touch each other in some point, obviously.

Bug 9040 claims a way to better perform an annoying task. An annoying task that you may perform anyway. It also seems to bring a bit of facilitation to English speaking users.

This one requests a way to access to a special page in a foreign language, provided you don't know the canonical name at all. It will bring facilitation to non-English speaking users.

Again: How a polish user visiting a japanese language wiki is supposed to go to a particular special page, if *he doesn't know* its canonical name?
Comment 17 Nemo 2013-03-06 21:32:38 UTC
(In reply to comment #16)
> Again: How a polish user visiting a japanese language wiki is supposed to go
> to
> a particular special page, if *he doesn't know* its canonical name?

Special:SpecialPages?uselang=pl ? :p

Anyway, I'm clarifying the summary: it said the opposite of what intended, I think. As for namespaces, that's a different problem, although with similar issues, and is covered in bug 41845.

So the obvious question is: we already have had conflicts between different special pages with same canonical name; are we sure we won't have conflicting translations and aliases?
Comment 18 Gustronico 2013-03-07 04:40:53 UTC
(In reply to comment #17)
>Special:SpecialPages?uselang=pl ? :p

Good recursive joke. This polish user only knows Specjalna:Strony_specjalne, which doesn't work in ja wiki.

> So the obvious question is: we already have had conflicts between different
> special pages with same canonical name; are we sure we won't have conflicting
> translations and aliases?

I don't think so, because this is a in-site feature. It does not manage aliases other than local ones, retrieving the canonical, which is supposed to be universal.

Related to the "C" command. I consider that it is sufficient for this functionality to be added only to {{#special:}} and {{ns:}} functions, and not to the entire PAGENAME family. Thus, if you type in a spanish language wiki, you will get:

{{#special:LoQueEnlazaAquí|C}} → Special:Whatlinkshere
{{ns:Plantilla|C}} → Template
Comment 19 Nemo 2013-03-07 06:20:54 UTC
(In reply to comment #18)
> (In reply to comment #17)
> >Special:SpecialPages?uselang=pl ? :p
> 
> Good recursive joke. This polish user only knows Specjalna:Strony_specjalne,
> which doesn't work in ja wiki.

Doesn't matter: set pl in the preference -> "Strony specjalne" from sidebar -> bingo. ;)

> 
> > So the obvious question is: we already have had conflicts between different
> > special pages with same canonical name; are we sure we won't have conflicting
> > translations and aliases?
> 
> I don't think so, because this is a in-site feature. It does not manage
> aliases
> other than local ones, retrieving the canonical, which is supposed to be
> universal.

Ok, this should work I suppose, at least for aliases. However, it doesn't support your usecase but only the case where one has a link from their wiki.

> Related to the "C" command. I consider that it is sufficient for this
> functionality to be added only to {{#special:}} and {{ns:}} functions, and
> not
> to the entire PAGENAME family. Thus, if you type in a spanish language wiki,
> you will get:
> 
> {{#special:LoQueEnlazaAquí|C}} → Special:Whatlinkshere
> {{ns:Plantilla|C}} → Template

|R would perhaps be more consistent and yes, definitely not all PAGENAME & co., but I suggest to avoid bikeshedding and leave this to whoever decides to implement this. ;-)
Comment 20 Gustronico 2013-03-08 04:21:32 UTC
(In reply to comment #19)
> ... However, it doesn't
> support your usecase but only the case where one has a link from their wiki.

My usecase was introduced in comment 10, where I've said that this function, used in the own wiki as a previous step, will bring the needed canonicals.

Anyway, not only a link case will be supported. Remember this function will retrieve a canonical name that will serve in any wiki; so a link to a particular foreign wiki shouldn't be a good general use. If I had to, I would copy the canonical name itself and paste it in the required foreign wiki.


> Doesn't matter: set pl in the preference ->
> "Strony specjalne" from sidebar -> bingo. ;)

You win.

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


Navigation
Links