Index: trunk/extensions/SocialProfile/UserActivity/UserActivity.i18n.php |
— | — | @@ -16,24 +16,30 @@ |
17 | 17 | 'useractivity' => "Friends' activity", |
18 | 18 | 'useractivity-award' => '$1 received an award', |
19 | 19 | 'useractivity-all' => 'View all', |
20 | | - #'useractivity-comment' => '{{PLURAL:$1|commented on the page|commented on the following pages: }}', |
21 | | - #'useractivity-commentedpage' => 'commented on the page', |
22 | | - 'useractivity-edit' => '$1 {{PLURAL:$4|edited the page|edited the following pages:}} $3', |
23 | | - 'useractivity-foe' => '$1 {{PLURAL:$2|is now foes with|are now foes with}} $3', |
24 | | - 'useractivity-friend' => '$1 {{PLURAL:$2|is now friends with|are now friends with}} $3', |
25 | | - 'useractivity-gift' => '$1 received a gift from $2', |
26 | | - #'useractivity-gift-sent' => 'sent a gift to', |
27 | | - 'useractivity-group-edit' => '{{PLURAL:$1|one edit|$1 edits}}', |
28 | | - 'useractivity-group-comment' => '{{PLURAL:$1|one comment|$1 comments}}', |
29 | | - 'useractivity-group-user_message' => '{{PLURAL:$1|one message|$1 messages}}', |
30 | | - 'useractivity-group-friend' => '{{PLURAL:$1|one friend|$1 friends}}', |
31 | | - #'useractivity-filter' => 'Filter', |
| 20 | + 'useractivity-edit' => '$1 {{PLURAL:$4|edited the page|edited the following pages:}} $3', // Supports GENDER for the editor ($1) as $6 if $1 is one user. |
| 21 | + 'useractivity-foe' => '$1 {{PLURAL:$2|is now foes with|are now foes with}} $3', // Supports GENDER for $1 as $6 if $1 is one user. |
| 22 | + 'useractivity-friend' => '$1 {{PLURAL:$2|is now friends with|are now friends with}} $3', // Supports GENDER for the $1 as $6 if $1 is one user. |
| 23 | + 'useractivity-gift' => '$1 received a gift from $2', // Supports GENDER for the editor ($1) as $6 if $1 is one user. |
| 24 | + 'useractivity-group-edit' => '{{PLURAL:$1|one edit|$1 edits}}', // Supports GENDER for the one having made edits as $2 |
| 25 | + 'useractivity-group-comment' => '{{PLURAL:$1|one comment|$1 comments}}', // Supports GENDER for the one having made comments as $2 |
| 26 | + 'useractivity-group-user_message' => '{{PLURAL:$1|one message|$1 messages}}', // Supports GENDER for the one having messages as $2 |
| 27 | + 'useractivity-group-friend' => '{{PLURAL:$1|one friend|$1 friends}}', // Supports GENDER for the one having friends as $2 |
32 | 28 | 'useractivity-siteactivity' => 'Site activity', |
33 | 29 | 'useractivity-title' => "Friends' activity", |
34 | | - 'useractivity-user_message' => '$1 {{PLURAL:$4|sent a message to|sent messages to}} $3', |
35 | | - #'useractivity-votedpage' => 'voted for the page', |
| 30 | + 'useractivity-user_message' => '$1 {{PLURAL:$4|sent a message to|sent messages to}} $3', // Supports GENDER for the sender ($1) as $6 if $1 is one user. |
36 | 31 | ); |
37 | 32 | |
| 33 | +$messages['qqq'] = array( |
| 34 | + 'useractivity-edit' => 'Supports GENDER for the editor ($1) as $6 if $1 is one user.', |
| 35 | + 'useractivity-foe' => 'Supports GENDER for $1 as $6 if $1 is one user.', |
| 36 | + 'useractivity-friend' => 'Supports GENDER for the $1 as $6 if $1 is one user.', |
| 37 | + 'useractivity-gift' => 'Supports GENDER for the editor ($1) as $6 if $1 is one user.', |
| 38 | + 'useractivity-group-edit' => 'Supports GENDER for the one having made edits as $2', |
| 39 | + 'useractivity-group-comment' => 'Supports GENDER for the one having made comments as $2', |
| 40 | + 'useractivity-group-user_message' => 'Supports GENDER for the one having messages as $2', |
| 41 | + 'useractivity-group-friend' => 'Supports GENDER for the one having friends as $2', |
| 42 | + 'useractivity-user_message' => 'Supports GENDER for the sender ($1) as $6 if $1 is one user.', |
| 43 | +); |
38 | 44 | /** Afrikaans (Afrikaans) |
39 | 45 | * @author Naudefj |
40 | 46 | */ |
Index: trunk/extensions/SocialProfile/UserActivity/UserActivityClass.php |
— | — | @@ -84,7 +84,7 @@ |
85 | 85 | $res = $dbr->query( $sql, __METHOD__ ); |
86 | 86 | |
87 | 87 | while ( $row = $dbr->fetchObject( $res ) ) { |
88 | | - // Special pages aren't editable, so ignore 'em |
| 88 | + // Special pages aren't editable, so ignore them |
89 | 89 | if ( $row->rc_namespace == NS_SPECIAL ) { |
90 | 90 | continue; |
91 | 91 | } |
— | — | @@ -670,7 +670,7 @@ |
671 | 671 | $pages = ''; |
672 | 672 | |
673 | 673 | if ( $type == 'friend' || $type == 'foe' || $type == 'user_message' ) { |
674 | | - $page_title = Title::newFromText( 'User:' . $page_name ); |
| 674 | + $page_title = Title::newFromText( $page_name, NS_USER ); |
675 | 675 | } else { |
676 | 676 | $page_title = Title::newFromText( $page_name ); |
677 | 677 | } |
— | — | @@ -679,8 +679,11 @@ |
680 | 680 | $user_index = 0; |
681 | 681 | $pages_count = 0; |
682 | 682 | |
| 683 | + // Init empty variable to be used later on for GENDER processing |
| 684 | + // if the event is only for one user. |
| 685 | + $userNameForGender = ''; |
| 686 | + |
683 | 687 | foreach ( $page_data['users'] as $user_name => $action ) { |
684 | | - |
685 | 688 | if ( $page_data['timestamp'] < $this->three_days_ago ) { |
686 | 689 | continue; |
687 | 690 | } |
— | — | @@ -692,7 +695,8 @@ |
693 | 696 | |
694 | 697 | $pages .= " <a href=\"{$page_title->escapeFullURL()}\">{$page_name}</a>"; |
695 | 698 | if ( $count_users == 1 && $count_actions > 1 ) { |
696 | | - $pages .= ' (' . wfMsgExt( "useractivity-group-{$type}", 'parsemag', $count_actions ) . ')'; |
| 699 | + $pages .= wfMsg( 'word-separator' ); |
| 700 | + $pages .= wfMsg( 'parentheses', wfMsgExt( "useractivity-group-{$type}", 'parsemag', $count_actions, $user_name ) ); |
697 | 701 | } |
698 | 702 | $pages_count++; |
699 | 703 | } |
— | — | @@ -700,6 +704,7 @@ |
701 | 705 | // Single user on this action, |
702 | 706 | // see if we can stack any other singles |
703 | 707 | if ( $count_users == 1 ) { |
| 708 | + $userNameForGender = $user_name; |
704 | 709 | foreach ( $this->items_grouped[$type] as $page_name2 => $page_data2 ) { |
705 | 710 | if ( !isset( $this->displayed[$type][$page_name2] ) && |
706 | 711 | count( $page_data2['users'] ) == 1 |
— | — | @@ -713,7 +718,7 @@ |
714 | 719 | $type == 'foe' || |
715 | 720 | $type == 'user_message' |
716 | 721 | ) { |
717 | | - $page_title2 = Title::newFromText( 'User:' . $page_name2 ); |
| 722 | + $page_title2 = Title::newFromText( $page_name2, NS_USER ); |
718 | 723 | } else { |
719 | 724 | $page_title2 = Title::newFromText( $page_name2 ); |
720 | 725 | } |
— | — | @@ -739,7 +744,7 @@ |
740 | 745 | $user_index++; |
741 | 746 | |
742 | 747 | if ( $users && $count_users > 2 ) { |
743 | | - $users .= ', '; |
| 748 | + $users .= wfMsg( 'comma-separator' ); |
744 | 749 | } |
745 | 750 | if ( $user_index == $count_users && $count_users > 1 ) { |
746 | 751 | $users .= wfMsg( 'and' ); |
— | — | @@ -748,7 +753,7 @@ |
749 | 754 | $user_title = Title::makeTitle( NS_USER, $user_name ); |
750 | 755 | $user_name_short = substr( $user_name, 0, 15 ); |
751 | 756 | if ( $user_name != $user_name_short ) { |
752 | | - $user_name_short .= '...'; |
| 757 | + $user_name_short .= wfMsg( 'ellipsis' ); |
753 | 758 | } |
754 | 759 | |
755 | 760 | $users .= " <b><a href=\"{$user_title->escapeFullURL()}\">{$user_name_short}</a></b>"; |
— | — | @@ -758,8 +763,9 @@ |
759 | 764 | 'type' => $type, |
760 | 765 | 'timestamp' => $page_data['timestamp'], |
761 | 766 | 'data' => wfMsgExt( |
762 | | - "useractivity-{$type}", 'parsemag', |
763 | | - $users, $count_users, $pages, $pages_count |
| 767 | + "useractivity-{$type}", |
| 768 | + 'parsemag', |
| 769 | + $users, $count_users, $pages, $pages_count, $userNameForGender |
764 | 770 | ) |
765 | 771 | ); |
766 | 772 | } |
Index: trunk/extensions/SocialProfile/UserActivity/UserActivity.body.php |
— | — | @@ -1,7 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | class UserHome extends SpecialPage { |
5 | | - |
6 | 5 | /** |
7 | 6 | * Constructor |
8 | 7 | */ |
— | — | @@ -62,32 +61,6 @@ |
63 | 62 | $messages_sent = 1; |
64 | 63 | } |
65 | 64 | |
66 | | - /* |
67 | | - $output .= '<div class="user-home-links-container"> |
68 | | - <h2>' . wfMsg( 'useractivity-filter' ) . '</h2> |
69 | | - <div class="user-home-links">'; |
70 | | - |
71 | | - $lines = explode( "\n", wfMsgForContent( 'useractivity-filter' ) ); |
72 | | - foreach( $lines as $line ) { |
73 | | - if( strpos( $line, '*' ) !== 0 ) { |
74 | | - continue; |
75 | | - } else { |
76 | | - $line = explode( '|' , trim( $line, '* ' ), 3 ); |
77 | | - $filter = $line[0]; |
78 | | - $link_text = $line[1]; |
79 | | - $link_image = $line[2]; |
80 | | - $output .= '<a href="' . $this_title->escapeFullURL( "item_type={$filter}" ) . "\"> |
81 | | - <img src=\"{$wgScriptPath}/extensions/SocialProfile/images/" . UserActivity::getTypeIcon( $link_image ) . "\"/> |
82 | | - {$link_text} |
83 | | - </a>"; |
84 | | - } |
85 | | - } |
86 | | - |
87 | | - $output .= '<a href="' . $this_title->escapeFullURL() . '">' . wfMsg( 'useractivity-all' ) . '</a> |
88 | | - </div> |
89 | | - </div> |
90 | | - */ |
91 | | - |
92 | 65 | $output .= '<div class="user-home-feed">'; |
93 | 66 | |
94 | 67 | $rel = new UserActivity( $wgUser->getName(), ( ( $rel_type == 1 ) ? ' friends' : 'foes' ), 50 ); |