Index: trunk/phase3/RELEASE-NOTES-1.19 |
— | — | @@ -88,6 +88,8 @@ |
89 | 89 | changes to languages because of Bugzilla reports. |
90 | 90 | |
91 | 91 | * Bhojpuri (bho) (renamed from "bh"). |
| 92 | +* (bug 29031) When translating block log entries, indefinite, infinite, and |
| 93 | + infinity are now considered the same. |
92 | 94 | |
93 | 95 | == Compatibility == |
94 | 96 | |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -2719,11 +2719,25 @@ |
2720 | 2720 | * @see LanguageFi.php for example implementation |
2721 | 2721 | */ |
2722 | 2722 | function translateBlockExpiry( $str ) { |
2723 | | - foreach( SpecialBlock::getSuggestedDurations( $this ) as $show => $value ){ |
| 2723 | + $duration = SpecialBlock::getSuggestedDurations( $this ); |
| 2724 | + foreach( $duration as $show => $value ){ |
2724 | 2725 | if ( strcmp( $str, $value ) == 0 ) { |
2725 | 2726 | return htmlspecialchars( trim( $show ) ); |
2726 | 2727 | } |
2727 | 2728 | } |
| 2729 | + |
| 2730 | + // Since usually only infinite or indefinite is only on list, so try |
| 2731 | + // equivalents if still here. |
| 2732 | + $indefs = array( 'infinite', 'infinity', 'indefinite' ); |
| 2733 | + if ( in_array( $str, $indefs ) ) { |
| 2734 | + foreach( $indefs as $val ) { |
| 2735 | + $show = array_search( $val, $duration, true ); |
| 2736 | + if ( $show !== false ) { |
| 2737 | + return htmlspecialchars( trim( $show ) ); |
| 2738 | + } |
| 2739 | + } |
| 2740 | + } |
| 2741 | + // If all else fails, return the original string. |
2728 | 2742 | return $str; |
2729 | 2743 | } |
2730 | 2744 | |