Page MenuHomePhabricator

linking to anchors in Special Pages, when not English
Open, LowPublic

Description

How does one link to those <a name>s we find in Special Pages?

E.g, We set $wgSpecialVersionShowHooks=true; and attempt to make a
link:

I use these great [[Special:Version#Hooks|hooks]].

Works great for English sites, but for other languages one has to
hardwire e.g., [[Special:Version#.E9.88.8E]].


Version: 1.14.x
Severity: minor

Details

Reference
bz17629

Event Timeline

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

The localized string after # can be found in the MediaWiki: namespace,
or you localized file lanugageXzz.php, and it can be called by
a reference {{int:hook}}, where "hook" is the message name:

[[Special:Version#{{int:xxxxx}}|hook]]

or:

[[{{#special:Version}}#{{int:xxxxx}}]]

if you want the link spelt out and completely localized.
This works in any language, that a user can set in his or
her preferences, or via "uselang=" on the command line.

One way to find the name to be placed behind {{int:
is to look the string up in its page, then go to
Special:Allmessage and search for the string there.
(Use copy&paste, if you browser or O/S support it)
The link anchor to the left of the string is the
message name. Make sure to check every occurrence
of the string, often there are several.

I hope, I could help.

OK thanks, I would have never figured it out myself.
I hope this is all documented somewhere.

This example works
[[{{#Special:Version}}#{{int:version-hooks}}]]
(but is a bad example to document as it is not applicable to all wikis.)

(Maybe this is all related to http://lists.wikimedia.org/pipermail/wikitech-l/2009-February/041770.html )

As noted in http://www.mediawiki.org/wiki/Help:Magic_words#Miscellaneous and Bug #14404, all one has to do is uselang=... and the link gets broken. So readers of this bug should not try [[{{#Special:Version}}#{{int:version-hooks}}]].

Well, all I know is that this is a danger area for me to stay away from when typing in my wikitext.
Probably a duplicate...

  • This bug has been marked as a duplicate of bug 14404 ***

I don't think this is a duplicate: the real issue is that special pages should have language-independent section anchors. For some special pages, such as [[Special:Watchlist/edit]], this is indeed already true, but for [[Special:Version]] it apparently isn't.

herd wrote:

Translating these anchors is probably fine, but they should only be translated for content language, not user language (like namespaces, special page names, magic words, and so forth) so that they remain site-stable.

So.. wfMsgForContent() or whatever?

Many headers having mw-version-*