Index: trunk/extensions/TemplateAdventures/TemplateAdventures.i18n.php |
— | — | @@ -4,26 +4,48 @@ |
5 | 5 | |
6 | 6 | /** English */ |
7 | 7 | $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' => ', ', # separator between surname and givenname |
| 11 | + 'ta-citesep-author' => '; ', # separator between authors |
| 12 | + 'ta-citesep-authorlast' => ' & ', # 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' => '[$1]', |
| 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>', |
29 | 51 | ); |
30 | 52 | |
Index: trunk/extensions/TemplateAdventures/Templates/Citation.php |
— | — | @@ -3,11 +3,11 @@ |
4 | 4 | class Citation extends TemplateAdventureBasic { |
5 | 5 | |
6 | 6 | private $dSeparators = array( # separators between names, items, etc. |
7 | | - 'section' => ',', |
8 | | - 'regular' => ', ', |
9 | | - 'author' => '; ', |
10 | | - 'name' => ', ', |
11 | | - 'ampersand' => ' & ', |
| 7 | + 'section' => ',', |
| 8 | + 'author' => '; ', |
| 9 | + 'name' => ', ', |
| 10 | + 'authorlast' => ' & ', |
| 11 | + 'beforepublication' => ':', |
12 | 12 | ); |
13 | 13 | private $dAuthorTruncate = 8; # the amount of authors it should display, |
14 | 14 | # if truncated, 'et al' will be used instead. |
— | — | @@ -82,6 +82,12 @@ |
83 | 83 | */ |
84 | 84 | public function __construct( $parser, $frame, $args ) { |
85 | 85 | 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' ); |
86 | 92 | $this->readOptions( ); |
87 | 93 | $this->parseData(); |
88 | 94 | } |
— | — | @@ -94,63 +100,65 @@ |
95 | 101 | # authors |
96 | 102 | if ( count( $this->dAuthors ) > 1 ) { |
97 | 103 | $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 ); |
104 | 110 | } |
105 | 111 | $this->mOutput .= $authorArea; |
106 | 112 | # editors |
107 | 113 | } elseif ( count ( $this->dEditors ) > 1 ) { |
108 | 114 | $editorArea = $this->createWriterSection ( $this->dEditors, $this->dEditorLinks, $this->dEditorTruncate ); |
109 | 115 | if ( count ( $this->dEditors ) > 2 ) |
110 | | - $editorArea .= wfMsg ( 'ta-editorsplural' ); |
| 116 | + $editorArea = wfMsg ( 'ta-citeeditorsplural', $editorArea ); |
111 | 117 | else |
112 | | - $editorArea .= wfMsg ( 'ta-editorssingular' ); |
| 118 | + $editorArea = wfMsg ( 'ta-citeeditorssingular', $editorArea ); |
113 | 119 | $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 ); |
118 | 124 | } |
119 | 125 | $this->mOutput .= $editorArea; |
120 | 126 | } |
121 | 127 | # 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 != '' ) { |
126 | 134 | $this->mOutput .= $this->getSeparator( 'section' ); |
127 | 135 | } |
128 | 136 | # let's get the url |
129 | | - if ( $this->dWorkLink['includedwork'] != null ) { |
| 137 | + if ( $this->notNull ( $this->dWorkLink['includedwork'] ) ) { |
130 | 138 | $url = $this->dWorkLink['includedwork']; |
131 | 139 | } else { |
132 | | - if ( $this->dWorkLink['url'] != null ) { |
| 140 | + if ( $this->notNull ( $this->dWorkLink['url'] ) ) { |
133 | 141 | $url = $this->dWorkLink['url']; |
134 | 142 | } else { |
135 | 143 | # some explain to me what exactly the following is supposed to mean: |
136 | 144 | # <!-- Only link URL if to a free full text - as at PubMedCentral (PMC)--> |
137 | 145 | # |{{#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'] ); |
140 | 148 | } |
141 | 149 | } |
142 | 150 | } |
143 | 151 | # and now the title |
144 | 152 | if ( $this->notNull ( $this->dPeriodical['name'] ) ) { |
145 | | - $tmp = str_replace( "'", ''', $this->dWorkTitle['includedwork']); |
146 | | - $title = "''$tmp''"; |
| 153 | + $tmp = $this->clean( $this->dWorkTitle['includedwork'] ); |
| 154 | + $title = wfMsg ( 'ta-citeincludedworktitle', $tmp ); |
147 | 155 | } else { |
148 | | - $tmp = ( $this->dWorkTitle['includedwork'] != null |
| 156 | + $tmp = ( $this->notNull ( $this->dWorkTitle['includedwork'] ) |
149 | 157 | ? $this->dWorkTitle['includedwork'] |
150 | 158 | : '' ); |
151 | 159 | if ( $this->dWorkTitle['transtitle'] ) { |
152 | 160 | if ( $tmp != '' ) |
153 | 161 | $tmp .= ' '; |
154 | | - $tmp .= wfMsg( 'ta-transtitle-render', $this->dWorkTitle['transtitle'] ); |
| 162 | + $tmp .= wfMsg( 'ta-citetranstitle-render', $this->dWorkTitle['transtitle'] ); |
155 | 163 | } |
156 | 164 | $title = $tmp; |
157 | 165 | } |
— | — | @@ -165,7 +173,7 @@ |
166 | 174 | || $this->notNull ( $this->dWorkTitle['includedwork'] ) |
167 | 175 | ) |
168 | 176 | ) { |
169 | | - $this->mOutput .= $this->getSeparator ( 'section' ) . ' ' . wfMsg ( 'ta-writtenat', $this->dPlace ); |
| 177 | + $this->mOutput .= wfMsg ( 'ta-citewrittenat', $this->getSeparator ( 'section' ), $this->dPlace ); |
170 | 178 | } |
171 | 179 | # editor of complication... eerrr... |
172 | 180 | # TODO: we'll do this later... |
— | — | @@ -174,8 +182,10 @@ |
175 | 183 | if ( $this->notNull ( $this->dPeriodical['name'] ) ) { |
176 | 184 | $perArea = ''; |
177 | 185 | 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'] ) ) |
180 | 190 | $perArea .= $this->getSeparator ( 'section' ); |
181 | 191 | # make the link! |
182 | 192 | if ( $this->notNull ( $this->dWorkTitle['title'] ) || $this->notNull ( $this->dWorkTitle['transtitle'] ) ) { |
— | — | @@ -189,7 +199,7 @@ |
190 | 200 | # <!-- Only link URL if to a free full text - as at PubMedCentral (PMC)--> |
191 | 201 | # |{{#ifexpr:{{#time: U}} > {{#time: U | {{{Embargo|2001-10-10}}} }} |
192 | 202 | if ( $this->dPubMed['pmc'] != null ) { |
193 | | - $url = wfMsg ( 'ta-pubmed-url', $this->dPubMed['pmc'] ); |
| 203 | + $url = wfMsg ( 'ta-citepubmed-url', $this->dPubMed['pmc'] ); |
194 | 204 | } |
195 | 205 | } |
196 | 206 | } |
— | — | @@ -201,7 +211,7 @@ |
202 | 212 | # <!-- Only link URL if to a free full text - as at PubMedCentral (PMC)--> |
203 | 213 | # |{{#ifexpr:{{#time: U}} > {{#time: U | {{{Embargo|2001-10-10}}} }} |
204 | 214 | if ( $this->dPubMed['pmc'] != null ) { |
205 | | - $url = wfMsg ( 'ta-pubmed-url', $this->dPubMed['pmc'] ); |
| 215 | + $url = wfMsg ( 'ta-citepubmed-url', $this->dPubMed['pmc'] ); |
206 | 216 | } |
207 | 217 | } |
208 | 218 | } |
— | — | @@ -212,7 +222,7 @@ |
213 | 223 | if ( $this->notNull ( $this->dWorkTitle['transtitle'] ) ) { |
214 | 224 | if ( $tmp != '' ) |
215 | 225 | $tmp .= ' '; |
216 | | - $tmp .= wfMsg ( 'ta-transtitle-render', $this->dWorkTitle['transtitle'] ); |
| 226 | + $tmp .= wfMsg ( 'ta-citetranstitle-render', $this->dWorkTitle['transtitle'] ); |
217 | 227 | } |
218 | 228 | $title = "\"$tmp\""; |
219 | 229 | $perArea .= $this->makeLink ( $url, $title ); |
— | — | @@ -224,11 +234,13 @@ |
225 | 235 | } |
226 | 236 | # language |
227 | 237 | 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 ); |
229 | 240 | } |
230 | 241 | # format |
231 | 242 | if ( $this->notNull ( $this->dFormat ) ) { |
232 | | - $this->mOutput .= wfMsg ( 'ta-formatrender', $this->dFormat ); |
| 243 | + # also here! |
| 244 | + $this->mOutput .= wfMsg ( 'ta-citeformatrender', '', $this->dFormat ); |
233 | 245 | } |
234 | 246 | # more periodical! |
235 | 247 | if ( $this->notNull ( $this->dPeriodical['name'] ) ) { |
— | — | @@ -239,29 +251,31 @@ |
240 | 252 | ) { |
241 | 253 | $newPerArea .= $this->getSeparator ( 'section' ) . ' '; |
242 | 254 | } |
243 | | - $newPerArea .= "''" . $this->clean ( $this->dPeriodical['name'] ) . "''"; |
| 255 | + $newPerArea .= wfMsg ( 'ta-citeperiodical', $this->clean ( $this->dPeriodical['name'] ) ); |
244 | 256 | if ( $this->notNull ( $this->dSeries ) ) { |
245 | | - $newPerArea .= $this->getSeparator ( 'section' ) . ' ' . $this->dSeries; |
| 257 | + $newPerArea .= wfMsg ( 'ta-citeseries', $this->getSeparator ( 'section' ), $this->dSeries ); |
246 | 258 | } |
247 | 259 | if ( $this->notNull ( $this->dPublication['place'] ) ) { |
248 | 260 | 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 ); |
250 | 263 | } 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'] ); |
252 | 266 | } |
253 | 267 | } |
254 | 268 | if ( $this->notNull ( $this->dVolume ) ) { |
255 | | - $newPerArea .= wfMsg ( 'ta-volumerender', $this->dVolume ); |
| 269 | + $newPerArea .= wfMsg ( 'ta-citevolumerender', '', $this->dVolume ); |
256 | 270 | if ( $this->notNUll ( $this->dIssue ) ) { |
257 | | - $newPerArea .= wfMsg ( 'ta-issuerender', $this->dIssue ); |
| 271 | + $newPerArea .= wfMsg ( 'ta-citeissuerender', '', $this->dIssue ); |
258 | 272 | } |
259 | 273 | } else { |
260 | 274 | if ( $this->notNUll ( $this->dIssue ) ) { |
261 | | - $newPerArea .= wfMsg ( 'ta-issuerender', $this->dIssue ); |
| 275 | + $newPerArea .= wfMsg ( 'ta-citeissuerender', '', $this->dIssue ); |
262 | 276 | } |
263 | 277 | } |
264 | 278 | if ( $this->notNull ( $this->dAt ) ) { |
265 | | - $newPerArea .= wfMsg ( 'ta-atrender', $this->dAt ); |
| 279 | + $newPerArea .= wfMsg ( 'ta-citeatrender', '', $this->dAt ); |
266 | 280 | } |
267 | 281 | # now we get to the title! Exciting stuff! |
268 | 282 | if ( $this->notNull ( $this->dWorkTitle['title'] ) |
— | — | @@ -283,7 +297,7 @@ |
284 | 298 | # <!-- Only link URL if to a free full text - as at PubMedCentral (PMC)--> |
285 | 299 | # |{{#ifexpr:{{#time: U}} > {{#time: U | {{{Embargo|2001-10-10}}} }} |
286 | 300 | if ( $this->dPubMed['pmc'] != null ) { |
287 | | - $url = wfMsg ( 'ta-pubmed-url', $this->dPubMed['pmc'] ); |
| 301 | + $url = wfMsg ( 'ta-citepubmed-url', $this->dPubMed['pmc'] ); |
288 | 302 | } |
289 | 303 | } |
290 | 304 | } |
— | — | @@ -295,7 +309,7 @@ |
296 | 310 | # <!-- Only link URL if to a free full text - as at PubMedCentral (PMC)--> |
297 | 311 | # |{{#ifexpr:{{#time: U}} > {{#time: U | {{{Embargo|2001-10-10}}} }} |
298 | 312 | if ( $this->dPubMed['pmc'] != null ) { |
299 | | - $url = wfMsg ( 'ta-pubmed-url', $this->dPubMed['pmc'] ); |
| 313 | + $url = wfMsg ( 'ta-citepubmed-url', $this->dPubMed['pmc'] ); |
300 | 314 | } |
301 | 315 | } |
302 | 316 | } |
— | — | @@ -306,43 +320,43 @@ |
307 | 321 | if ( $this->notNull ( $this->dWorkTitle['transitalic'] ) ) { |
308 | 322 | if ( $tmp != '' ) |
309 | 323 | $tmp .= ' '; |
310 | | - $tmp .= wfMsg ( 'ta-transtitle-render', $this->dWorkTitle['transitalic'] ); |
| 324 | + $tmp .= wfMsg ( 'ta-citetranstitle-render', $this->dWorkTitle['transitalic'] ); |
311 | 325 | } |
312 | 326 | $tmp = $this->clean ( $tmp ); |
313 | | - $title = "''$tmp''"; |
| 327 | + $title = wfMsg ( 'ta-citeperiodicaltitle', $tmp ); |
314 | 328 | $newPerArea .= $this->makeLink ( $url, $title ); |
315 | 329 | } |
316 | 330 | # may change this into some if () statements though, |
317 | 331 | # it is easier to write this, but it also means that all of the |
318 | 332 | # second input is actually evaluated, even if it contains nothing. |
319 | 333 | $newPerArea .= $this->addNotNull ( $this->dWorkTitle['type'], |
320 | | - wfMsg ( 'ta-titletyperender', $this->dWorkTitle['type'] ) ); |
| 334 | + wfMsg ( 'ta-citetitletyperender', '', $this->dWorkTitle['type'] ) ); |
321 | 335 | $newPerArea .= $this->addNotNull ( $this->dSeries, |
322 | | - $this->getSeparator ( 'section' ) . ' ' . $this->dSeries ); |
| 336 | + wfMsg ( 'ta-citeseries', $this->getSeparator ( 'section' ), $this->dSeries ) ); |
323 | 337 | $newPerArea .= $this->addNotNull ( $this->dVolume, |
324 | | - $this->getSeparator ( 'section' ) . ' ' . wfMsg ( 'ta-volumerender', $this->dVolume ) ); |
| 338 | + wfMsg ( 'ta-citevolumerender', $this->getSeparator ( 'section' ), $this->dVolume ) ); |
325 | 339 | $newPerArea .= $this->addNotNull ( $this->dOther, |
326 | | - $this->getSeparator ( 'section' ) . ' ' . $this->dOther ); |
| 340 | + wfMsg ( 'ta-citeother', $this->getSeparator ( 'section' ), $this->dOther ); |
327 | 341 | $newPerArea .= $this->addNotNull ( $this->dEdition, |
328 | | - wfMsg ( 'ta-editionrender', $this->dEdition ) ); |
| 342 | + wfMsg ( 'ta-citeeditionrender', $this->dEdition ) ); |
329 | 343 | $newPerArea .= $this->addNotNull ( $this->dPublication['place'], |
330 | | - $this->getSeparator ( 'section' ) . ' ' . $this->dPublication['place'] ); |
| 344 | + wfMsg ( 'ta-citepublication', $this->getSeparator ( 'section' ), $this->dPublication['place'] ) ); |
331 | 345 | if ( $this->notNull ( $this->dPublisher ) ) { |
332 | | - if ( $this->dPublication['place'] ) { |
333 | | - $newPerArea .= ':'; |
| 346 | + if ( $this->notNull ( $this->dPublication['place'] ) ) { |
| 347 | + $sep = $this->getSeparator ( 'beforepublication' ); |
334 | 348 | } else { |
335 | | - $newPerArea .= $this->getSeparator ( 'section' ); |
| 349 | + $sep = $this->getSeparator ( 'section' ); |
336 | 350 | } |
337 | | - $newPerArea .= wfMsg ( 'ta-publisherrender', $this->dPublisher ); |
| 351 | + $newPerArea .= wfMsg ( 'ta-citepublisherrender', $sep, $this->dPublisher ); |
338 | 352 | } |
339 | 353 | $this->mOutput .= $newPerArea; |
340 | 354 | } |
341 | 355 | # date if no author/editor |
342 | 356 | if ( $authorArea == '' && $editorArea == '' ) { |
343 | 357 | 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 ); |
345 | 359 | if ( $this->notNull ( $this->dYearNote ) ) { |
346 | | - $this->mOutput .= wfMsg ( 'ta-citeauthoryearnote', $this->dYearNote ); |
| 360 | + $this->mOutput .= wfMsg ( 'ta-citeauthoryearnote', '', $this->dYearNote ); |
347 | 361 | } |
348 | 362 | } |
349 | 363 | } |
— | — | @@ -350,21 +364,21 @@ |
351 | 365 | if ( $this->notNull ( $this->dPublication['date'] ) && $this->dPublication['date'] != $this->dDate ) { |
352 | 366 | if ( isset ( $this->dEditors[1] ) ) { |
353 | 367 | 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'] ); |
355 | 369 | } else { |
356 | | - $this->mOutput .= wfMsg ( 'ta-published', $this->dPublication['date'] ); |
| 370 | + $this->mOutput .= wfMsg ( 'ta-citepublished', '', $this->dPublication['date'] ); |
357 | 371 | } |
358 | 372 | } else { |
359 | 373 | 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'] ); |
361 | 375 | } else { |
362 | | - $this->mOutput .= wfMsg ( 'ta-published', $this->dPublication['date'] ); |
| 376 | + $this->mOutput .= wfMsg ( 'ta-citepublished', '', $this->dPublication['date'] ); |
363 | 377 | } |
364 | 378 | } |
365 | 379 | } |
366 | 380 | # page within included work |
367 | 381 | 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 ); |
369 | 383 | } |
370 | 384 | # doi |
371 | 385 | # TODO: I'll do this code later: |
— | — | @@ -435,10 +449,10 @@ |
436 | 450 | } |
437 | 451 | if ( $this->notNull ( $this->dAccessDate ) ) { |
438 | 452 | if ( $this->getSeparator ( 'section' ) == '.' ) |
439 | | - $tmp = ". Retrieved {$this->dAccessDate}"; |
| 453 | + $tmp = wfMsg ( 'ta-citeretrievedupper', $this->getSeparator ( 'section' ), $this->dAccessDate ); |
440 | 454 | 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 ); |
443 | 457 | } |
444 | 458 | } |
445 | 459 | |
— | — | @@ -461,7 +475,7 @@ |
462 | 476 | * @return $string |
463 | 477 | */ |
464 | 478 | private function printOnly ( $string ) { |
465 | | - return wfMsg ( 'ta-printonlyspan', $string ); |
| 479 | + return wfMsg ( 'ta-citeprintonlyspan', $string ); |
466 | 480 | } |
467 | 481 | |
468 | 482 | private function addNotNull ( $check, $add ) { |
— | — | @@ -495,7 +509,7 @@ |
496 | 510 | if ( $i == 0 ) |
497 | 511 | continue; |
498 | 512 | if ( $i > 1 && $truncate <= $i ) { |
499 | | - $area .= wfMsg( "ta-etal" ); |
| 513 | + $area = wfMsg( "ta-citeetal", $area ); |
500 | 514 | break; |
501 | 515 | } |
502 | 516 | if ( $n == count($writers)-1 && $i != 1 ) |
— | — | @@ -538,7 +552,7 @@ |
539 | 553 | * This function should in the future do some wfMsg() magic to check if |
540 | 554 | * they are using a set separator message or just using a default one. |
541 | 555 | * |
542 | | - * @param $name Name of separator; regular, author or ampersand |
| 556 | + * @param $name Name of separator; section, author, name or authorlast |
543 | 557 | * @return $separator Blank if none found. |
544 | 558 | */ |
545 | 559 | private function getSeparator ( $name ) { |