r92068 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92067‎ | r92068 | r92069 >
Date:17:46, 13 July 2011
Author:robin
Status:ok (Comments)
Tags:
Comment:
(bug 15802) An easy way to look up messages: language qqx which returns the message keys
(It doesn't show up in preferences, but you can use ?uselang=qqx)

Patch by Conrad Irwin (slightly modified)
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/languages/classes/LanguageQqx.php (added) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -70,6 +70,8 @@
7171 * (bug 29680) Add GetDefaultSortkey hook to override the default sortkey.
7272 * (bug 16699) {{#language:}} accepts second parameter to specify the language in
7373 which the language name is wanted. Coverage depends on the cldr extension.
 74+* (bug 15802) An easy way to look up messages: language qqx which returns
 75+ the message keys
7476
7577 === Bug fixes in 1.19 ===
7678 * (bug 28868) Show total pages in the subtitle of an image on the
Index: trunk/phase3/languages/classes/LanguageQqx.php
@@ -0,0 +1,15 @@
 2+<?php
 3+/**
 4+ * For all translated messages, this returns the name of the message bracketed.
 5+ * This does not affect untranslated messages.
 6+ *
 7+ * NOTE: It returns a valid title, because there are some poorly written
 8+ * extentions that assume the contents of some messages are valid.
 9+ *
 10+ * @ingroup Language
 11+ */
 12+class LanguageQqx extends Language {
 13+ function getMessage( $key ) {
 14+ return "[$key]";
 15+ }
 16+}

Sign-offs

UserFlagDate
Conrad.Irwininspected18:03, 13 July 2011
Raymondtested10:21, 19 July 2011

Follow-up revisions

RevisionCommit summaryAuthorDate
r92070Follow-up r92068: svn:eol-style:native, and use round bracketrobin17:58, 13 July 2011
r92122Follow-up r92068: add 'qqx' to dummy language codes per Nikerabbitrobin23:02, 13 July 2011

Comments

#Comment by Conrad.Irwin (talk | contribs)   17:50, 13 July 2011

When I wrote this initially, I used a pipe character — I changed that to a () because it's valid in page names (things are probably less broken with square brackets than pipes, but I imagine they're more broken with square than round brackets).

#Comment by SPQRobin (talk | contribs)   17:59, 13 July 2011

That was a quick response :) I had to add svn:eol-style:native anyway (r92070), so I changed it to round brackets as well.

#Comment by Conrad.Irwin (talk | contribs)   18:02, 13 July 2011

Awesomesauce — thanks :).

#Comment by Nikerabbit (talk | contribs)   20:01, 13 July 2011

Add this into dummy language codes or how was that variable called?

#Comment by SPQRobin (talk | contribs)   23:03, 13 July 2011

Ah yes, of course :-) Done in r92122

#Comment by Nikerabbit (talk | contribs)   13:23, 20 July 2011

Something like x-messagedebug could be more user friendly. On the other hand we might not want to expose this too much to normal users unless we can guarantee it doesn't break at places.

#Comment by Conrad.Irwin (talk | contribs)   17:20, 20 July 2011

I'd be in favour of that, it's only qqx because that's what I was told was the "right thing to do"™. The original magic-value was ?uselang=none, ?uselang=x-none would avoid the namespace pollution issues.

#Comment by Church of emacs (talk | contribs)   09:19, 22 July 2011

Wow, best rev ever! This is really useful, thanks a lot! :)

#Comment by SPQRobin (talk | contribs)   19:03, 22 July 2011

Awesome that it's so useful :-)

Status & tagging log