* (bug 5270) Fix broken linktrail for br, cv, fr, hr, nn, oc, ta, wa
[lhc/web/wiklou.git] / languages / LanguageFy.php
1 <?php
2 /**
3 * @package MediaWiki
4 * @subpackage Language
5 */
6
7 require_once( "LanguageUtf8.php" );
8
9 /* private */ $wgNamespaceNamesFy = array(
10 NS_MEDIA => "Media",
11 NS_SPECIAL => "Wiki",
12 NS_MAIN => "",
13 NS_TALK => "Oerlis",
14 NS_USER => "Meidogger",
15 NS_USER_TALK => "Meidogger_oerlis",
16 NS_PROJECT => $wgMetaNamespace,
17 NS_PROJECT_TALK => $wgMetaNamespace . "_oerlis",
18 NS_IMAGE => "Ofbyld",
19 NS_IMAGE_TALK => "Ofbyld_oerlis",
20 NS_MEDIAWIKI => "MediaWiki",
21 NS_MEDIAWIKI_TALK => "MediaWiki_oerlis",
22 NS_TEMPLATE => "Berjocht",
23 NS_TEMPLATE_TALK => "Berjocht_oerlis",
24 NS_HELP => "Hulp",
25 NS_HELP_TALK => "Hulp_oerlis",
26 NS_CATEGORY => "Kategory",
27 NS_CATEGORY_TALK => "Kategory_oerlis"
28 ) + $wgNamespaceNamesEn;
29
30 /* private */ $wgQuickbarSettingsFy = array(
31 "Ut", "Lofts fêst", "Rjochts fêst", "Lofts sweevjend"
32 );
33
34 /* private */ $wgSkinNamesFy = array(
35 'standard' => "Standert",
36 'nostalgia' => "Nostalgy",
37 ) + $wgSkinNamesEn;
38
39
40 /* private */ $wgDateFormatsFy = array(
41 'Gjin foarkar',
42 '16.12, jan 15, 2001',
43 '16.12, 15 jan 2001',
44 '16.12, 2001 jan 15',
45 'ISO 8601' => '2001-01-15 16:12:34'
46 );
47
48 /* private */ $wgBookstoreListFy = array(
49 );
50
51 if (!$wgCachedMessageArrays) {
52 require_once('MessagesFy.php');
53 }
54
55 class LanguageFy extends LanguageUtf8 {
56
57 function getBookstoreList () {
58 global $wgBookstoreListFy ;
59 return $wgBookstoreListFy ;
60 }
61
62 function getNamespaces() {
63 global $wgNamespaceNamesFy;
64 return $wgNamespaceNamesFy;
65 }
66
67
68 function getNsIndex( $text ) {
69 global $wgNamespaceNamesFy;
70
71 foreach ( $wgNamespaceNamesFy as $i => $n ) {
72 if ( 0 == strcasecmp( $n, $text ) ) { return $i; }
73 }
74 if ( 0 == strcasecmp( "Brûker", $text ) ) return 2;
75 if ( 0 == strcasecmp( "Brûker_oerlis", $text ) ) return 3;
76 return false;
77 }
78
79
80 function getQuickbarSettings() {
81 global $wgQuickbarSettingsFy;
82 return $wgQuickbarSettingsFy;
83 }
84
85 function getSkinNames() {
86 global $wgSkinNamesFy;
87 return $wgSkinNamesFy;
88 }
89
90
91 var $digitTransTable = array(
92 ',' => '.',
93 '.' => ','
94 );
95
96 function formatNum( $number, $year = false ) {
97 return !$year ? strtr($this->commafy($number), $this->digitTransTable ) : $number;
98 }
99
100 function getDateFormats() {
101 global $wgDateFormatsFy;
102 return $wgDateFormatsFy;
103 }
104
105 /**
106 * @access public
107 * @param mixed $ts the time format which needs to be turned into a
108 * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
109 * @param bool $adj whether to adjust the time output according to the
110 * user configured offset ($timecorrection)
111 * @param bool $format true to use user's date format preference
112 * @param string $timecorrection the time offset as returned by
113 * validateTimeZone() in Special:Preferences
114 * @return string
115 */
116 function date( $ts, $adj = false, $format = true, $timecorrection = false ) {
117 global $wgUser;
118
119 if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); }
120
121 $datePreference = $this->dateFormat( $format );
122
123 $month = $this->getMonthAbbreviation( substr( $ts, 4, 2 ) );
124 $day = 0 + substr( $ts, 6, 2 );
125 $year = substr( $ts, 0, 4 );
126
127 switch( $datePreference ) {
128 case MW_DATE_DMY: return "$day $month $year";
129 case MW_DATE_YMD: return "$year $month $day";
130 case MW_DATE_ISO: return substr($ts, 0, 4). '-' . substr($ts, 4, 2). '-' .substr($ts, 6, 2);
131 default: return "$month $day, $year";
132 }
133 }
134
135 /**
136 * @access public
137 * @param mixed $ts the time format which needs to be turned into a
138 * date('YmdHis') format with wfTimestamp(TS_MW,$ts)
139 * @param bool $adj whether to adjust the time output according to the
140 * user configured offset ($timecorrection)
141 * @param bool $format true to use user's date format preference
142 * @param string $timecorrection the time offset as returned by
143 * validateTimeZone() in Special:Preferences
144 * @return string
145 */
146 function time( $ts, $adj = false, $format = true, $timecorrection = false ) {
147 global $wgUser;
148
149 if ( $adj ) { $ts = $this->userAdjust( $ts, $timecorrection ); }
150 $datePreference = $this->dateFormat( $format );
151
152 if ( $datePreference == MW_DATE_ISO ) {
153 $sep = ':';
154 } else {
155 $sep = '.';
156 }
157
158 $t = substr( $ts, 8, 2 ) . $sep . substr( $ts, 10, 2 );
159
160 if ( $datePreference == MW_DATE_ISO ) {
161 $t .= $sep . substr( $ts, 12, 2 );
162 }
163 return $t;
164 }
165
166 function getMessage( $key ) {
167 global $wgAllMessagesFy;
168 if( isset( $wgAllMessagesFy[$key] ) ) {
169 return $wgAllMessagesFy[$key];
170 } else {
171 return parent::getMessage( $key );
172 }
173 }
174 }
175
176 ?>