http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90902
Revision: 90902
Author: reedy
Date: 2011-06-27 20:03:59 +0000 (Mon, 27 Jun 2011)
Log Message:
-----------
* (bug 28259) Localise CR Tooltips
Modified Paths:
--------------
trunk/extensions/CodeReview/CodeReview.i18n.php
trunk/extensions/CodeReview/CodeReview.php
trunk/extensions/CodeReview/backend/CodeRevision.php
trunk/extensions/CodeReview/modules/ext.codereview.tooltips.js
Modified: trunk/extensions/CodeReview/CodeReview.i18n.php
===================================================================
--- trunk/extensions/CodeReview/CodeReview.i18n.php 2011-06-27 19:38:30 UTC
(rev 90901)
+++ trunk/extensions/CodeReview/CodeReview.i18n.php 2011-06-27 20:03:59 UTC
(rev 90902)
@@ -206,6 +206,9 @@
'code-stats-new-breakdown' => 'Breakdown of new revisions per author',
'code-stats-count' => 'Number of revisions',
+ 'code-tooltip-withsummary' => 'r$1 [$2] by $3 - $4',
+ 'code-tooltip-withoutsummary' => 'r$1 [$2] by $3',
+
'repoadmin' => 'Repository Administration',
'repoadmin-new-legend' => 'Create a new repository',
'repoadmin-new-label' => 'Repository name:',
@@ -301,7 +304,7 @@
* {{msg-mw|code-signoff-flag-inspected}}
* {{msg-mw|code-signoff-flag-tested}}',
'code-signoff-field-date' => 'Table column header: timestamp of the
sign-off. {{Identical|Date}}',
- '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.
+ '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.
Struck is the past tense of verb strike (as in delete).',
'code-pathsearch-path' => '{{Identical|Path}}',
'code-revfilter-cr_status' => '{{Identical|Status}}',
@@ -1004,7 +1007,7 @@
'codereview-email-body' => '"$1" ҡулланыусыһы $3 өсөн аңлатма өҫтәне.
Тулы URL: $2
-Ҡыҫҡаса тасуирлама:
+Ҡыҫҡаса тасуирлама:
$5
@@ -1015,7 +1018,7 @@
'codereview-email-body2' => '"$1" ҡатнашыусыһы $2 өлгөһөнә артабанғы
үҙгәрештәр кереткән.
Алдағы өлгөнөң тулы URL адресы: $5
-Ҡыҫҡаса тасуирлама:
+Ҡыҫҡаса тасуирлама:
$6
@@ -1814,7 +1817,7 @@
Postet ez eus bet un evezhiadenn war $2 gant an implijer "$1" ivez.
URL klok : $5
-Diverrañ eus ar c\'hemmoù :
+Diverrañ eus ar c\'hemmoù :
$7
@@ -2861,7 +2864,7 @@
'codereview-subtitle' => 'Qe $1',
'codereview-reply-link' => 'cewab bide',
'codereview-email-subj' => '[$1 $2]: Xulasayê newî de biyo',
- 'codereview-email-body' => 'Karberê "$1"î yew xulasa se $3 rê nuşt.
+ 'codereview-email-body' => 'Karberê "$1"î yew xulasa se $3 rê nuşt.
Full URL: $2
@@ -2869,7 +2872,7 @@
$4',
'codereview-email-subj2' => '[$1 $2]: Vurnayîşan kontrol bike',
- 'codereview-email-body2' => 'Karberê "$1"î, $2 vurna.
+ 'codereview-email-body2' => 'Karberê "$1"î, $2 vurna.
Full URL: $3
@@ -2877,7 +2880,7 @@
$4',
'codereview-email-subj3' => '[$1 $2]: Regression otomatik test keno',
- 'codereview-email-body3' => 'Qe vurnayîşê $1î otomatik test yew
regression mucna.
+ 'codereview-email-body3' => 'Qe vurnayîşê $1î otomatik test yew
regression mucna.
Full URL: $2
@@ -3215,7 +3218,7 @@
$6
Πλήρες URL: $3
-Σύνοψη της καταχώρησης:
+Σύνοψη της καταχώρησης:
$4',
'codereview-email-subj3' => '[$1 $2]: Η κατάσταση της αλλαγής άλλαξε',
@@ -3237,7 +3240,7 @@
Ο χρήστης "$1" επίσης απέστειλε σχόλιο για το $2.
Πλήρες URL: $5
-Σύνοψη της καταχώρησης:
+Σύνοψη της καταχώρησης:
$7
@@ -4451,7 +4454,7 @@
$4',
'codereview-email-subj3' => '[$1 $2] : l’état de la version a changé',
- 'codereview-email-body3' => 'L’utilisateur « $1 » a modifié l’état de
$2.
+ 'codereview-email-body3' => 'L’utilisateur « $1 » a modifié l’état de
$2.
Ancien état : $3
Nouvel état : $4
@@ -8440,7 +8443,7 @@
$7
-അഭിപ്രായം:
+അഭിപ്രായം:
$6',
'code-stats' => 'സ്ഥിതിവിവരക്കണക്കുകൾ',
@@ -13013,7 +13016,7 @@
$4',
'codereview-email-subj3' => '[$1 $2]: Awtomatik synag regressiýany ýüze
çykardy',
- 'codereview-email-body3' => '$1 üçin üýtgeşmeler zerarly awtomatik
synag bir regressiýany ýüze çykardy.
+ 'codereview-email-body3' => '$1 üçin üýtgeşmeler zerarly awtomatik
synag bir regressiýany ýüze çykardy.
Doly URL: $2
@@ -13216,7 +13219,7 @@
Nagpaskil din ang tagagamit na si "$1" ng isang puna sa $2.
Buong URL: $5
-Buod ng pagsasagawa:
+Buod ng pagsasagawa:
$7
Modified: trunk/extensions/CodeReview/CodeReview.php
===================================================================
--- trunk/extensions/CodeReview/CodeReview.php 2011-06-27 19:38:30 UTC (rev
90901)
+++ trunk/extensions/CodeReview/CodeReview.php 2011-06-27 20:03:59 UTC (rev
90902)
@@ -168,7 +168,8 @@
// Revision tooltips CodeRevisionView:
$wgResourceModules['ext.codereview.tooltips'] = array(
'scripts' => 'ext.codereview.tooltips.js',
- 'dependencies' => 'jquery.tipsy'
+ 'dependencies' => 'jquery.tipsy',
+ 'messages' => array_merge( CodeRevision::getPossibleStateMessageKeys(),
array( 'code-tooltip-withsummary', 'code-tooltip-withoutsummary' ) ),
) + $commonModuleInfo;
// Revision 'scapmap':
@@ -203,7 +204,7 @@
/**
* The maximum number of paths that we will perform a diff on.
- * If a revision contains more changed paths than this, we will skip getting
the
+ * If a revision contains more changed paths than this, we will skip getting
the
* diff altogether.
* May be set to 0 to indicate no limit.
*/
Modified: trunk/extensions/CodeReview/backend/CodeRevision.php
===================================================================
--- trunk/extensions/CodeReview/backend/CodeRevision.php 2011-06-27
19:38:30 UTC (rev 90901)
+++ trunk/extensions/CodeReview/backend/CodeRevision.php 2011-06-27
20:03:59 UTC (rev 90902)
@@ -240,6 +240,20 @@
}
/**
+ * @return array
+ */
+ public static function getPossibleStateMessageKeys() {
+ return array_map( array( 'self', 'makeStateMessageKey'),
self::getPossibleStates() );
+ }
+
+ /**
+ * @param $key string
+ * @return string
+ */
+ private static function makeStateMessageKey( $key ) {
+ return "code-status-$key";
+ }
+ /**
* List of all flags a user can mark themself as having done to a
revision
* @return Array
*/
@@ -446,7 +460,7 @@
// No sense in notifying the author of
this rev if they are a commenter/the author on the target rev
if ( $commitAuthorId == $user->getId()
) {
continue;
- }
+ }
if ( $user->canReceiveEmail() ) {
// Send message in receiver's
language
Modified: trunk/extensions/CodeReview/modules/ext.codereview.tooltips.js
===================================================================
--- trunk/extensions/CodeReview/modules/ext.codereview.tooltips.js
2011-06-27 19:38:30 UTC (rev 90901)
+++ trunk/extensions/CodeReview/modules/ext.codereview.tooltips.js
2011-06-27 20:03:59 UTC (rev 90902)
@@ -12,7 +12,7 @@
if ( !matches ) {
return;
}
-
+
function showTooltip() {
var $el = $( this );
if ( $el.data('codeTooltip') ) {
@@ -45,10 +45,19 @@
var tip = '<div
class="mw-codereview-status-' + status + '" style="padding:5px 8px 4px;
margin:-5px -8px -4px;">'
+ 'r' + matches[2]
- + ' [' + status + '] by '
+ + ' [' + mw.msg(
'codereview-status-' + status ) + '] by '
+ author
+ ( rev['*'] ? ' - ' + text :
'' )
+ '</div>';
+
+ var tip = '<div
class="mw-codereview-status-' + status + '" style="padding:5px 8px 4px;
margin:-5px -8px -4px;">';
+
+ if ( rev[*] ) {
+ tip += mw.msg(
'code-tooltip-withsummary', matches[2], mw.msg( 'codereview-status-' + status
), author, text );
+ } else {
+ tip += mw.msg(
'code-tooltip-withoutsummary', matches[2], mw.msg( 'codereview-status-' +
status ), author );
+ }
+ tip += '</div>';
$el.attr( 'title', tip );
$el.data( 'codeTooltip', true );
if ( !$el.data( 'codeTooltipLeft' ) ) {
@@ -57,7 +66,7 @@
}
);
}
-
+
// We want to avoid doing API calls just because someone
accidentally moves the mouse
// over a link, so we only want to do an API call after the
mouse has been on a link
// for 250ms.
@@ -80,7 +89,7 @@
// Clear the running timer
clearTimeout( timerID );
}
-
+
if ( $el.data( 'codeTooltip' ) || !$el.data(
'codeTooltipLoading' ) ) {
return;
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs