Page MenuHomePhabricator

Add magic word(s) to get canonical name of a special page from the local one
Open, LowPublicFeature

Description

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.


Version: unspecified
Severity: enhancement
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=9040
https://bugzilla.wikimedia.org/show_bug.cgi?id=41845

Details

Reference
bz10449

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:49 PM
bzimport set Reference to bz10449.
bzimport added a subscriber: Unknown Object (MLST).

thomas.dalton wrote:

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?

attachment 10449.patch ignored as obsolete

thomas.dalton wrote:

patch to add {{CANONICALNAME}} magic word

changing magic word to more standard "canonical" not "generic"

attachment 10449-2.patch ignored as obsolete

{{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.

thomas.dalton wrote:

I'm not sure how useful CANONICALNAMESPACE (and, by extension, CANONICALFULLPAGENAME) would be, since it's a constant. It's always "Special".

(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.

thomas.dalton wrote:

Perhaps. Other pages don't have canonical names, so it would only be the namespace bit that's useful elsewhere.

nicdumz wrote:

http://www.mediawiki.org/wiki/Help:Magic_words#Miscellaneous : {{#special:userlogin}} does the trick for special pages

Is it still needed ?

@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.

Created attachment 7764
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.

attachment bug10449.patch ignored as obsolete

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.

*** Bug 28676 has been marked as a duplicate of this bug. ***

sumanah wrote:

Comment on attachment 3954
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.

sumanah wrote:

Comment on attachment 7764
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.

sumanah wrote:

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.

How does this differ from bug 9040?

(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?

(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?

(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

(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. ;-)

(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.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:01 AM