r66106 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66105‎ | r66106 | r66107 >
Date:13:52, 9 May 2010
Author:svip
Status:resolved
Tags:
Comment:
Follow up/fix to r66057, hopefully this suffice greatly regarding the spaces between strings and such. No beginning or trailing spaces.
Modified paths:
  • /trunk/extensions/TemplateAdventures/TemplateAdventures.i18n.php (modified) (history)
  • /trunk/extensions/TemplateAdventures/Templates/Citation.php (modified) (history)

Diff [purge]

Index: trunk/extensions/TemplateAdventures/TemplateAdventures.i18n.php
@@ -4,26 +4,48 @@
55
66 /** English */
77 $messages['en'] = array (
8 - 'ta-etal' => " ''et al''.",
9 - 'ta-citeauthordate' => ' ($1)',
10 - 'ta-citeauthoryearnote' => ' [$1]',
11 - 'ta-editorsplural' => ', eds',
12 - 'ta-editorssingular' => ', ed',
13 - 'ta-pubmed-url' => 'http://www.pubmedcentral.nih.gov/articlerender.fcgi?tool=pmcentrez&artid=$1',
14 - 'ta-transtitle-render' => '[$1]',
15 - 'ta-writtenat' => 'written at $1',
16 - 'ta-inlanguage' => ' (in $1)',
17 - 'ta-formatrender' => ' ($1)',
18 - 'ta-publicationplaceandpublisher' => ' ($1: $2)',
19 - 'ta-publicationplace' => ' ($1)',
20 - 'ta-volumerender' => " '''$1'''",
21 - 'ta-issuerender' => ' ($1)',
22 - 'ta-atrender' => ': $1',
23 - 'ta-titletyperender' => ' ($1)',
24 - 'ta-publisherrender' => ' $1',
25 - 'ta-published' => ' (published $1)',
26 -
27 - 'ta-printonlyspan' => '<span class="printonly">$1</span>',
28 - 'ta-accessdatespan' => '<span class="reference-accessdate">$1</span>',
 8+ # citation separators
 9+ 'ta-citesep-section' => ',', # separator between sections
 10+ 'ta-citesep-name' => ',&#32;', # separator between surname and givenname
 11+ 'ta-citesep-author' => '&#059;&#32;', # separator between authors
 12+ 'ta-citesep-authorlast' => '&#32;&amp;&#32;', # last separator between authors
 13+ 'ta-citesep-beforepublication' => ':', # separator between periodical
 14+ # and publication
 15+
 16+ # citation messages
 17+ 'ta-citeetal' => "$1 ''et al''.", # $1 = list of authors
 18+ 'ta-citecoauthors' => '$1$2 $3' # $1 = authors, $2 = separator
 19+ 'ta-citeauthordate' => '$1 ($2)', # $1 = authors or separator
 20+ 'ta-citeauthoryearnote' => '$1 [$2]', # $1 = date
 21+ 'ta-citeeditorsplural' => '$1, eds', # $1 = editors
 22+ 'ta-citeeditorssingular' => '$1, ed', # $1 = editor
 23+ 'ta-includedworktitle' => "''$1''",
 24+ 'ta-citepubmed-url' => 'http://www.pubmedcentral.nih.gov/articlerender.fcgi?tool=pmcentrez&artid=$1',
 25+ 'ta-citetranstitle-render' => '&#91;$1&#93;',
 26+ 'ta-citewrittenat' => '$1 written at $2', # $1 = separator
 27+ 'ta-citeother' => '$1 $2', # $1 = separator
 28+ 'ta-citeinlanguage' => '$1 (in $2)', # $1 = title/link
 29+ 'ta-citeformatrender' => '$1 ($2)', # $1 = title/link
 30+ 'ta-citeperiodical' => "''$1''",
 31+ 'ta-citeperiodicaltitle' => "''$1''",
 32+ 'ta-series' => '$1 $2', # $1 = separator
 33+ 'ta-citepublicationplaceandpublisher' => '$1 ($2: $3)', # $1 = separator
 34+ 'ta-citepublicationplace' => '$1 ($2)', # $1 = separator
 35+ 'ta-citevolumerender' => "$1 '''$2'''", # $1 = separator
 36+ 'ta-citeissuerender' => '$1 ($2)', # $1 = volume
 37+ 'ta-citeatrender' => '$1: $2', # $1 = title info
 38+ 'ta-citeatseparated' => '$1 $2', # $1 = separator
 39+ 'ta-citetitletyperender' => '$1 ($2)', # $1 = title/link
 40+ 'ta-citepublisherrender' => '$1 $2', # $1 = separator
 41+ 'ta-citepublished' => '$1 (published $2)', # $1 = title/link
 42+ 'ta-citeeditionrender' => '$1',
 43+ 'ta-citepublication' => '$1 $2', # $1 = separator
 44+ 'ta-citepublicationdate' => '$1 $2', # $1 = separator
 45+ 'ta-citeretrievedupper' => '$1 Retrieved $2' # $1 = separator
 46+ 'ta-citeretrievedlower' => '$1 retrieved $2' # $1 = separator
 47+
 48+ # citation span messages
 49+ 'ta-citeprintonlyspan' => '<span class="printonly">$1</span>',
 50+ 'ta-citeaccessdatespan' => '<span class="reference-accessdate">$1</span>',
2951 );
3052
Index: trunk/extensions/TemplateAdventures/Templates/Citation.php
@@ -3,11 +3,11 @@
44 class Citation extends TemplateAdventureBasic {
55
66 private $dSeparators = array( # separators between names, items, etc.
7 - 'section' => ',',
8 - 'regular' => ',&#32;',
9 - 'author' => '&#059;&#32;',
10 - 'name' => ',&#32;',
11 - 'ampersand' => '&#32;&amp;&#32;',
 7+ 'section' => ',',
 8+ 'author' => '&#059;&#32;',
 9+ 'name' => ',&#32;',
 10+ 'authorlast' => '&#32;&amp;&#32;',
 11+ 'beforepublication' => ':',
1212 );
1313 private $dAuthorTruncate = 8; # the amount of authors it should display,
1414 # if truncated, 'et al' will be used instead.
@@ -82,6 +82,12 @@
8383 */
8484 public function __construct( $parser, $frame, $args ) {
8585 parent::__construct($parser, $frame, $args);
 86+ # init data
 87+ $this->dSeparators['section'] = wfMsg ( 'ta-citesep-section' );
 88+ $this->dSeparators['author'] = wfMsg ( 'ta-citesep-author' );
 89+ $this->dSeparators['name'] = wfMsg ( 'ta-citesep-name' );
 90+ $this->dSeparators['authorlast'] = wfMsg ( 'ta-citesep-authorlast' );
 91+ $this->dSeparators['beforepublication'] = wfMsg ( 'ta-citesep-beforepublication' );
8692 $this->readOptions( );
8793 $this->parseData();
8894 }
@@ -94,63 +100,65 @@
95101 # authors
96102 if ( count( $this->dAuthors ) > 1 ) {
97103 $authorArea = $this->createWriterSection ( $this->dAuthors, $this->dAuthorLinks, $this->dAuthorTruncate );
98 - if ( $this->dCoAuthors != null )
99 - $authorArea .= $this->getSeparator( 'author' ) . $this->dCoAuthors;
100 - if ( $this->dDate != null ) {
101 - $authorArea .= wfMsg ( 'ta-citeauthordate', $this->dDate);
102 - if ( $this->dYearNote != null )
103 - $authorArea .= wfMsg ( 'ta-citeauthoryearnote', $this->dYearNote );
 104+ if ( $this->notNull ( $this->dCoAuthors ) )
 105+ $authorArea = wfMsg ( 'ta-citecoauthors', $authorArea, $this->getSeparator( 'author' ), $this->dCoAuthors );
 106+ if ( $this->notNull ( $this->dDate ) ) {
 107+ $authorArea = wfMsg ( 'ta-citeauthordate', $authorArea, $this->dDate);
 108+ if ( $this->notNull ( $this->dYearNote ) )
 109+ $authorArea = wfMsg ( 'ta-citeauthoryearnote', $authorArea, $this->dYearNote );
104110 }
105111 $this->mOutput .= $authorArea;
106112 # editors
107113 } elseif ( count ( $this->dEditors ) > 1 ) {
108114 $editorArea = $this->createWriterSection ( $this->dEditors, $this->dEditorLinks, $this->dEditorTruncate );
109115 if ( count ( $this->dEditors ) > 2 )
110 - $editorArea .= wfMsg ( 'ta-editorsplural' );
 116+ $editorArea = wfMsg ( 'ta-citeeditorsplural', $editorArea );
111117 else
112 - $editorArea .= wfMsg ( 'ta-editorssingular' );
 118+ $editorArea = wfMsg ( 'ta-citeeditorssingular', $editorArea );
113119 $editorArea .= $this->getSeparator ( 'section' );
114 - if ( $this->dDate != null ) {
115 - $editorArea .= wfMsg ( 'ta-citeauthordate', $this->dDate);
116 - if ( $this->dYearNote != null )
117 - $editorArea .= wfMsg ( 'ta-citeauthoryearnote', $this->dYearNote );
 120+ if ( $this->notNull ( $this->dDate ) ) {
 121+ $editorArea = wfMsg ( 'ta-citeauthordate', $editorArea, $this->dDate);
 122+ if ( $this->notNull ( $this->dYearNote ) )
 123+ $editorArea .= wfMsg ( 'ta-citeauthoryearnote', $editorArea, $this->dYearNote );
118124 }
119125 $this->mOutput .= $editorArea;
120126 }
121127 # included work title
122 - if ( $this->notNull( $this->dWorkTitle['includedwork'] ) && ( $this->notNull( $this->dPeriodical['name'] ) || $this->notNull( $this->dWorkTitle['transitalic'] ) || $this->notNull( $this->dWorkTitle['transtitle'] ) ) ) {
123 - # I am no way certain this is a correct copy of the following logic:
124 - # {{#if: {{{IncludedWorkTitle|}}}{{#if:{{{Periodical|}}}||{{#if:{{{TransItalic|}}}||{{{TransTitle|}}}}}}} | ... | ... }}
125 - if ( $authorArea != '' || $editorArea != '' ) {
 128+ if ( $this->notNull( $this->dWorkTitle['includedwork'] )
 129+ && ( $this->notNull( $this->dPeriodical['name'] )
 130+ || $this->notNull( $this->dWorkTitle['transitalic'] )
 131+ || $this->notNull( $this->dWorkTitle['transtitle'] ) ) ) {
 132+ if ( $authorArea != ''
 133+ || $editorArea != '' ) {
126134 $this->mOutput .= $this->getSeparator( 'section' );
127135 }
128136 # let's get the url
129 - if ( $this->dWorkLink['includedwork'] != null ) {
 137+ if ( $this->notNull ( $this->dWorkLink['includedwork'] ) ) {
130138 $url = $this->dWorkLink['includedwork'];
131139 } else {
132 - if ( $this->dWorkLink['url'] != null ) {
 140+ if ( $this->notNull ( $this->dWorkLink['url'] ) ) {
133141 $url = $this->dWorkLink['url'];
134142 } else {
135143 # some explain to me what exactly the following is supposed to mean:
136144 # <!-- Only link URL if to a free full text - as at PubMedCentral (PMC)-->
137145 # |{{#ifexpr:{{#time: U}} > {{#time: U | {{{Embargo|2001-10-10}}} }}
138 - if ( $this->dPubMed['pmc'] != null ) {
139 - $url = wfMsg ( 'ta-pubmed-url', $this->dPubMed['pmc'] );
 146+ if ( $this->notNull ( $this->dPubMed['pmc'] ) ) {
 147+ $url = wfMsg ( 'ta-citepubmed-url', $this->dPubMed['pmc'] );
140148 }
141149 }
142150 }
143151 # and now the title
144152 if ( $this->notNull ( $this->dPeriodical['name'] ) ) {
145 - $tmp = str_replace( "'", '&#39;', $this->dWorkTitle['includedwork']);
146 - $title = "''$tmp''";
 153+ $tmp = $this->clean( $this->dWorkTitle['includedwork'] );
 154+ $title = wfMsg ( 'ta-citeincludedworktitle', $tmp );
147155 } else {
148 - $tmp = ( $this->dWorkTitle['includedwork'] != null
 156+ $tmp = ( $this->notNull ( $this->dWorkTitle['includedwork'] )
149157 ? $this->dWorkTitle['includedwork']
150158 : '' );
151159 if ( $this->dWorkTitle['transtitle'] ) {
152160 if ( $tmp != '' )
153161 $tmp .= ' ';
154 - $tmp .= wfMsg( 'ta-transtitle-render', $this->dWorkTitle['transtitle'] );
 162+ $tmp .= wfMsg( 'ta-citetranstitle-render', $this->dWorkTitle['transtitle'] );
155163 }
156164 $title = $tmp;
157165 }
@@ -165,7 +173,7 @@
166174 || $this->notNull ( $this->dWorkTitle['includedwork'] )
167175 )
168176 ) {
169 - $this->mOutput .= $this->getSeparator ( 'section' ) . ' ' . wfMsg ( 'ta-writtenat', $this->dPlace );
 177+ $this->mOutput .= wfMsg ( 'ta-citewrittenat', $this->getSeparator ( 'section' ), $this->dPlace );
170178 }
171179 # editor of complication... eerrr...
172180 # TODO: we'll do this later...
@@ -174,8 +182,10 @@
175183 if ( $this->notNull ( $this->dPeriodical['name'] ) ) {
176184 $perArea = '';
177185 if ( $this->notNull ( $this->dOther ) )
178 - $perArea .= $this->getSeparator ( 'section' ) . ' ' . $this->dOther;
179 - if ( $authorArea != '' || $editorArea != '' || $this->notNull ( $this->dWorkTitle['includedwork'] ) )
 186+ $perArea .= wfMsg ( 'ta-citeother', $this->getSeparator ( 'section' ), $this->dOther );
 187+ if ( $authorArea != ''
 188+ || $editorArea != ''
 189+ || $this->notNull ( $this->dWorkTitle['includedwork'] ) )
180190 $perArea .= $this->getSeparator ( 'section' );
181191 # make the link!
182192 if ( $this->notNull ( $this->dWorkTitle['title'] ) || $this->notNull ( $this->dWorkTitle['transtitle'] ) ) {
@@ -189,7 +199,7 @@
190200 # <!-- Only link URL if to a free full text - as at PubMedCentral (PMC)-->
191201 # |{{#ifexpr:{{#time: U}} > {{#time: U | {{{Embargo|2001-10-10}}} }}
192202 if ( $this->dPubMed['pmc'] != null ) {
193 - $url = wfMsg ( 'ta-pubmed-url', $this->dPubMed['pmc'] );
 203+ $url = wfMsg ( 'ta-citepubmed-url', $this->dPubMed['pmc'] );
194204 }
195205 }
196206 }
@@ -201,7 +211,7 @@
202212 # <!-- Only link URL if to a free full text - as at PubMedCentral (PMC)-->
203213 # |{{#ifexpr:{{#time: U}} > {{#time: U | {{{Embargo|2001-10-10}}} }}
204214 if ( $this->dPubMed['pmc'] != null ) {
205 - $url = wfMsg ( 'ta-pubmed-url', $this->dPubMed['pmc'] );
 215+ $url = wfMsg ( 'ta-citepubmed-url', $this->dPubMed['pmc'] );
206216 }
207217 }
208218 }
@@ -212,7 +222,7 @@
213223 if ( $this->notNull ( $this->dWorkTitle['transtitle'] ) ) {
214224 if ( $tmp != '' )
215225 $tmp .= ' ';
216 - $tmp .= wfMsg ( 'ta-transtitle-render', $this->dWorkTitle['transtitle'] );
 226+ $tmp .= wfMsg ( 'ta-citetranstitle-render', $this->dWorkTitle['transtitle'] );
217227 }
218228 $title = "\"$tmp\"";
219229 $perArea .= $this->makeLink ( $url, $title );
@@ -224,11 +234,13 @@
225235 }
226236 # language
227237 if ( $this->notNull ( $this->dLanguage ) ) {
228 - $this->mOutput .= wfMsg ( 'ta-inlanguage', $this->dLanguage );
 238+ # yes, I am cheating right now
 239+ $this->mOutput .= wfMsg ( 'ta-citeinlanguage', '', $this->dLanguage );
229240 }
230241 # format
231242 if ( $this->notNull ( $this->dFormat ) ) {
232 - $this->mOutput .= wfMsg ( 'ta-formatrender', $this->dFormat );
 243+ # also here!
 244+ $this->mOutput .= wfMsg ( 'ta-citeformatrender', '', $this->dFormat );
233245 }
234246 # more periodical!
235247 if ( $this->notNull ( $this->dPeriodical['name'] ) ) {
@@ -239,29 +251,31 @@
240252 ) {
241253 $newPerArea .= $this->getSeparator ( 'section' ) . ' ';
242254 }
243 - $newPerArea .= "''" . $this->clean ( $this->dPeriodical['name'] ) . "''";
 255+ $newPerArea .= wfMsg ( 'ta-citeperiodical', $this->clean ( $this->dPeriodical['name'] ) );
244256 if ( $this->notNull ( $this->dSeries ) ) {
245 - $newPerArea .= $this->getSeparator ( 'section' ) . ' ' . $this->dSeries;
 257+ $newPerArea .= wfMsg ( 'ta-citeseries', $this->getSeparator ( 'section' ), $this->dSeries );
246258 }
247259 if ( $this->notNull ( $this->dPublication['place'] ) ) {
248260 if ( $this->notNull ( $this->dPublisher ) ) {
249 - $newPerArea .= wfMsg ( 'ta-publicationplaceandpublisher', $this->dPublication['place'], $this->dPublisher );
 261+ # so cheating with these messages, I think, blanks?!
 262+ $newPerArea .= wfMsg ( 'ta-citepublicationplaceandpublisher', '', $this->dPublication['place'], $this->dPublisher );
250263 } else {
251 - $newPerArea .= wfMsg ( 'ta-publicationplace', $this->dPublication['place'] );
 264+ # Blank? BLANK!? You're not looking at the big picture!
 265+ $newPerArea .= wfMsg ( 'ta-citepublicationplace', '', $this->dPublication['place'] );
252266 }
253267 }
254268 if ( $this->notNull ( $this->dVolume ) ) {
255 - $newPerArea .= wfMsg ( 'ta-volumerender', $this->dVolume );
 269+ $newPerArea .= wfMsg ( 'ta-citevolumerender', '', $this->dVolume );
256270 if ( $this->notNUll ( $this->dIssue ) ) {
257 - $newPerArea .= wfMsg ( 'ta-issuerender', $this->dIssue );
 271+ $newPerArea .= wfMsg ( 'ta-citeissuerender', '', $this->dIssue );
258272 }
259273 } else {
260274 if ( $this->notNUll ( $this->dIssue ) ) {
261 - $newPerArea .= wfMsg ( 'ta-issuerender', $this->dIssue );
 275+ $newPerArea .= wfMsg ( 'ta-citeissuerender', '', $this->dIssue );
262276 }
263277 }
264278 if ( $this->notNull ( $this->dAt ) ) {
265 - $newPerArea .= wfMsg ( 'ta-atrender', $this->dAt );
 279+ $newPerArea .= wfMsg ( 'ta-citeatrender', '', $this->dAt );
266280 }
267281 # now we get to the title! Exciting stuff!
268282 if ( $this->notNull ( $this->dWorkTitle['title'] )
@@ -283,7 +297,7 @@
284298 # <!-- Only link URL if to a free full text - as at PubMedCentral (PMC)-->
285299 # |{{#ifexpr:{{#time: U}} > {{#time: U | {{{Embargo|2001-10-10}}} }}
286300 if ( $this->dPubMed['pmc'] != null ) {
287 - $url = wfMsg ( 'ta-pubmed-url', $this->dPubMed['pmc'] );
 301+ $url = wfMsg ( 'ta-citepubmed-url', $this->dPubMed['pmc'] );
288302 }
289303 }
290304 }
@@ -295,7 +309,7 @@
296310 # <!-- Only link URL if to a free full text - as at PubMedCentral (PMC)-->
297311 # |{{#ifexpr:{{#time: U}} > {{#time: U | {{{Embargo|2001-10-10}}} }}
298312 if ( $this->dPubMed['pmc'] != null ) {
299 - $url = wfMsg ( 'ta-pubmed-url', $this->dPubMed['pmc'] );
 313+ $url = wfMsg ( 'ta-citepubmed-url', $this->dPubMed['pmc'] );
300314 }
301315 }
302316 }
@@ -306,43 +320,43 @@
307321 if ( $this->notNull ( $this->dWorkTitle['transitalic'] ) ) {
308322 if ( $tmp != '' )
309323 $tmp .= ' ';
310 - $tmp .= wfMsg ( 'ta-transtitle-render', $this->dWorkTitle['transitalic'] );
 324+ $tmp .= wfMsg ( 'ta-citetranstitle-render', $this->dWorkTitle['transitalic'] );
311325 }
312326 $tmp = $this->clean ( $tmp );
313 - $title = "''$tmp''";
 327+ $title = wfMsg ( 'ta-citeperiodicaltitle', $tmp );
314328 $newPerArea .= $this->makeLink ( $url, $title );
315329 }
316330 # may change this into some if () statements though,
317331 # it is easier to write this, but it also means that all of the
318332 # second input is actually evaluated, even if it contains nothing.
319333 $newPerArea .= $this->addNotNull ( $this->dWorkTitle['type'],
320 - wfMsg ( 'ta-titletyperender', $this->dWorkTitle['type'] ) );
 334+ wfMsg ( 'ta-citetitletyperender', '', $this->dWorkTitle['type'] ) );
