http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88507
Revision: 88507
Author: bawolff
Date: 2011-05-21 03:41:16 +0000 (Sat, 21 May 2011)
Log Message:
-----------
(bug 29031) When translating block log entries, indefinite, infinite, and
infinity are now considered the same.
Before it just looked at the translations of the options for the drop down on
special:block, now it still does that, but if that fails, and the string
is infinite/indefinite/infinity, it will also check for the synonyms.
Modified Paths:
--------------
trunk/phase3/RELEASE-NOTES-1.19
trunk/phase3/languages/Language.php
Modified: trunk/phase3/RELEASE-NOTES-1.19
===================================================================
--- trunk/phase3/RELEASE-NOTES-1.19 2011-05-21 01:09:07 UTC (rev 88506)
+++ trunk/phase3/RELEASE-NOTES-1.19 2011-05-21 03:41:16 UTC (rev 88507)
@@ -88,6 +88,8 @@
changes to languages because of Bugzilla reports.
* Bhojpuri (bho) (renamed from "bh").
+* (bug 29031) When translating block log entries, indefinite, infinite, and
+ infinity are now considered the same.
== Compatibility ==
Modified: trunk/phase3/languages/Language.php
===================================================================
--- trunk/phase3/languages/Language.php 2011-05-21 01:09:07 UTC (rev 88506)
+++ trunk/phase3/languages/Language.php 2011-05-21 03:41:16 UTC (rev 88507)
@@ -2719,11 +2719,25 @@
* @see LanguageFi.php for example implementation
*/
function translateBlockExpiry( $str ) {
- foreach( SpecialBlock::getSuggestedDurations( $this ) as $show
=> $value ){
+ $duration = SpecialBlock::getSuggestedDurations( $this );
+ foreach( $duration as $show => $value ){
if ( strcmp( $str, $value ) == 0 ) {
return htmlspecialchars( trim( $show ) );
}
}
+
+ // Since usually only infinite or indefinite is only on list,
so try
+ // equivalents if still here.
+ $indefs = array( 'infinite', 'infinity', 'indefinite' );
+ if ( in_array( $str, $indefs ) ) {
+ foreach( $indefs as $val ) {
+ $show = array_search( $val, $duration, true );
+ if ( $show !== false ) {
+ return htmlspecialchars( trim( $show )
);
+ }
+ }
+ }
+ // If all else fails, return the original string.
return $str;
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs