Page MenuHomePhabricator

An easy way for admins to look up messages
Closed, ResolvedPublic

Description

Author: conrad.irwin

Description:
When looking at a page it's often impossible to tell which bit of text is coming from where. Special:AllMessages solves this problem to some extent, but it is still hard to tell which message you are looking for and the number of messages there is ever-increasing.

I've linked to the contents of a new language to be put in 'languages/classes/LanguageNone.php', this will allow admins to append ?uselang=none to the url, and then see instantly which messages are responsible for what.


Version: unspecified
Severity: enhancement
URL: http://rafb.net/p/AEYVcA33.html

Details

Reference
bz15802

Event Timeline

bzimport raised the priority of this task from to High.Nov 21 2014, 10:20 PM
bzimport set Reference to bz15802.

Messages are used for much more than... plain messages. Having a messages file that doesn't automatically stay in sync is not the way.

conrad.irwin wrote:

Sorry, I should have included the file here. This does automatically stay in sync - as it just echo's the name of the requested message. It leads to a little bit of ugliness in places - but I've found it very useful even so.

LanguageNone.php=<<<EOF
<?php

class LanguageNone extends Language {

function getMessage($key){
    return "|Mediawiki:$key|";
}

}

?>
EOF

You should really attach the patch to this bug, as the pastebin URL you provided has long since expired.

conrad.irwin wrote:

The php class

Hehe, I know. I was looking for the add attachment button an hour ago, but couldn't see it....

Voici!

attachment LanguageNone.php ignored as obsolete

conrad.irwin wrote:

This would be particularly nice now that you can't just grep Special:AllMessages.

conrad.irwin wrote:

updated patch

Update patch to add comments, and correct style, and to return a valid page name.

attachment PATCH.language_none ignored as obsolete

happy.melon.wiki wrote:

this should be a valid ISO language code, in the "reserved" section /qq[a-z]/. Our message descriptions are at "qqq"; maybe "qqx" would be appropriate for this.

Also, there should be some way to find out what parameters are being passed to the message.

(In reply to comment #7)

this should be a valid ISO language code, in the "reserved" section /qq[a-z]/.
Our message descriptions are at "qqq"; maybe "qqx" would be appropriate for
this.

Or x-something. I think Tim would have preferred x-doc instead of qqq.

And it's just not some extensions, the core dies too if it gets invalid title, notably on Special:Preferences.

happy.melon.wiki wrote:

(In reply to comment #8)

(In reply to comment #7)

this should be a valid ISO language code, in the "reserved" section /qq[a-z]/.
Our message descriptions are at "qqq"; maybe "qqx" would be appropriate for
this.

Or x-something. I think Tim would have preferred x-doc instead of qqq.

Maybe that's what we'd have done with hindsight, but given that the chances of qqq ever being moved to x-doc are essentially zero, creating inconsistency purely for the sake of having one at a more convenient title is not worth it. It's not *wrong* for them to be in the "qq-" range, but it *would* be wrong for them to be needlessly inconsistent. Plus that range has been *explicitly* reserved, so we're covered for the future.

And it's just not some extensions, the core dies too if it gets invalid title,
notably on Special:Preferences.

I think watching what falls apart when bad assumptions are made about input integrity, and then fixing them, would be a valuable exercise in its own right.

conrad.irwin wrote:

use Qqx

Use qqx instead of none.

Fixing it to display the value of the parameters would require special treatment in wfMsgReplaceArgs. The partial solution I use on en.wiktionary is to transclude {{int:{{PAGENAME}}/qqq}] in http://en.wiktionary.org/wiki/MediaWiki:Editinginterface - though this will only work for English sites (unless we have to translate all the documentation too).

Attached:

*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*

Patch applied in r92068. Slightly modified to return [message-name] instead of (MediaWiki:message-name).