321335 $newPerArea .= $this->addNotNull ( $this->dSeries,
322 - $this->getSeparator ( 'section' ) . ' ' . $this->dSeries );
 336+ wfMsg ( 'ta-citeseries', $this->getSeparator ( 'section' ), $this->dSeries ) );
323337 $newPerArea .= $this->addNotNull ( $this->dVolume,
324 - $this->getSeparator ( 'section' ) . ' ' . wfMsg ( 'ta-volumerender', $this->dVolume ) );
 338+ wfMsg ( 'ta-citevolumerender', $this->getSeparator ( 'section' ), $this->dVolume ) );
325339 $newPerArea .= $this->addNotNull ( $this->dOther,
326 - $this->getSeparator ( 'section' ) . ' ' . $this->dOther );
 340+ wfMsg ( 'ta-citeother', $this->getSeparator ( 'section' ), $this->dOther );
327341 $newPerArea .= $this->addNotNull ( $this->dEdition,
328 - wfMsg ( 'ta-editionrender', $this->dEdition ) );
 342+ wfMsg ( 'ta-citeeditionrender', $this->dEdition ) );
329343 $newPerArea .= $this->addNotNull ( $this->dPublication['place'],
330 - $this->getSeparator ( 'section' ) . ' ' . $this->dPublication['place'] );
 344+ wfMsg ( 'ta-citepublication', $this->getSeparator ( 'section' ), $this->dPublication['place'] ) );
