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 ==
* @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;
}