Translate the block expiry date
authorRobin Pepermans <robin@users.mediawiki.org>
Fri, 8 Jul 2011 23:36:35 +0000 (23:36 +0000)
committerRobin Pepermans <robin@users.mediawiki.org>
Fri, 8 Jul 2011 23:36:35 +0000 (23:36 +0000)
I wonder why this hasn't been done yet...

RELEASE-NOTES-1.19
languages/Language.php

index 56a975f..60b1b3f 100644 (file)
@@ -148,6 +148,7 @@ production.
 * (bug 27410) The tag filter on a history page is now within a <label> element
 * (bug 29779) DairikiDiff/WikiDiff <ins> and <del> should undo browser default
   styling (strike/underline).
+* Translate the block expiry date
 
 === API changes in 1.19 ===
 * BREAKING CHANGE: action=watch now requires POST and token.
index 80faca2..4ed2465 100644 (file)
@@ -2992,9 +2992,8 @@ class Language {
        }
 
        /**
-        * Maybe translate block durations.  Note that this function is somewhat misnamed: it
-        * deals with translating the *duration* ("1 week", "4 days", etc), not the expiry time
-        * (which is an absolute timestamp).
+        * This translates the duration ("1 week", "4 days", etc)
+        * as well as the expiry time (which is an absolute timestamp).
         * @param $str String: the validated block duration in English
         * @return Somehow translated block duration
         * @see LanguageFi.php for example implementation
@@ -3018,8 +3017,8 @@ class Language {
                                }
                        }
                }
-               // If all else fails, return the original string.
-               return $str;
+               // If no duration is given, but a timestamp, display that
+               return $this->timeanddate( $str );
        }
 
        /**