Index: branches/liquidthreads/extensions/LqtI18N.php |
— | — | @@ -0,0 +1,50 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | +* Internationalisation file for Language Manager extension. |
| 6 | +* |
| 7 | +* @package MediaWiki |
| 8 | +* @subpackage LiquidThreads |
| 9 | +* @author David McCabe <davemccabe@gmail.com> / I18N file by Erik Moeller |
| 10 | +* @licence GPL2 |
| 11 | +*/ |
| 12 | + |
| 13 | +if( !defined( 'MEDIAWIKI' ) ) { |
| 14 | + echo( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" ); |
| 15 | + die( -1 ); |
| 16 | +} |
| 17 | + |
| 18 | +global $wgExtensionFunctions; |
| 19 | +$wgExtensionFunctions[]='wfInitializeLqtMessages'; |
| 20 | + |
| 21 | +function wfInitializeLqtMessages() { |
| 22 | + global $wgMessageCache; |
| 23 | + $lqtMessages = array(); |
| 24 | + $lqtMessages['en'] = array( |
| 25 | + 'lqt_browse_archive' => 'Browse archive', |
| 26 | + 'lqt_recently_archived' => 'Recently archived', |
| 27 | + 'lqt_add_header'=>'Add header', |
| 28 | + 'lqt_new_thread'=>'Start a new discussion', |
| 29 | + 'lqt_move_placeholder'=>"''Placeholder left when the thread was moved to another page.''", |
| 30 | + 'lqt_reply'=>'Reply', |
| 31 | + 'lqt_delete'=>'Delete', |
| 32 | + 'lqt_undelete'=>'Undelete', |
| 33 | + 'lqt_permalink'=>'Permalink', |
| 34 | + 'lqt_fragment'=>'a fragment of a $1 from $2', |
| 35 | + 'lqt_discussion_link'=>'discussion', // substituted above |
| 36 | + 'lqt_from_talk'=>'from $1', |
| 37 | + 'lqt_comment_edited'=>'Comment text edited', |
| 38 | + 'lqt_summary_changed'=>'Summary changed', |
| 39 | + 'lqt_reply_created'=>'New reply created', |
| 40 | + 'lqt_thread_created'=>'New thread created', |
| 41 | + 'lqt_deleted'=>'Deleted', |
| 42 | + 'lqt_undeleted'=>'Undeleted', |
| 43 | + 'lqt_history_subtitle'=>'Viewing a history listing.', |
| 44 | + ); |
| 45 | + |
| 46 | + foreach( $lqtMessages as $key => $value ) { |
| 47 | + $wgMessageCache->addMessages( $lqtMessages[$key], $key ); |
| 48 | + } |
| 49 | +} |
| 50 | + |
| 51 | +?> |
Property changes on: branches/liquidthreads/extensions/LqtI18N.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 52 | + native |
Index: branches/liquidthreads/extensions/LqtPages.php |
— | — | @@ -13,6 +13,7 @@ |
14 | 14 | } |
15 | 15 | |
16 | 16 | require_once('LqtBaseView.php'); |
| 17 | +require_once('LqtI18N.php'); |
17 | 18 | |
18 | 19 | class TalkpageView extends LqtView { |
19 | 20 | /* Added to SkinTemplateTabs hook in TalkpageView::show(). */ |
— | — | @@ -48,17 +49,18 @@ |
49 | 50 | function showArchiveWidget() { |
50 | 51 | $threads = $this->queries->query('recently-archived'); |
51 | 52 | $threadlinks = $this->permalinksForThreads($threads); |
52 | | - |
| 53 | + |
53 | 54 | if ( count($threadlinks) > 0 ) { |
54 | 55 | $this->openDiv('lqt_archive_teaser'); |
55 | | - $this->output->addHTML('Recently archived:'); |
| 56 | + $this->output->addHTML(wfMsg('lqt_recently_archived')); |
56 | 57 | $this->outputList('ul', '', '', $threadlinks); |
57 | 58 | } else { |
58 | 59 | $this->openDiv(); |
59 | 60 | } |
60 | 61 | $url = $this->talkpageUrl($this->title, 'talkpage_archive'); |
| 62 | + $browse=wfMsg('lqt_browse_archive'); |
61 | 63 | $this->output->addHTML(<<<HTML |
62 | | - <p><a href="$url" class="lqt_browse_archive">Browse the Archive</a></p> |
| 64 | + <p><a href="$url" class="lqt_browse_archive">$browse</a></p> |
63 | 65 | HTML |
64 | 66 | ); |
65 | 67 | $this->closeDiv(); |
— | — | @@ -72,21 +74,22 @@ |
73 | 75 | |
74 | 76 | function showHeader() { |
75 | 77 | /* Show the contents of the actual talkpage article if it exists. */ |
| 78 | + |
76 | 79 | $article = new Article( $this->title ); |
77 | 80 | $oldid = $this->request->getVal('oldid', null); |
| 81 | + $editlink = $this->title->getFullURL( 'action=edit' ); |
78 | 82 | |
79 | 83 | if ( $article->exists() ) { |
80 | | - $edit = $this->title->getFullURL( 'action=edit' ); |
81 | | - $history = $this->title->getFullURL( 'action=history' ); |
| 84 | + $historylink = $this->title->getFullURL( 'action=history' ); |
82 | 85 | $this->openDiv('lqt_header_content'); |
83 | 86 | $this->showPostBody($article, $oldid); |
84 | 87 | $this->outputList('ul', 'lqt_header_commands', null, array( |
85 | | - "[<a href=\"$edit\">edit</a>]", |
86 | | - "[<a href=\"$history\">history</a>]" |
| 88 | + "[<a href=\"$editlink\">".wfMsg('edit')."</a>]", |
| 89 | + "[<a href=\"$historylink\">".wfMsg('history_short')."</a>]" |
87 | 90 | )); |
88 | 91 | $this->closeDiv(); |
89 | 92 | } else { |
90 | | - $this->output->addHTML("<p class=\"lqt_header_notice\">[<a href=\"{$this->title->getFullURL('action=edit')}\">add header</a>]</p>"); |
| 93 | + $this->output->addHTML("<p class=\"lqt_header_notice\">[<a href=\"$editlink\">".wfMsg('lqt_add_header')."</a>]</p>"); |
91 | 94 | } |
92 | 95 | } |
93 | 96 | |
— | — | @@ -103,7 +106,7 @@ |
104 | 107 | function show() { |
105 | 108 | global $wgHooks; |
106 | 109 | $wgHooks['SkinTemplateTabs'][] = array($this, 'customizeTabs'); |
107 | | - |
| 110 | + |
108 | 111 | $this->output->setPageTitle( $this->title->getTalkpage()->getPrefixedText() ); |
109 | 112 | $this->addJSandCSS(); |
110 | 113 | |
— | — | @@ -117,7 +120,7 @@ |
118 | 121 | $this->showNewThreadForm(); |
119 | 122 | } else { |
120 | 123 | $url = $this->talkpageUrl( $this->title, 'talkpage_new_thread' ); |
121 | | - $this->output->addHTML("<strong><a class=\"lqt_start_discussion\" href=\"$url\">Start a Discussion</a></strong>"); |
| 124 | + $this->output->addHTML("<strong><a class=\"lqt_start_discussion\" href=\"$url\">".wfMsg('lqt_new_thread')."</a></strong>"); |
122 | 125 | } |
123 | 126 | |
124 | 127 | $threads = $this->queries->query('fresh'); |
— | — | @@ -143,7 +146,7 @@ |
144 | 147 | ); if( $t->hasSummary() ) { |
145 | 148 | $this->showPostBody($t->summary()); |
146 | 149 | } else if ( $t->type() == Threads::TYPE_MOVED ) { |
147 | | - $this->output->addHTML("<i>Placeholder left when the thread was moved to another page.</i>"); |
| 150 | + $this->output->addWikiText(wfMsg('lqt_move_placeholder')); |
148 | 151 | } |
149 | 152 | $this->output->addHTML(<<<HTML |
150 | 153 | </td> |
— | — | @@ -432,9 +435,10 @@ |
433 | 436 | $talkpage_link = $this->user->getSkin()->makeKnownLinkObj($talkpage, '', $query); |
434 | 437 | |
435 | 438 | if ( $this->thread->hasSuperthread() ) { |
436 | | - $this->output->setSubtitle( "a fragment of <a href=\"{$this->permalinkUrl($this->thread->topmostThread())}\">a discussion</a> from " . $talkpage_link ); |
| 439 | + $subtitle=wfMsg('lqt_fragment',"<a href=\"{$this->permalinkUrl($this->thread->topmostThread())}\">".wfMsg('lqt_discussion_link')."</a>",$talkpage_link); |
| 440 | + $this->output->setSubtitle( $subtitle); |
437 | 441 | } else { |
438 | | - $this->output->setSubtitle( "from " . $talkpage_link ); |
| 442 | + $this->output->setSubtitle( wfMsg('lqt_from_talk', $talkpage_link)); |
439 | 443 | } |
440 | 444 | |
441 | 445 | if( $this->methodApplies('summarize') ) |
— | — | @@ -526,12 +530,12 @@ |
527 | 531 | /* TODO: best not to refer to LqtView class directly. */ |
528 | 532 | /* We don't use oldid because that has side-effects. */ |
529 | 533 | $result = array(); |
530 | | - $change_names = array(Threads::CHANGE_EDITED_ROOT => "Comment text edited:", |
531 | | - Threads::CHANGE_EDITED_SUMMARY => "Summary changed:", |
532 | | - Threads::CHANGE_REPLY_CREATED => "New reply created:", |
533 | | - Threads::CHANGE_NEW_THREAD => "New thread created:", |
534 | | - Threads::CHANGE_DELETED => "Deleted:", |
535 | | - Threads::CHANGE_UNDELETED => "Undeleted:"); |
| 534 | + $change_names = array( Threads::CHANGE_EDITED_ROOT => wfMsg('lqt_comment_edited'), |
| 535 | + Threads::CHANGE_EDITED_SUMMARY => wfMsg('lqt_summary_changed'), |
| 536 | + Threads::CHANGE_REPLY_CREATED => wfMsg('lqt_reply_created'), |
| 537 | + Threads::CHANGE_NEW_THREAD => wfMsg('lqt_thread_created'), |
| 538 | + Threads::CHANGE_DELETED => wfMsg('lqt_deleted'), |
| 539 | + Threads::CHANGE_UNDELETED => wfMsg('lqt_undeleted')); |
536 | 540 | $change_label = array_key_exists($t->changeType(), $change_names) ? $change_names[$t->changeType()] : ""; |
537 | 541 | |
538 | 542 | $url = LqtView::permalinkUrlWithQuery( $this->thread, 'lqt_oldid=' . $t->revisionNumber() ); |
— | — | @@ -541,11 +545,15 @@ |
542 | 546 | $sig = $this->user->getSkin()->userLink( $user_id, $user_text ) . |
543 | 547 | $this->user->getSkin()->userToolLinks( $user_id, $user_text ); |
544 | 548 | |
| 549 | + $change_comment=$t->changeComment(); |
| 550 | + if(!empty($change_comment)) |
| 551 | + $change_comment="<em>($change_comment)</em>"; |
| 552 | + |
545 | 553 | $result[] = "<tr>"; |
546 | 554 | $result[] = "<td><a href=\"$url\">" . $wgLang->timeanddate($t->timestamp()) . "</a></td>"; |
547 | 555 | $result[] = "<td>" . $sig . "</td>"; |
548 | 556 | $result[] = "<td>$change_label</td>"; |
549 | | - $result[] = "<td>" . $t->changeComment() . "</td>"; |
| 557 | + $result[] = "<td>$change_comment</td>"; |
550 | 558 | $result[] = "</tr>"; |
551 | 559 | return implode('', $result); |
552 | 560 | } |
— | — | @@ -568,7 +576,7 @@ |
569 | 577 | return false; |
570 | 578 | } |
571 | 579 | |
572 | | - $this->output->setSubtitle("Viewing a history listing."); |
| 580 | + $this->output->setSubtitle(wfMsg('lqt_history_subtitle')); |
573 | 581 | |
574 | 582 | $this->showThreadHeading($this->thread); |
575 | 583 | $this->showHistoryListing($this->thread); |
— | — | @@ -891,4 +899,5 @@ |
892 | 900 | SpecialPage::addPage( new SpecialDeleteThread() ); |
893 | 901 | } |
894 | 902 | |
| 903 | + |
895 | 904 | ?> |
Index: branches/liquidthreads/extensions/LqtBaseView.php |
— | — | @@ -437,20 +437,20 @@ |
438 | 438 | |
439 | 439 | $user_can_edit = $thread->root()->getTitle()->quickUserCan( 'edit' ); |
440 | 440 | |
441 | | - $commands[] = array( 'label' => $user_can_edit ? 'Edit' : 'View source', |
| 441 | + $commands[] = array( 'label' => $user_can_edit ? wfMsg('edit') : wfMsg('viewsource'), |
442 | 442 | 'href' => $this->talkpageUrl( $this->title, 'edit', $thread ), |
443 | 443 | 'enabled' => true ); |
444 | 444 | |
445 | | - $commands[] = array( 'label' => 'Reply', |
| 445 | + $commands[] = array( 'label' => wfMsg('lqt_reply'), |
446 | 446 | 'href' => $this->talkpageUrl( $this->title, 'reply', $thread ), |
447 | 447 | 'enabled' => $user_can_edit ); |
448 | 448 | |
449 | | - $commands[] = array( 'label' => 'Permalink', |
| 449 | + $commands[] = array( 'label' => wfMsg('lqt_permalink'), |
450 | 450 | 'href' => $this->permalinkUrl( $thread ), |
451 | 451 | 'enabled' => true ); |
452 | 452 | |
453 | 453 | if( !$thread->hasSuperthread() ) { |
454 | | - $commands[] = array( 'label' => 'History', |
| 454 | + $commands[] = array( 'label' => wfMsg('history_short'), |
455 | 455 | 'href' => $this->permalinkUrlWithQuery($thread, 'action=history'), |
456 | 456 | 'enabled' => true ); |
457 | 457 | } |
— | — | @@ -458,7 +458,7 @@ |
459 | 459 | if ( in_array('delete', $this->user->getRights()) ) { |
460 | 460 | $delete_url = SpecialPage::getPage('Deletethread')->getTitle()->getFullURL() |
461 | 461 | . '/' . $thread->title()->getPrefixedURL(); |
462 | | - $commands[] = array( 'label' => $thread->type() == Threads::TYPE_DELETED ? 'Undelete' : 'Delete', |
| 462 | + $commands[] = array( 'label' => $thread->type() == Threads::TYPE_DELETED ? wfMsg('lqt_undelete') : wfMsg('delete'), |
463 | 463 | 'href' => $delete_url, |
464 | 464 | 'enabled' => true ); |
465 | 465 | } |