Index: trunk/phase3/languages/LanguageIs.php |
— | — | @@ -39,12 +39,6 @@ |
40 | 40 | NS_CATEGORY_TALK => 'Flokkaspjall' |
41 | 41 | ) + $wgNamespaceNamesEn; |
42 | 42 | |
43 | | -/* private */ $wgDefaultUserOptionsIs = array( |
44 | | - 'date' => 2, |
45 | | - # The Icelandic Wikipedia wishes to use PNG rendering by default. |
46 | | - 'math' => 0, |
47 | | -) + $wgDefaultUserOptionsEn; |
48 | | - |
49 | 43 | /* private */ $wgQuickbarSettingsIs = array( |
50 | 44 | "Sleppa", "Fast vinstra megin", "Fast hægra megin", "Fljótandi til vinstri" |
51 | 45 | ); |
— | — | @@ -62,11 +56,12 @@ |
63 | 57 | ); |
64 | 58 | |
65 | 59 | /* private */ $wgDateFormatsIs = array( |
66 | | - "Alveg sama", |
67 | | - "Janúar 15, 2001", |
68 | | - "15 janúar 2001", |
69 | | - "2001 janúar 15", |
70 | | - "2001-01-15" |
| 60 | + 'Sjálfgefið', |
| 61 | + '15. janúar 2001 kl. 16:12', |
| 62 | + '15. jan. 2001 kl. 16:12', |
| 63 | + '16:12, 15. janúar 2001', |
| 64 | + '16:12, 15. jan. 2001', |
| 65 | + '2001-01-15 16:12:34' |
71 | 66 | ); |
72 | 67 | |
73 | 68 | /* private */ $wgSysopSpecialPagesIs = array( |
— | — | @@ -800,11 +795,6 @@ |
801 | 796 | |
802 | 797 | class LanguageIs extends LanguageUtf8 { |
803 | 798 | |
804 | | - function getDefaultUserOptions () { |
805 | | - global $wgDefaultUserOptionsIs; |
806 | | - return $wgDefaultUserOptionsIs; |
807 | | - } |
808 | | - |
809 | 799 | function getNamespaces() { |
810 | 800 | global $wgNamespaceNamesIs; |
811 | 801 | return $wgNamespaceNamesIs; |
— | — | @@ -874,12 +864,49 @@ |
875 | 865 | } |
876 | 866 | |
877 | 867 | function date( $ts, $adj = false ) { |
| 868 | + global $wgUser; |
878 | 869 | if ( $adj ) { $ts = $this->userAdjust( $ts ); } # Adjust based on the timezone setting. |
879 | | - $date = (0 + substr( $ts, 6, 2 )) . '. ' . |
880 | | - $this->getMonthName( substr( $ts, 4, 2 ) ) . ' ' . |
881 | | - substr($ts, 0, 4); |
882 | | - return $date; |
| 870 | + |
| 871 | + switch( $wgUser->getOption( 'date' ) ) { |
| 872 | + # 15. jan. 2001 kl. 16:12 || 16:12, 15. jan. 2001 |
| 873 | + case 2: case 4: return (0 + substr( $ts, 6, 2 )) . '. ' . |
| 874 | + $this->getMonthAbbreviation( substr( $ts, 4, 2 ) ) . '. ' . |
| 875 | + substr($ts, 0, 4); |
| 876 | + # 2001-01-15 16:12:34 |
| 877 | + case 5: return substr($ts, 0, 4). '-' . substr($ts, 4, 2). '-' .substr($ts, 6, 2); |
| 878 | + |
| 879 | + # 15. janúar 2001 kl. 16:12 || 16:12, 15. janúar 2001 |
| 880 | + default: return (0 + substr( $ts, 6, 2 )) . '. ' . |
| 881 | + $this->getMonthName( substr( $ts, 4, 2 ) ) . ' ' . |
| 882 | + substr($ts, 0, 4); |
| 883 | + } |
| 884 | + |
883 | 885 | } |
| 886 | + |
| 887 | + function time($ts, $adj = false) { |
| 888 | + global $wgUser; |
| 889 | + if ( $adj ) { $ts = $this->userAdjust( $ts ); } # Adjust based on the timezone setting. |
| 890 | + |
| 891 | + switch( $wgUser->getOption( 'date' ) ) { |
| 892 | + case 5: return substr( $ts, 8, 2 ) . ':' . substr( $ts, 10, 2 ) . ':' . substr( $ts, 12, 2 ); |
| 893 | + default: return substr( $ts, 8, 2 ) . ':' . substr( $ts, 10, 2 ); |
| 894 | + } |
| 895 | + |
| 896 | + } |
| 897 | + |
| 898 | + function timeanddate( $ts, $adj = false ) { |
| 899 | + global $wgUser; |
| 900 | + |
| 901 | + switch ( $wgUser->getOption( 'date' ) ) { |
| 902 | + # 16:12, 15. janúar 2001 || 16:12, 15. jan. 2001 |
| 903 | + case 3: case 4: return $this->time( $ts, $adj ) . ', ' . $this->date( $ts, $adj ); |
| 904 | + # 2001-01-15 16:12:34 |
| 905 | + case 5: return $this->date( $ts, $adj ) . ' ' . $this->time( $ts, $adj ); |
| 906 | + default: return $this->date( $ts, $adj ) . ' kl. ' . $this->time( $ts, $adj ); |
| 907 | + |
| 908 | + } |
| 909 | + |
| 910 | + } |
884 | 911 | } |
885 | 912 | |
886 | 913 | ?> |