Index: trunk/extensions/CodeReview/CodeReview.php |
— | — | @@ -168,7 +168,8 @@ |
169 | 169 | // Revision tooltips CodeRevisionView: |
170 | 170 | $wgResourceModules['ext.codereview.tooltips'] = array( |
171 | 171 | 'scripts' => 'ext.codereview.tooltips.js', |
172 | | - 'dependencies' => 'jquery.tipsy' |
| 172 | + 'dependencies' => 'jquery.tipsy', |
| 173 | + 'messages' => array_merge( CodeRevision::getPossibleStateMessageKeys(), array( 'code-tooltip-withsummary', 'code-tooltip-withoutsummary' ) ), |
173 | 174 | ) + $commonModuleInfo; |
174 | 175 | |
175 | 176 | // Revision 'scapmap': |
— | — | @@ -203,7 +204,7 @@ |
204 | 205 | |
205 | 206 | /** |
206 | 207 | * The maximum number of paths that we will perform a diff on. |
207 | | - * If a revision contains more changed paths than this, we will skip getting the |
| 208 | + * If a revision contains more changed paths than this, we will skip getting the |
208 | 209 | * diff altogether. |
209 | 210 | * May be set to 0 to indicate no limit. |
210 | 211 | */ |
Index: trunk/extensions/CodeReview/backend/CodeRevision.php |
— | — | @@ -240,6 +240,20 @@ |
241 | 241 | } |
242 | 242 | |
243 | 243 | /** |
| 244 | + * @return array |
| 245 | + */ |
| 246 | + public static function getPossibleStateMessageKeys() { |
| 247 | + return array_map( array( 'self', 'makeStateMessageKey'), self::getPossibleStates() ); |
| 248 | + } |
| 249 | + |
| 250 | + /** |
| 251 | + * @param $key string |
| 252 | + * @return string |
| 253 | + */ |
| 254 | + private static function makeStateMessageKey( $key ) { |
| 255 | + return "code-status-$key"; |
| 256 | + } |
| 257 | + /** |
244 | 258 | * List of all flags a user can mark themself as having done to a revision |
245 | 259 | * @return Array |
246 | 260 | */ |
— | — | @@ -446,7 +460,7 @@ |
447 | 461 | // No sense in notifying the author of this rev if they are a commenter/the author on the target rev |
448 | 462 | if ( $commitAuthorId == $user->getId() ) { |
449 | 463 | continue; |
450 | | - } |
| 464 | + } |
451 | 465 | |
452 | 466 | if ( $user->canReceiveEmail() ) { |
453 | 467 | // Send message in receiver's language |
Index: trunk/extensions/CodeReview/CodeReview.i18n.php |
— | — | @@ -206,6 +206,9 @@ |
207 | 207 | 'code-stats-new-breakdown' => 'Breakdown of new revisions per author', |
208 | 208 | 'code-stats-count' => 'Number of revisions', |
209 | 209 | |
| 210 | + 'code-tooltip-withsummary' => 'r$1 [$2] by $3 - $4', |
| 211 | + 'code-tooltip-withoutsummary' => 'r$1 [$2] by $3', |
| 212 | + |
210 | 213 | 'repoadmin' => 'Repository Administration', |
211 | 214 | 'repoadmin-new-legend' => 'Create a new repository', |
212 | 215 | 'repoadmin-new-label' => 'Repository name:', |
— | — | @@ -301,7 +304,7 @@ |
302 | 305 | * {{msg-mw|code-signoff-flag-inspected}} |
303 | 306 | * {{msg-mw|code-signoff-flag-tested}}', |
304 | 307 | 'code-signoff-field-date' => 'Table column header: timestamp of the sign-off. {{Identical|Date}}', |
305 | | - 'code-signoff-struckdate' => 'This is displayed in the date column for a struck sign-off. $1 is the timestamp of the sign-off, $2 is the timestamp of when it was struck. |
| 308 | + 'code-signoff-struckdate' => 'This is displayed in the date column for a struck sign-off. $1 is the timestamp of the sign-off, $2 is the timestamp of when it was struck. |
306 | 309 | Struck is the past tense of verb strike (as in delete).', |
307 | 310 | 'code-pathsearch-path' => '{{Identical|Path}}', |
308 | 311 | 'code-revfilter-cr_status' => '{{Identical|Status}}', |
— | — | @@ -1004,7 +1007,7 @@ |
1005 | 1008 | 'codereview-email-body' => '"$1" ҡулланыусыһы $3 өсөн аңлатма өҫтәне. |
1006 | 1009 | |
1007 | 1010 | Тулы URL: $2 |
1008 | | -Ҡыҫҡаса тасуирлама: |
| 1011 | +Ҡыҫҡаса тасуирлама: |
1009 | 1012 | |
1010 | 1013 | $5 |
1011 | 1014 | |
— | — | @@ -1015,7 +1018,7 @@ |
1016 | 1019 | 'codereview-email-body2' => '"$1" ҡатнашыусыһы $2 өлгөһөнә артабанғы үҙгәрештәр кереткән. |
1017 | 1020 | |
1018 | 1021 | Алдағы өлгөнөң тулы URL адресы: $5 |
1019 | | -Ҡыҫҡаса тасуирлама: |
| 1022 | +Ҡыҫҡаса тасуирлама: |
1020 | 1023 | |
1021 | 1024 | $6 |
1022 | 1025 | |
— | — | @@ -1814,7 +1817,7 @@ |
1815 | 1818 | Postet ez eus bet un evezhiadenn war $2 gant an implijer "$1" ivez. |
1816 | 1819 | |
1817 | 1820 | URL klok : $5 |
1818 | | -Diverrañ eus ar c\'hemmoù : |
| 1821 | +Diverrañ eus ar c\'hemmoù : |
1819 | 1822 | |
1820 | 1823 | $7 |
1821 | 1824 | |
— | — | @@ -2861,7 +2864,7 @@ |
2862 | 2865 | 'codereview-subtitle' => 'Qe $1', |
2863 | 2866 | 'codereview-reply-link' => 'cewab bide', |
2864 | 2867 | 'codereview-email-subj' => '[$1 $2]: Xulasayê newî de biyo', |
2865 | | - 'codereview-email-body' => 'Karberê "$1"î yew xulasa se $3 rê nuşt. |
| 2868 | + 'codereview-email-body' => 'Karberê "$1"î yew xulasa se $3 rê nuşt. |
2866 | 2869 | |
2867 | 2870 | Full URL: $2 |
2868 | 2871 | |
— | — | @@ -2869,7 +2872,7 @@ |
2870 | 2873 | |
2871 | 2874 | $4', |
2872 | 2875 | 'codereview-email-subj2' => '[$1 $2]: Vurnayîşan kontrol bike', |
2873 | | - 'codereview-email-body2' => 'Karberê "$1"î, $2 vurna. |
| 2876 | + 'codereview-email-body2' => 'Karberê "$1"î, $2 vurna. |
2874 | 2877 | |
2875 | 2878 | Full URL: $3 |
2876 | 2879 | |
— | — | @@ -2877,7 +2880,7 @@ |
2878 | 2881 | |
2879 | 2882 | $4', |
2880 | 2883 | 'codereview-email-subj3' => '[$1 $2]: Regression otomatik test keno', |
2881 | | - 'codereview-email-body3' => 'Qe vurnayîşê $1î otomatik test yew regression mucna. |
| 2884 | + 'codereview-email-body3' => 'Qe vurnayîşê $1î otomatik test yew regression mucna. |
2882 | 2885 | |
2883 | 2886 | Full URL: $2 |
2884 | 2887 | |
— | — | @@ -3215,7 +3218,7 @@ |
3216 | 3219 | $6 |
3217 | 3220 | |
3218 | 3221 | Πλήρες URL: $3 |
3219 | | -Σύνοψη της καταχώρησης: |
| 3222 | +Σύνοψη της καταχώρησης: |
3220 | 3223 | |
3221 | 3224 | $4', |
3222 | 3225 | 'codereview-email-subj3' => '[$1 $2]: Η κατάσταση της αλλαγής άλλαξε', |
— | — | @@ -3237,7 +3240,7 @@ |
3238 | 3241 | Ο χρήστης "$1" επίσης απέστειλε σχόλιο για το $2. |
3239 | 3242 | |
3240 | 3243 | Πλήρες URL: $5 |
3241 | | -Σύνοψη της καταχώρησης: |
| 3244 | +Σύνοψη της καταχώρησης: |
3242 | 3245 | |
3243 | 3246 | $7 |
3244 | 3247 | |
— | — | @@ -4451,7 +4454,7 @@ |
4452 | 4455 | |
4453 | 4456 | $4', |
4454 | 4457 | 'codereview-email-subj3' => '[$1 $2] : l’état de la version a changé', |
4455 | | - 'codereview-email-body3' => 'L’utilisateur « $1 » a modifié l’état de $2. |
| 4458 | + 'codereview-email-body3' => 'L’utilisateur « $1 » a modifié l’état de $2. |
4456 | 4459 | |
4457 | 4460 | Ancien état : $3 |
4458 | 4461 | Nouvel état : $4 |
— | — | @@ -8440,7 +8443,7 @@ |
8441 | 8444 | |
8442 | 8445 | $7 |
8443 | 8446 | |
8444 | | -അഭിപ്രായം: |
| 8447 | +അഭിപ്രായം: |
8445 | 8448 | |
8446 | 8449 | $6', |
8447 | 8450 | 'code-stats' => 'സ്ഥിതിവിവരക്കണക്കുകൾ', |
— | — | @@ -13013,7 +13016,7 @@ |
13014 | 13017 | |
13015 | 13018 | $4', |
13016 | 13019 | 'codereview-email-subj3' => '[$1 $2]: Awtomatik synag regressiýany ýüze çykardy', |
13017 | | - 'codereview-email-body3' => '$1 üçin üýtgeşmeler zerarly awtomatik synag bir regressiýany ýüze çykardy. |
| 13020 | + 'codereview-email-body3' => '$1 üçin üýtgeşmeler zerarly awtomatik synag bir regressiýany ýüze çykardy. |
13018 | 13021 | |
13019 | 13022 | Doly URL: $2 |
13020 | 13023 | |
— | — | @@ -13216,7 +13219,7 @@ |
13217 | 13220 | Nagpaskil din ang tagagamit na si "$1" ng isang puna sa $2. |
13218 | 13221 | |
13219 | 13222 | Buong URL: $5 |
13220 | | -Buod ng pagsasagawa: |
| 13223 | +Buod ng pagsasagawa: |
13221 | 13224 | |
13222 | 13225 | $7 |
13223 | 13226 | |
Index: trunk/extensions/CodeReview/modules/ext.codereview.tooltips.js |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | if ( !matches ) { |
14 | 14 | return; |
15 | 15 | } |
16 | | - |
| 16 | + |
17 | 17 | function showTooltip() { |
18 | 18 | var $el = $( this ); |
19 | 19 | if ( $el.data('codeTooltip') ) { |
— | — | @@ -45,10 +45,19 @@ |
46 | 46 | |
47 | 47 | var tip = '<div class="mw-codereview-status-' + status + '" style="padding:5px 8px 4px; margin:-5px -8px -4px;">' |
48 | 48 | + 'r' + matches[2] |
49 | | - + ' [' + status + '] by ' |
| 49 | + + ' [' + mw.msg( 'codereview-status-' + status ) + '] by ' |
50 | 50 | + author |
51 | 51 | + ( rev['*'] ? ' - ' + text : '' ) |
52 | 52 | + '</div>'; |
| 53 | + |
| 54 | + var tip = '<div class="mw-codereview-status-' + status + '" style="padding:5px 8px 4px; margin:-5px -8px -4px;">'; |
| 55 | + |
| 56 | + if ( rev[*] ) { |
| 57 | + tip += mw.msg( 'code-tooltip-withsummary', matches[2], mw.msg( 'codereview-status-' + status ), author, text ); |
| 58 | + } else { |
| 59 | + tip += mw.msg( 'code-tooltip-withoutsummary', matches[2], mw.msg( 'codereview-status-' + status ), author ); |
| 60 | + } |
| 61 | + tip += '</div>'; |
53 | 62 | $el.attr( 'title', tip ); |
54 | 63 | $el.data( 'codeTooltip', true ); |
55 | 64 | if ( !$el.data( 'codeTooltipLeft' ) ) { |
— | — | @@ -57,7 +66,7 @@ |
58 | 67 | } |
59 | 68 | ); |
60 | 69 | } |
61 | | - |
| 70 | + |
62 | 71 | // We want to avoid doing API calls just because someone accidentally moves the mouse |
63 | 72 | // over a link, so we only want to do an API call after the mouse has been on a link |
64 | 73 | // for 250ms. |
— | — | @@ -80,7 +89,7 @@ |
81 | 90 | // Clear the running timer |
82 | 91 | clearTimeout( timerID ); |
83 | 92 | } |
84 | | - |
| 93 | + |
85 | 94 | if ( $el.data( 'codeTooltip' ) || !$el.data( 'codeTooltipLoading' ) ) { |
86 | 95 | return; |
87 | 96 | } |