Merge "Update composer/semver to 1.4.2"
[lhc/web/wiklou.git] / languages / Language.php
index cb3b4b8..3e28759 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 /**
  * Internationalisation code.
+ * See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more information.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -1037,6 +1038,7 @@ class Language {
         *    xiy  y (two digit year) in Iranian calendar
         *    xiY  Y (full year) in Iranian calendar
         *    xit  t (days in month) in Iranian calendar
+        *    xiz  z (day of the year) in Iranian calendar
         *
         *    xjj  j (day number) in Hebrew calendar
         *    xjF  F (month name) in Hebrew calendar
@@ -1339,6 +1341,13 @@ class Language {
                                        }
                                        $num = self::$IRANIAN_DAYS[$iranian[1] - 1];
                                        break;
+                               case 'xiz':
+                                       $usedIranianYear = true;
+                                       if ( !$iranian ) {
+                                               $iranian = self::tsToIranian( $ts );
+                                       }
+                                       $num = $iranian[3];
+                                       break;
                                case 'a':
                                        $usedAMPM = true;
                                        $s .= intval( substr( $ts, 8, 2 ) ) < 12 ? 'am' : 'pm';
@@ -1597,6 +1606,8 @@ class Language {
                        $jDayNo = floor( ( $jDayNo - 1 ) % 365 );
                }
 
+               $jz = $jDayNo;
+
                for ( $i = 0; $i < 11 && $jDayNo >= self::$IRANIAN_DAYS[$i]; $i++ ) {
                        $jDayNo -= self::$IRANIAN_DAYS[$i];
                }
@@ -1604,7 +1615,7 @@ class Language {
                $jm = $i + 1;
                $jd = $jDayNo + 1;
 
-               return [ $jy, $jm, $jd ];
+               return [ $jy, $jm, $jd, $jz ];
        }
 
        /**
@@ -2292,7 +2303,7 @@ class Language {
 
        /**
         * Takes a number of seconds and returns an array with a set of corresponding intervals.
-        * For example 65 will be turned into array( minutes => 1, seconds => 5 ).
+        * For example 65 will be turned into [ minutes => 1, seconds => 5 ].
         *
         * @since 1.20
         *