r47659 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47658‎ | r47659 | r47660 >
Date:13:52, 22 February 2009
Author:raymond
Status:deferred
Tags:
Comment:
Replace message 'abcsep' with corefunction pipeList().
Remove identical message
Kill whitespaces
Modified paths:
  • /trunk/extensions/ABC/ABC.i18n.php (modified) (history)
  • /trunk/extensions/ABC/ABC.php (modified) (history)
  • /trunk/extensions/Translate/groups/mediawiki-defines.txt (modified) (history)

Diff [purge]

Index: trunk/extensions/ABC/ABC.i18n.php
@@ -13,7 +13,6 @@
1414 $messages['en'] = array(
1515 'abcdesc' => 'Adds <tt>&lt;abc&gt;</tt> tag to format ABC music',
1616 'abcdownload' => 'Download:',
17 - 'abcsep' => '|',
1817 'abcabc' => 'ABC',
1918 'abcpdf' => 'PDF',
2019 'abcps' => 'PostScript',
@@ -55,7 +54,6 @@
5655 $messages['arz'] = array(
5756 'abcdesc' => 'يضيف وسم <tt>&lt;abc&gt;</tt> لصياغة موسيقى ABC',
5857 'abcdownload' => 'تنزيل:',
59 - 'abcsep' => '|',
6058 );
6159
6260 /** Belarusian (Taraškievica orthography) (Беларуская (тарашкевіца))
@@ -193,12 +191,6 @@
194192 $messages['he'] = array(
195193 'abcdesc' => 'הוספת תגית <tt>&lt;abc&gt;</tt> למוסיקה בפורמט ABC',
196194 'abcdownload' => 'הורדה:',
197 - 'abcsep' => '|',
198 - 'abcabc' => 'ABC',
199 - 'abcpdf' => 'PDF',
200 - 'abcps' => 'PostScript',
201 - 'abcmidi' => 'MIDI',
202 - 'abcvorbis' => 'Ogg Vorbis',
203195 );
204196
205197 /** Croatian (Hrvatski)
@@ -261,12 +253,6 @@
262254 $messages['ksh'] = array(
263255 'abcdesc' => 'Deit dä <tt>&lt;abc&gt;</tt>-Befähl en et Wiki domet mer Mussik em ABC Fommaat opschrieve kann.',
264256 'abcdownload' => 'Eronger lahde:',
265 - 'abcsep' => '|',
266 - 'abcabc' => 'ABC',
267 - 'abcpdf' => 'PDF',
268 - 'abcps' => 'PostScript',
269 - 'abcmidi' => 'MIDI',
270 - 'abcvorbis' => 'Ogg Vorbis',
271257 );
272258
273259 /** Luxembourgish (Lëtzebuergesch)
@@ -346,9 +332,6 @@
347333 $messages['oc'] = array(
348334 'abcdesc' => 'Apond una balisa <tt>&lt;abc&gt;</tt> per formatar la musica ABC',
349335 'abcdownload' => 'Telecargar :',
350 - 'abcsep' => '|',
351 - 'abcabc' => 'ABC',
352 - 'abcpdf' => 'PDF',
353336 );
354337
355338 /** Polish (Polski)
@@ -486,11 +469,6 @@
487470 $messages['tl'] = array(
488471 'abcdesc' => 'Nagdaragdag ng tatak na <tt>&lt;abc&gt;</tt> para maipormat ang tugtuging ABC',
489472 'abcdownload' => 'Ikargang-pakuha:',
490 - 'abcabc' => 'ABC',
491 - 'abcpdf' => 'PDF',
492 - 'abcps' => 'PostScript',
493 - 'abcmidi' => 'MIDI',
494 - 'abcvorbis' => 'Ogg Vorbis',
495473 );
496474
497475 /** Turkish (Türkçe)
@@ -570,4 +548,3 @@
571549 $messages['zh-hant'] = array(
572550 'abcdownload' => '下載:',
573551 );
574 -
Index: trunk/extensions/ABC/ABC.php
@@ -86,8 +86,8 @@
8787 function
8888 efABCRender($input, $args, $parser) {
8989 global $abcPath, $abcURL, $abc2midi, $abctimidity, $abcOggHandler,
90 - $abcDelayedRendering;
91 -
 90+ $abcDelayedRendering, $wgLang;
 91+
9292 if ($abcPath == false || $abcURL == false)
9393 return 'Error: $abcPath and $abcURL must be set to use the ABC extension.';
9494
@@ -100,22 +100,22 @@
101101 $float = "left";
102102 if (isset($args['float']) && $args['float'] == 'right')
103103 $float = "right";
104 -
 104+
105105 $abc = preg_replace("/^\n+/", "", $input);
106106 $hash = sha1($input);
107107 $error = "";
108 -
 108+
109109 $hashbits = array(
110110 substr($hash, 0, 2),
111111 substr($hash, 2, 2),
112112 substr($hash, 4, 2));
113113 $directory = "{$hashbits[0]}/{$hashbits[1]}/{$hashbits[2]}";
114114 $filename = "$abcPath/$directory/$hash";
115 -
 115+
116116 if (!@file_exists("$abcPath/$directory"))
117117 if (!@mkdir("$abcPath/$directory", 0777, true))
118118 return "Cannot create directory \"$abcPath/$directory\".";
119 -
 119+
120120 /*
121121 * Try to extract the title from the ABC. This is used as the
122122 * alt text for the image.
@@ -123,7 +123,7 @@
124124 $title = "Unknown song";
125125 if (preg_match("/^T:\s*(.*)$/m", $input, $matches))
126126 $title = $matches[1];
127 -
 127+
128128 if (!abcCreateABC($abc, $filename, $error))
129129 return str_replace("\n", "<br />", htmlspecialchars($error));
130130
@@ -141,7 +141,7 @@
142142 if (!abcCreateVorbis($abc, $filename, $error))
143143 return str_replace("\n", "<br />", htmlspecialchars($error));
144144 }
145 -
 145+
146146 /*
147147 * Succeeded to create all the output formats, return the
148148 * output. We produce an image from the PNG, and include
@@ -154,7 +154,7 @@
155155 $e_pdfpath = htmlspecialchars("$abcURL/$directory/$hash.pdf");
156156 $e_midipath = htmlspecialchars("$abcURL/$directory/$hash.mid");
157157 $e_vorbispath = htmlspecialchars("$abcURL/$directory/$hash.ogg");
158 -
 158+
159159 $links = array();
160160 $links[] = "<a href=\"$e_abcpath\">" . wfMsg('abcabc') . "</a>";
161161 $links[] = "<a href=\"$e_pspath\">" . wfMsg('abcps') . "</a>";
@@ -163,12 +163,11 @@
164164 $links[] = "<a href=\"$e_midipath\">" . wfMsg('abcmidi') . "</a>";
165165 if ($abctimidity)
166166 $links[] = "<a href=\"$e_vorbispath\">" . wfMsg('abcvorbis') . "</a>";
167 -
168 - $e_dllinks = wfMsg('abcdownload') . " " .
169 - join(" " . wfMsg('abcsep') . " ", $links);
170 -
 167+
 168+ $e_dllinks = wfMsg('abcdownload') . " " . $wgLang->pipeList( $links );
 169+
171170 $ogghtml = "";
172 -
 171+
173172 if ($abcOggHandler) {
174173 $oh = new OggTransformOutput(null,
175174 "$filename.ogg", false,
@@ -176,7 +175,7 @@
177176 "$filename.ogg", false);
178177 $ogghtml = $oh->toHtml(array('alt' => $title));
179178 }
180 -
 179+
181180 $output = <<<EOF
182181 <div style="float: $float; border: solid 1px #aaaaaa; margin: 0.2em;" class="abc-music">
183182 <img src="$e_imgpath" alt="$e_title" />
Index: trunk/extensions/Translate/groups/mediawiki-defines.txt
@@ -1,6 +1,6 @@
22 ABC
33 descmsg = abcdesc
4 -optional = abcsep, abcabc, abcpdf, abcps, abcmidi, abcvorbis
 4+optional = abcabc, abcpdf, abcps, abcmidi, abcvorbis
55
66 Absentee Landlord
77

Status & tagging log