331345 if ( $this->notNull ( $this->dPublisher ) ) {
332 - if ( $this->dPublication['place'] ) {
333 - $newPerArea .= ':';
 346+ if ( $this->notNull ( $this->dPublication['place'] ) ) {
 347+ $sep = $this->getSeparator ( 'beforepublication' );
334348 } else {
335 - $newPerArea .= $this->getSeparator ( 'section' );
 349+ $sep = $this->getSeparator ( 'section' );
336350 }
337 - $newPerArea .= wfMsg ( 'ta-publisherrender', $this->dPublisher );
 351+ $newPerArea .= wfMsg ( 'ta-citepublisherrender', $sep, $this->dPublisher );
338352 }
339353 $this->mOutput .= $newPerArea;
340354 }
341355 # date if no author/editor
342356 if ( $authorArea == '' && $editorArea == '' ) {
343357 if ( $this->notNull ( $this->dDate ) ) {
344 - $this->mOutput .= $this->getSeparator ( 'section' ) . wfMsg ( 'ta-citeauthordate', $this->dDate );
 358+ $this->mOutput .= wfMsg ( 'ta-citeauthordate', $this->getSeparator ( 'section' ), $this->dDate );
345359 if ( $this->notNull ( $this->dYearNote ) ) {
346 - $this->mOutput .= wfMsg ( 'ta-citeauthoryearnote', $this->dYearNote );
 360+ $this->mOutput .= wfMsg ( 'ta-citeauthoryearnote', '', $this->dYearNote );
347361 }
348362 }
349363 }
@@ -350,21 +364,21 @@
351365 if ( $this->notNull ( $this->dPublication['date'] ) && $this->dPublication['date'] != $this->dDate ) {
352366 if ( isset ( $this->dEditors[1] ) ) {
353367 if ( isset ( $this->dAuthors[1] ) ) {
354 - $this->mOutput .= $this->getSeparator ( 'section' ) . ' ' . $this->dPublication['date'];
 368+ $this->mOutput .= wfMsg ( 'ta-citepublicationdate', $this->getSeparator ( 'section' ), $this->dPublication['date'] );
355369 } else {
356 - $this->mOutput .= wfMsg ( 'ta-published', $this->dPublication['date'] );
 370+ $this->mOutput .= wfMsg ( 'ta-citepublished', '', $this->dPublication['date'] );
357371 }
358372 } else {
359373 if ( $this->notNull ( $this->dPeriodical['name'] ) ) {
360 - $this->mOutput .= $this->getSeparator ( 'section' ) . ' ' . $this->dPublication['date'];
 374+ $this->mOutput .= wfMsg ( 'ta-citepublicationdate', $this->getSeparator ( 'section' ), $this->dPublication['date'] );
361375 } else {
362 - $this->mOutput .= wfMsg ( 'ta-published', $this->dPublication['date'] );
 376+ $this->mOutput .= wfMsg ( 'ta-citepublished', '', $this->dPublication['date'] );
363377 }
364378 }
365379 }
366380 # page within included work
367381 if ( !$this->notNull ( $this->dPeriodical['name'] ) && $this->notNull ( $this->dAt ) ) {
368 - $this->mOutput .= $this->getSeparator ( 'section' ) . ' ' . $this->dAt;
 382+ $this->mOutput .= wfMsg ( 'ta-citeatseparated', $this->getSeparator ( 'section' ), $this->dAt );
369383 }
370384 # doi
371385 # TODO: I'll do this code later:
@@ -435,10 +449,10 @@
436450 }
437451 if ( $this->notNull ( $this->dAccessDate ) ) {
438452 if ( $this->getSeparator ( 'section' ) == '.' )
439 - $tmp = ". Retrieved {$this->dAccessDate}";
 453+ $tmp = wfMsg ( 'ta-citeretrievedupper', $this->getSeparator ( 'section' ), $this->dAccessDate );
440454 else
441 - $tmp = ", retrieved {$this->dAccessDate}";
442 - $this->mOutput .= wfMsg ( 'ta-accessdatespan', $tmp );
 455+ $tmp = wfMsg ( 'ta-citeretrievedlower', $this->getSeparator ( 'section' ), $this->dAccessDate );
 456+ $this->mOutput .= wfMsg ( 'ta-citeaccessdatespan', $tmp );
443457 }
444458 }
445459
@@ -461,7 +475,7 @@
462476 * @return $string
463477 */
464478 private function printOnly ( $string ) {
465 - return wfMsg ( 'ta-printonlyspan', $string );
 479+ return wfMsg ( 'ta-citeprintonlyspan', $string );
466480 }
467481
468482 private function addNotNull ( $check, $add ) {
@@ -495,7 +509,7 @@
496510 if ( $i == 0 )
497511 continue;
498512 if ( $i > 1 && $truncate <= $i ) {
499 - $area .= wfMsg( "ta-etal" );
 513+ $area = wfMsg( "ta-citeetal", $area );
500514 break;
501515 }
502516 if ( $n == count($writers)-1 && $i != 1 )
@@ -538,7 +552,7 @@
539553 * This function should in the future do some wfMsg() magic to check if
540554 * they are using a set separator message or just using a default one.
541555 *
542 - * @param $name Name of separator; regular, author or ampersand
 556+ * @param $name Name of separator; section, author, name or authorlast
543557 * @return $separator Blank if none found.
544558 */
545559 private function getSeparator ( $name ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r66107Fix to r66106; maybe I should test my code before I commit. >_>svip13:58, 9 May 2010
r66491Following up on r66057, r66106 & r66107. I really, really need to wrap my he...svip19:13, 15 May 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r66057Far more render logic added. Still not added so much to parse input data.svip23:57, 7 May 2010

Status & tagging log