r109341 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109340‎ | r109341 | r109342 >
Date:08:11, 18 January 2012
Author:varnent
Status:resolved (Comments)
Tags:sopa 
Comment:
localisation
Modified paths:
  • /trunk/extensions/Blackout/Blackout.i18n.php (added) (history)
  • /trunk/extensions/Blackout/Blackout.php (modified) (history)
  • /trunk/extensions/Blackout/modules (deleted) (history)
  • /trunk/extensions/Blackout/skins/ProtestSopa.php (modified) (history)
  • /trunk/extensions/Blackout/skins/SopaStrike.php (modified) (history)
  • /trunk/extensions/Blackout/skins/StopSopa.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Blackout/skins/ProtestSopa.php
@@ -12,12 +12,20 @@
1313 * to show the actual HTML output
1414 */
1515 public function execute() {
 16+ $header = wfMsg( 'blackout-protestsopa-header' );
 17+ $message1 = wfMsg( 'blackout-protestsopa-message1' );
 18+ $message2 = wfMsg( 'blackout-protestsopa-message2' );
 19+ $message3 = wfMsg( 'blackout-protestsopa-message3' );
 20+ $action = wfMsg( 'blackout-protestsopa-action' );
 21+ $actionmsg = wfMsg( 'blackout-protestsopa-actionmsg' );
 22+ $join = wfMsg( 'blackout-protestsopa-join' );
1623 ?>
1724
1825 <html>
1926 <head>
2027 <link href='http://fonts.googleapis.com/css?family=Six+Caps' rel='stylesheet' type='text/css'>
2128 <link href='http://fonts.googleapis.com/css?family=Stint+Ultra+Condensed' rel='stylesheet' type='text/css'>
 29+ <title><?php echo $header ?></title>
2230 <style>
2331 body {
2432 color: #fff;
@@ -81,19 +89,17 @@
8290 <body>
8391 <div>
8492 <hr>
85 - <p class="save">SAVE THE INTERNET.</p>
86 - <p>This site has been taken down in protest of bills currently being considered in the US
87 - House and Senate. Called <a class="bills" href="http://thomas.loc.gov/cgi-bin/bdquery/z?d112:h.r.3261:">SOPA</a> and
88 - <a class="bills" href="http://www.opencongress.org/bill/112-s968/show">PIPA</a>,<br /> these bills threaten
89 - to destroy the Internet as we know it.</p>
90 - <p>If either one passes, your favorite sites could disappear forever.</p>
 93+ <p class="save"><?php echo $header ?></p>
 94+ <p><?php echo $message1 ?>&nbsp;<a class="bills" href="http://thomas.loc.gov/cgi-bin/bdquery/z?d112:h.r.3261:">SOPA</a> &amp;
 95+ <a class="bills" href="http://www.opencongress.org/bill/112-s968/show">PIPA</a>,<br />&nbsp;<?php echo $message2 ?></p>
 96+ <p><?php echo $message3 ?></p>
9197 <hr>
9298 <a href="http://americancensorship.org/modal/call-form-moz.html">
93 - <p class="act">ACT NOW.</p>
 99+ <p class="act"><?php echo $action ?></p>
94100 </a>
95 - <p><span><a class="link" href="http://americancensorship.org/modal/call-form-moz.html">CALL YOUR SENATOR AND ASK THEM TO VOTE "NO" FOR PIPA</a></span>
 101+ <p><span><a class="link" href="http://americancensorship.org/modal/call-form-moz.html"><?php echo $actionmsg ?></a></span>
96102
97 - <span> <a class="link" href="https://github.com/SaraJo/SOPA-PIPA-Protest-Page">JOIN US</a></p>
 103+ <span> <a class="link" href="https://www.mediawiki.org/wiki/Extension:Blackout"><?php echo $join ?></a></p>
98104
99105 <div>
100106 </body>
Index: trunk/extensions/Blackout/skins/SopaStrike.php
@@ -12,15 +12,37 @@
1313 * to show the actual HTML output
1414 */
1515 public function execute() {
 16+ $title = wfMsg( 'blackout-sopastrike-title' );
 17+ $ogdesc = wfMsg( 'blackout-sopastrike-ogdesc' );
 18+ $message1 = wfMsg( 'blackout-sopastrike-message1' );
 19+ $message2 = wfMsg( 'blackout-sopastrike-message2' );
 20+ $message3 = wfMsg( 'blackout-sopastrike-message3' );
 21+ $name = wfMsg( 'allmessagesname' );
 22+ $email = wfMsg( 'email' );
 23+ $address = wfMsg( 'blackout-sopastrike-address' );
 24+ $zipcode = wfMsg( 'blackout-sopastrike-zipcode' );
 25+ $action = wfMsg( 'blackout-sopastrike-action' );
 26+ $actionmsg1 = wfMsg( 'blackout-sopastrike-actionmsg1' );
 27+ $actionmsg2 = wfMsg( 'blackout-sopastrike-actionmsg2' );
 28+ $join = wfMsg( 'blackout-sopastrike-join' );
 29+ $add = wfMsg( 'blackout-sopastrike-add' );
 30+ $learn = wfMsg( 'blackout-sopastrike-learn' );
 31+ $video = wfMsg( 'blackout-sopastrike-video' );
 32+ $orgpage = wfMsg( 'blackout-sopastrike-orgpage' );
 33+ $infographic = wfMsg( 'blackout-sopastrike-infographic' );
 34+ $ocsopa = wfMsg( 'blackout-sopastrike-ocsopa' );
 35+ $ocpipa = wfMsg( 'blackout-sopastrike-ocpipa' );
 36+ $disclaimer = wfMsg( 'blackout-sopastrike-disclaimer' );
 37+ $privacy = wfMsg( 'blackout-sopastrike-privacy' );
1638 ?>
1739
1840 <!DOCTYPE html>
1941 <html>
2042 <head>
2143 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
22 - <title>Strike Against SOPA & PIPA</title>
23 - <meta property="og:title" content="Strike Against Sopa!">
24 - <meta property="og:description" content="Internet goes on strike — blackout everywhere. On Wed Jan 18, many of your favorites sites will be unavailable to you to stop web censorship. Call your congressperson today.">
 44+ <title><?php echo $title ?></title>
 45+ <meta property="og:title" content="<?php echo $title ?>">
 46+ <meta property="og:description" content="<?php echo $ogdesc ?>">
2547 <meta property="og:image" content="http://sopastrike.com/images/newspaper-folded.jpg">
2648 <meta property="og:url" content="http://sopastrike.com/strike">
2749 <link rel="stylesheet" type="text/css" href="http://sopastrike.com/strike/strike.css">
@@ -32,34 +54,33 @@
3355 <div id="strike-wrapper">
3456 <div>
3557 <img src="http://sopastrike.com/strike/strike-paper.jpg" width="570" height="350" id="paper">
36 - <h1>Today, we are striking against censorship. <strong>Join us in this historic moment:</strong> tell Congress to stop this bill now!</h1>
 58+ <h1><?php echo $message1 ?>&nbsp;<strong><?php echo $message2 ?></strong>&nbsp;<?php echo $message3 ?></h1>
3759 </div>
3860 <form action="http://act.fightforthefuture.org/page/s/sopa-strike-modal" method="post">
3961 <div id="info">
40 - <input size="16" id="firstname" name="firstname" type="text" placeholder="Name">
41 - <input type="email" class="text" size="48" id="email" name="email" placeholder="Email">
42 -
43 - <input size="48" id="addr1" name="addr1" type="text" placeholder="Address">
44 - <input size="5" id="zip" name="zip" type="text" placeholder="Zipcode">
45 - <button type="submit"><span>Write Congress Now!</span></button>
 62+ <input size="16" id="firstname" name="firstname" type="text" placeholder="<?php echo $name ?>">
 63+ <input type="email" class="text" size="48" id="email" name="email" placeholder="<?php echo $email ?>">
 64+ <input size="48" id="addr1" name="addr1" type="text" placeholder="<?php echo $address ?>">
 65+ <input size="5" id="zip" name="zip" type="text" placeholder="<?php echo $zipcode ?>">
 66+ <button type="submit"><span><?php echo $action ?></span></button>
4667 </div>
4768 <div id="letter">
48 - <textarea id="custom-285" name="custom-285">I am writing to you as a voter in your district. I urge you to oppose the Senate version of S. 968, the PROTECT IP Act. The PROTECT IP Act is dangerous, ineffective, and short-sighted. The House version -- just introduced by Rep. Goodlatte -- is far worse.
 69+ <textarea id="custom-285" name="custom-285"><?php echo $actionmsg1 ?>
4970
50 - Over coming days you'll be hearing from the many businesses, advocacy organizations, and ordinary Americans who oppose this legislation because of the myriad ways in which it will stifle free speech and innovation. We hope you'll take our concerns to heart and oppose this legislation.
 71+ <?php echo $actionmsg2 ?>
5172 </textarea>
5273 </div>
5374
5475 </form>
5576
56 - <h1><a href="http://sopastrike.com/">Join The Strike!</a> and <a href="https://www.mediawiki.org/wiki/Extension:Blackout">add this to your site</a></h1>
57 - <p><strong>Learn More:</strong>
58 - <a href="http://fightforthefuture.org/pipa">Watch the video</a> &middot;
59 - <a href="http://americancensorship.org/">American Censorship page</a> &middot;
60 - <a href="http://americancensorship.org/infographic.html">View the Infographic</a> <br>
61 - <a href="http://www.opencongress.org/bill/112-h3261/show">Read SOPA on OpenCongress</a> &middot;
62 - <a href="http://www.opencongress.org/bill/112-s968/show">Read PIPA on OpenCongress</a>
63 - <p>Fight For The Future may contact you about future campaigns. <br>We will never share your email with anyone. <a href="http://fightforthefuture.org/privacy">Privacy Policy</a></p>
 77+ <h1><a href="http://sopastrike.com/"><?php echo $join ?></a> &amp; <a href="https://www.mediawiki.org/wiki/Extension:Blackout"><?php echo $add ?></a></h1>
 78+ <p><strong><?php echo $learn ?></strong>
 79+ <a href="http://fightforthefuture.org/pipa"><?php echo $video ?></a> &middot;
 80+ <a href="http://americancensorship.org/"><?php echo $orgpage ?></a> &middot;
 81+ <a href="http://americancensorship.org/infographic.html"><?php echo $infographic ?></a> <br>
 82+ <a href="http://www.opencongress.org/bill/112-h3261/show"><?php echo $ocsopa ?></a> &middot;
 83+ <a href="http://www.opencongress.org/bill/112-s968/show"><?php echo $ocpipa ?></a>
 84+ <p><?php echo $disclaimer ?>&nbsp;<a href="http://fightforthefuture.org/privacy"><?php echo $privacy ?></a><br/>&nbsp;</p>
6485 </div>
6586 </body>
6687 </html>
Index: trunk/extensions/Blackout/skins/StopSopa.php
@@ -12,6 +12,8 @@
1313 * to show the actual HTML output
1414 */
1515 public function execute() {
 16+ $header = wfMsgExt( 'blackout-stopsopa-header' );
 17+ $message = wfMsgExt( 'blackout-stopsopa-message' );
1618 ?>
1719
1820 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
@@ -21,7 +23,7 @@
2224
2325 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
2426
25 - <title>STOP SOPA!</title>
 27+ <title><?php echo $header ?></title>
2628
2729 <style type="text/css" media="all">
2830 html,
@@ -143,12 +145,12 @@
144146
145147 <div id="text-shadow-box">
146148 <div id="tsb-box"></div>
147 - <p id="tsb-text">STOP SOPA!</p>
148 - <p id="tsb-link"><a href="http://americancensorship.org/">STOP SOPA!</a></p>
 149+ <p id="tsb-text"><?php $header ?></p>
 150+ <p id="tsb-link"><a href="http://americancensorship.org/"><?php echo $header ?></a></p>
149151 <div id="tsb-wall">
150152 <div id="tsb-ie"></div>
151153
152 - <p>This site has gone dark today in protest of the U.S. Stop Online Piracy Act (SOPA) and PROTECT-IP Act (PIPA). The U.S. Congress is about to censor the Internet, even though the vast majority of Americans are opposed. We need to kill these bills to protect our rights to free speech, privacy, and prosperity. Learn more at <a href="http://americancensorship.org/">AmericanCensorship.org</a></p>
 154+ <p><?php echo $message ?>&nbsp;<a href="http://americancensorship.org/">AmericanCensorship.org</a></p>
153155 </div>
154156 <div id="tsb-spot"></div>
155157 </div>
Index: trunk/extensions/Blackout/Blackout.i18n.php
@@ -0,0 +1,57 @@
 2+<?php
 3+/**
 4+ * Internationalisation file for extension Blackout
 5+ *
 6+ * @addtogroup Extensions
 7+ * @license GPL
 8+ */
 9+
 10+$messages = array();
 11+
 12+/** English
 13+ * @author Gregory Varnum
 14+ */
 15+$messages['en'] = array(
 16+ 'blackout-desc' => 'For use during blackouts in protest to SOPA/PIPA and Internet censorship',
 17+ 'blackout-stopsopa-header' => 'STOP SOPA!',
 18+ 'blackout-stopsopa-message' => 'This site has gone dark today in protest of the U.S. Stop Online Piracy Act (SOPA) and PROTECT-IP Act (PIPA). The U.S. Congress is about to censor the Internet, even though the vast majority of Americans are opposed. We need to kill these bills to protect our rights to free speech, privacy, and prosperity. Learn more at',
 19+ 'blackout-protestsopa-header' => 'SAVE THE INTERNET.',
 20+ 'blackout-protestsopa-message1' => 'This site has been taken down in protest of bills currently being considered in the US House and Senate. Called',
 21+ 'blackout-protestsopa-message2' => 'these bills threaten to destroy the Internet as we know it.',
 22+ 'blackout-protestsopa-message3' => 'If either one passes, your favorite sites could disappear forever.',
 23+ 'blackout-protestsopa-action' => 'ACT NOW.',
 24+ 'blackout-protestsopa-actionmsg' => 'CALL YOUR SENATOR AND ASK THEM TO VOTE "NO" FOR PIPA',
 25+ 'blackout-protestsopa-join' => 'JOIN US',
 26+ 'blackout-sopastrike-title' => 'Strike Against SOPA and PIPA!',
 27+ 'blackout-sopastrike-ogdesc' => 'Internet goes on strike — blackout everywhere. Today, many of your favorite sites will be unavailable to you in an effort to stop web censorship. Call your congressperson today.',
 28+ 'blackout-sopastrike-message1' => 'Today, we are striking against censorship.',
 29+ 'blackout-sopastrike-message2' => 'Join us in this historic moment:',
 30+ 'blackout-sopastrike-message3' => 'tell Congress to stop this bill now!',
 31+ 'blackout-sopastrike-address' => 'Address',
 32+ 'blackout-sopastrike-zipcode' => 'Zip code',
 33+ 'blackout-sopastrike-action' => 'Write Congress Now!',
 34+ 'blackout-sopastrike-actionmsg1' => 'I am writing to you as a voter in your district. I urge you to oppose the Senate version of S. 968, the PROTECT IP Act. The PROTECT IP Act is dangerous, ineffective, and short-sighted. The House version -- just introduced by Rep. Goodlatte -- is far worse.',
 35+ 'blackout-sopastrike-actionmsg2' => 'Over coming days you will be hearing from the many businesses, advocacy organizations, and ordinary Americans who oppose this legislation because of the myriad ways in which it will stifle free speech and innovation. We hope you will take our concerns to heart and oppose this legislation.',
 36+ 'blackout-sopastrike-join' => 'Join The Strike!',
 37+ 'blackout-sopastrike-add' => 'add this to your site',
 38+ 'blackout-sopastrike-learn' => 'Learn More:',
 39+ 'blackout-sopastrike-video' => 'Watch the video',
 40+ 'blackout-sopastrike-orgpage' => 'American Censorship page',
 41+ 'blackout-sopastrike-infographic' => 'View the Infographic',
 42+ 'blackout-sopastrike-ocsopa' => 'Read SOPA on OpenCongress',
 43+ 'blackout-sopastrike-ocpipa' => 'Read PIPA on OpenCongress',
 44+ 'blackout-sopastrike-disclaimer' => 'Fight For The Future may contact you about future campaigns. We will never share your email with anyone.',
 45+ 'blackout-sopastrike-privacy' => 'Privacy Policy',
 46+
 47+
 48+);
 49+
 50+/** Message documentation (Message documentation)
 51+ * @author Gregory Varnum
 52+ */
 53+$messages['qqq'] = array(
 54+ 'blackout-desc' => '{{desc}}',
 55+ 'blackout-stopsopa-header' => 'Header used on StopSopa skin',
 56+ 'blackout-stopsopa-message' => 'Message used on StopSopa skin',
 57+);
 58+
Property changes on: trunk/extensions/Blackout/Blackout.i18n.php
___________________________________________________________________
Added: svn:eol-style
159 + native
Index: trunk/extensions/Blackout/Blackout.php
@@ -5,10 +5,11 @@
66 * https://www.mediawiki.org/wiki/Extension:Blackout
77 *
88 * @addtogroup Extensions
9 - * @author Gregory Varnum utilizing work by jorm and MediaWiki developers for the Wikimedia Foundation's SOPA/PIPA protest
 9+ * @author John Du Hart and Gregory Varnum utilizing work by jorm and MediaWiki developers for the Wikimedia Foundation's SOPA/PIPA protest
1010 * @license GPL
1111 *
1212 * Thank you to *** for feedback, bug reporting and cleaning up code
 13+ * Thank you to Raymond and others mentioned in TweetANew.i18n.php for translation work
1314 *
1415 */
1516
@@ -32,7 +33,7 @@
3334 * $wgBlackout['Skin']
3435 * - Change the blackout skin
3536 * * ProtestSopa (Default)
36 - * * SopStrike
 37+ * * SopaStrike
3738 * * StopSopa
3839 *
3940 * $wgBlackout['Whitelist'][]
@@ -56,6 +57,7 @@
5758 $dir = dirname(__FILE__) . '/';
5859
5960 $wgAutoloadClasses['Blackout'] = $dir . 'Blackout.body.php';
 61+$wgExtensionMessagesFiles['Blackout'] = $dir . 'Blackout.i18n.php';
6062
6163 $skinDir = $dir . 'skins/';
6264 $wgAutoloadClasses['SkinProtestSopa'] = $skinDir . 'ProtestSopa.php';
@@ -67,9 +69,9 @@
6870 */
6971 $wgExtensionCredits['other'][] = array(
7072 'name' => 'Blackout',
71 - 'version' => '1.0.20120117',
72 - 'author' => array('[https://www.mediawiki.org/wiki/User:Varnent Gregory Varnum]', 'John Du Hart', '...'),
73 - 'description' => 'For use during blackouts in protest to SOPA/PIPA and Internet censorship.',
 73+ 'version' => '1.0.20120118',
 74+ 'author' => array('[https://www.mediawiki.org/wiki/User:Johnduhart John Du Hart]', '[https://www.mediawiki.org/wiki/User:Varnent Gregory Varnum]', '...'),
 75+ 'descriptionmsg' => 'blackout-desc',
7476 'url' => 'https://www.mediawiki.org/wiki/Extension:Blackout',
7577 );
7678

Follow-up revisions

RevisionCommit summaryAuthorDate
r109805Outputs escaped per r109341varnent03:22, 23 January 2012
r109858Fix for r109805, r109341: properly escape messagesdemon22:24, 23 January 2012

Comments

#Comment by Nikerabbit (talk | contribs)   10:52, 18 January 2012

Output should be escaped.

Status & tagging log