From 36f42c9b155ba66bac89ef639cdac7939cff0102 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Mon, 17 Nov 2008 21:27:00 +0000 Subject: [PATCH] (bug 44) Rename Image namespace to File. Based on a patch by brion. * Parser tests updated. 14 failing parser tests before the change, added one, and the same 14 failing parser tests are remaining * added namespace aliases for Image and Image_talk for backward compatibility purposes --- RELEASE-NOTES | 11 ++-- includes/Namespace.php | 4 +- languages/messages/MessagesEn.php | 9 ++-- maintenance/parserTests.txt | 87 +++++++++++++++++-------------- 4 files changed, 63 insertions(+), 48 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 50bc7d20d3..a77862b78c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -60,6 +60,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN on the user's real name if one is set. Defaults to false (use the username) * Removed the 'apiThumbCacheDir' option from $wgForeignFileRepos (only used in ForeignAPIRepo) +* Image namespace and accompanying talk namespace renamed to File. For backward + compatibility purposes, Image still works. External tools may need to be + updated. === Migrated extensions === The following extensions are migrated into MediaWiki 1.14: @@ -197,8 +200,8 @@ The following extensions are migrated into MediaWiki 1.14: * (bug 16113) Show/hide for redirects in Special:NewPages * (bug 15903) Upload link was added to Nostalgia skin * (bug 15761) Add user toggle to omit diff after rollback -* Added the BitmapHandler_ClientOnly media handler, which allows server-side - image scaling to be completely disabled for specific media types, via the +* Added the BitmapHandler_ClientOnly media handler, which allows server-side + image scaling to be completely disabled for specific media types, via the $wgMediaHandlers configuration variable. * New 'AbortDiffCache' hook can be used to cancel the caching of a diff * (bug 15835) Added Content-Style-Type meta tag @@ -336,11 +339,11 @@ The following extensions are migrated into MediaWiki 1.14: search box * (bug 4362) [[MediaWiki:History copyright]] no more used with most recent revision when passing oldid parameter in the url -* (bug 16265) When caching thumbs with the ForeignApiRepo, we now use the same +* (bug 16265) When caching thumbs with the ForeignApiRepo, we now use the same filename as the remote site. * (bug 8345) Don't autosummarize where a redirect was left unchanged * Made thumb caching in ForeignApiFile objects integrated with normal thumb - path naming (/thumbs/hash/file), retired 'apiThumbCacheDir' as a result. + path naming (/thumbs/hash/file), retired 'apiThumbCacheDir' as a result. * (bug 5530) Consistency between character encoding in {{PAGENAMEE}}, {{SUBPAGENAMEE}} and {{FULLPAGENAMEE}} * API siteinfo query no longer throws an exception for empty sifilter parameter. diff --git a/includes/Namespace.php b/includes/Namespace.php index 7c7b7dedd3..e310a96209 100644 --- a/includes/Namespace.php +++ b/includes/Namespace.php @@ -16,8 +16,8 @@ $wgCanonicalNamespaceNames = array( NS_USER_TALK => 'User_talk', NS_PROJECT => 'Project', NS_PROJECT_TALK => 'Project_talk', - NS_IMAGE => 'Image', - NS_IMAGE_TALK => 'Image_talk', + NS_IMAGE => 'File', + NS_IMAGE_TALK => 'File_talk', NS_MEDIAWIKI => 'MediaWiki', NS_MEDIAWIKI_TALK => 'MediaWiki_talk', NS_TEMPLATE => 'Template', diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 312bcd4535..124879b350 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -86,8 +86,8 @@ $namespaceNames = array( NS_USER_TALK => 'User_talk', # NS_PROJECT set by $wgMetaNamespace NS_PROJECT_TALK => '$1_talk', - NS_IMAGE => 'Image', - NS_IMAGE_TALK => 'Image_talk', + NS_IMAGE => 'File', + NS_IMAGE_TALK => 'File_talk', NS_MEDIAWIKI => 'MediaWiki', NS_MEDIAWIKI_TALK => 'MediaWiki_talk', NS_TEMPLATE => 'Template', @@ -101,7 +101,10 @@ $namespaceNames = array( /** * Array of namespace aliases, mapping from name to NS_xxx index */ -$namespaceAliases = array(); +$namespaceAliases = array( + 'Image' => NS_IMAGE, + 'Image_talk' => NS_IMAGE_TALK, +); /** * Skin names. If any key is not specified, the English one will be used. diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index 06242c5b9a..a81ba9595f 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -2335,7 +2335,7 @@ Template with thumb image (with link in description) {{paramtest| param =[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]}} !! result -This is a test template with parameter
+This is a test template with parameter
!! end @@ -3072,7 +3072,7 @@ Simple image !! input [[Image:foobar.jpg]] !! result -

Image:foobar.jpg +

Image:foobar.jpg

!! end @@ -3081,16 +3081,25 @@ Right-aligned image !! input [[Image:foobar.jpg|right]] !! result -
+
!! end +!! test +Simple image (using File: namespace, now canonical) +!! input +[[File:foobar.jpg]] +!! result +

File:foobar.jpg +

+!! end + !! test Image with caption !! input [[Image:foobar.jpg|right|Caption text]] !! result -
Caption text
+
Caption text
!! end @@ -3128,7 +3137,7 @@ Image with frame and link !! input [[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]]] !! result -
This is a test image Main Page
+
This is a test image Main Page
!! end @@ -3137,7 +3146,7 @@ Image with frame and link and explicit alt !! input [[Image:Foobar.jpg|frame|left|This is a test image [[Main Page]]|alt=Altitude]] !! result -
Altitude
This is a test image Main Page
+
Altitude
This is a test image Main Page
!! end @@ -3146,7 +3155,7 @@ Image with wiki markup in implicit alt !! input [[Image:Foobar.jpg|testing '''bold''' in alt]] !! result -

testing bold in alt +

testing bold in alt

!! end @@ -3155,18 +3164,18 @@ Image with wiki markup in explicit alt !! input [[Image:Foobar.jpg|alt=testing '''bold''' in alt]] !! result -

testing bold in alt +

testing bold in alt

!! end !! test Link to image page- image page normally doesn't exists, hence edit link Add test with existing image page -#

Image:test +#

Image:test !! input [[:Image:test]] !! result -

Image:test +

Image:test

!! end @@ -3175,7 +3184,7 @@ Frameless image caption with a free URL !! input [[Image:foobar.jpg|http://example.com]] !! result -

http://example.com +

http://example.com

!! end @@ -3184,7 +3193,7 @@ Thumbnail image caption with a free URL !! input [[Image:foobar.jpg|thumb|http://example.com]] !! result -
+
!! end @@ -3193,7 +3202,7 @@ Thumbnail image caption with a free URL and explicit alt !! input [[Image:foobar.jpg|thumb|http://example.com|alt=Alteration]] !! result -
+
!! end @@ -3202,7 +3211,7 @@ BUG 1887: A ISBN with a thumbnail !! input [[Image:foobar.jpg|thumb|ISBN 1235467890]] !! result -
+
!! end @@ -3211,7 +3220,7 @@ BUG 1887: A RFC with a thumbnail !! input [[Image:foobar.jpg|thumb|This is RFC 12354]] !! result -
This is RFC 12354
+
This is RFC 12354
!! end @@ -3220,7 +3229,7 @@ BUG 1887: A mailto link with a thumbnail !! input [[Image:foobar.jpg|thumb|Please mailto:nobody@example.com]] !! result -
+
!! end @@ -3230,7 +3239,7 @@ so math is not stripped and turns up as escaped <math> tags. !! input [[Image:foobar.jpg|thumb|2+2]] !! result -
<math>2+2</math>
+
<math>2+2</math>
!! end @@ -3241,7 +3250,7 @@ math !! input [[Image:foobar.jpg|thumb|2+2]] !! result -
2 + 2
+
2 + 2
!! end @@ -3251,7 +3260,7 @@ BUG 648: Frameless image caption with a link !! input [[Image:foobar.jpg|text with a [[link]] in it]] !! result -

text with a link in it +

text with a link in it

!! end @@ -3260,7 +3269,7 @@ BUG 648: Frameless image caption with a link (suffix) !! input [[Image:foobar.jpg|text with a [[link]]foo in it]] !! result -

text with a linkfoo in it +

text with a linkfoo in it

!! end @@ -3269,7 +3278,7 @@ BUG 648: Frameless image caption with an interwiki link !! input [[Image:foobar.jpg|text with a [[MeatBall:Link]] in it]] !! result -

text with a MeatBall:Link in it +

text with a MeatBall:Link in it

!! end @@ -3278,7 +3287,7 @@ BUG 648: Frameless image caption with a piped interwiki link !! input [[Image:foobar.jpg|text with a [[MeatBall:Link|link]] in it]] !! result -

text with a link in it +

text with a link in it

!! end @@ -3287,7 +3296,7 @@ Escape HTML special chars in image alt text !! input [[Image:foobar.jpg|& < > "]] !! result -

& < > " +

& < > "

!! end @@ -3296,7 +3305,7 @@ BUG 499: Alt text should have Ӓ, not &1234; !! input [[Image:foobar.jpg|♀]] !! result -

♀ +

♀

!! end @@ -3314,7 +3323,7 @@ Image caption containing another image !! input [[Image:Foobar.jpg|thumb|This is a caption with another [[Image:icon.png|image]] inside it!]] !! result -
This is a caption with another Image:Icon.png inside it!
+
This is a caption with another File:Icon.png inside it!
!! end @@ -3324,7 +3333,7 @@ Image caption containing a newline [[Image:Foobar.jpg|This *is some text]] !! result -

This *is some text +

This *is some text

!!end @@ -3334,7 +3343,7 @@ Bug 3090: External links other than http: in image captions !! input [[Image:Foobar.jpg|thumb|200px|This caption has [irc://example.net irc] and [https://example.com Secure] ext links in it.]] !! result -
This caption has irc and Secure ext links in it.
+
This caption has irc and Secure ext links in it.
!! end @@ -3737,7 +3746,7 @@ BUG 1219 URL next to image (good) !! input http://example.com [[Image:foobar.jpg]] !! result -

http://example.com Image:foobar.jpg +

http://example.com Image:foobar.jpg

!!end @@ -3746,7 +3755,7 @@ BUG 1219 URL next to image (broken) !! input http://example.com[[Image:foobar.jpg]] !! result -

http://example.comImage:foobar.jpg +

http://example.comImage:foobar.jpg

!!end @@ -3932,7 +3941,7 @@ Image link to nonexistent file (bug 1850 - good) !! input [[Image:No such.jpg]] !! result -

Image:No such.jpg +

File:No such.jpg

!! end @@ -3941,7 +3950,7 @@ Image link to nonexistent file (bug 1850 - good) !! input [[:Image:No such.jpg]] !! result -

Image:No such.jpg +

Image:No such.jpg

!! end @@ -6254,7 +6263,7 @@ Centre-aligned image !! input [[Image:foobar.jpg|centre]] !! result -
+
!!end @@ -6263,7 +6272,7 @@ None-aligned image !! input [[Image:foobar.jpg|none]] !! result -
+
!!end @@ -6272,7 +6281,7 @@ Width + Height sized image (using px) (height is ignored) !! input [[Image:foobar.jpg|640x480px]] !! result -

+

!!end @@ -6281,7 +6290,7 @@ Width-sized image (using px, no following whitespace) !! input [[Image:foobar.jpg|640px]] !! result -

+

!!end @@ -6290,7 +6299,7 @@ Width-sized image (using px, with following whitespace - test regression from r3 !! input [[Image:foobar.jpg|640px ]] !! result -

+

!!end @@ -6299,7 +6308,7 @@ Width-sized image (using px, with preceding whitespace - test regression from r3 !! input [[Image:foobar.jpg| 640px]] !! result -

+

!!end @@ -6337,7 +6346,7 @@ Images with the "|" character in the comment !! input [[image:Foobar.jpg|thumb|An [http://test/?param1=|left|¶m2=|x external] URL]] !! result -
An external URL
An external URL
+
An external URL
An external URL
!!end @@ -7151,7 +7160,7 @@ Free external link invading image caption !! input [[Image:Foobar.jpg|thumb|http://x|hello]] !! result -
hello
+
hello
!! end -- 2.20.1