2004-05-29 00:34:03 +00:00
|
|
|
<?php
|
2005-04-05 11:00:27 +00:00
|
|
|
/**
|
2012-06-10 17:40:03 +00:00
|
|
|
* 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
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
2006-06-03 20:51:41 +00:00
|
|
|
*
|
2012-06-10 17:40:03 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
*
|
|
|
|
|
* @file
|
2006-06-03 20:51:41 +00:00
|
|
|
*/
|
2004-05-29 00:34:03 +00:00
|
|
|
|
2012-06-10 17:40:03 +00:00
|
|
|
/**
|
|
|
|
|
* Walloon (Walon)
|
|
|
|
|
*
|
|
|
|
|
* NOTE: cweri après "NOTE:" po des racsegnes so des ratournaedjes
|
|
|
|
|
* k' i gn a.
|
|
|
|
|
*
|
2022-06-22 22:37:31 +00:00
|
|
|
* @ingroup Languages
|
2012-06-10 17:40:03 +00:00
|
|
|
*/
|
2006-07-26 07:15:39 +00:00
|
|
|
class LanguageWa extends Language {
|
2009-09-28 08:40:09 +00:00
|
|
|
|
2011-05-29 16:32:05 +00:00
|
|
|
/**
|
|
|
|
|
* Dates in Walloon are "1î d' <monthname>" for 1st of the month,
|
|
|
|
|
* "<day> di <monthname>" for months starting by a consoun, and
|
|
|
|
|
* "<day> d' <monthname>" for months starting with a vowel
|
|
|
|
|
*
|
2014-04-17 13:31:28 +00:00
|
|
|
* @param string $ts
|
|
|
|
|
* @param bool $adj
|
|
|
|
|
* @param bool $format
|
|
|
|
|
* @param bool $tc
|
2011-05-29 16:32:05 +00:00
|
|
|
* @return string
|
|
|
|
|
*/
|
2016-03-26 12:54:48 +00:00
|
|
|
public function date( $ts, $adj = false, $format = true, $tc = false ) {
|
2011-02-19 20:06:50 +00:00
|
|
|
$ts = wfTimestamp( TS_MW, $ts );
|
2012-09-07 22:28:16 +00:00
|
|
|
if ( $adj ) {
|
|
|
|
|
$ts = $this->userAdjust( $ts, $tc );
|
|
|
|
|
}
|
2006-06-03 20:51:41 +00:00
|
|
|
$datePreference = $this->dateFormat( $format );
|
|
|
|
|
|
|
|
|
|
# ISO (YYYY-mm-dd) format
|
|
|
|
|
# we also output this format for YMD (eg: 2001 January 15)
|
2006-07-26 07:15:39 +00:00
|
|
|
if ( $datePreference == 'ISO 8601' ) {
|
2013-04-17 19:10:02 +00:00
|
|
|
$d = substr( $ts, 0, 4 ) . '-' . substr( $ts, 4, 2 ) . '-' . substr( $ts, 6, 2 );
|
|
|
|
|
return $d;
|
2006-06-03 20:51:41 +00:00
|
|
|
}
|
2008-05-17 17:10:18 +00:00
|
|
|
|
2006-06-03 20:51:41 +00:00
|
|
|
# dd/mm/YYYY format
|
2006-07-26 07:15:39 +00:00
|
|
|
if ( $datePreference == 'walloon short' ) {
|
2013-04-17 19:10:02 +00:00
|
|
|
$d = substr( $ts, 6, 2 ) . '/' . substr( $ts, 4, 2 ) . '/' . substr( $ts, 0, 4 );
|
|
|
|
|
return $d;
|
2006-06-03 20:51:41 +00:00
|
|
|
}
|
2008-05-17 17:10:18 +00:00
|
|
|
|
2006-06-03 20:51:41 +00:00
|
|
|
# Walloon format
|
|
|
|
|
# we output this in all other cases
|
2022-03-05 20:05:01 +00:00
|
|
|
$m = (int)substr( $ts, 4, 2 );
|
|
|
|
|
$n = (int)substr( $ts, 6, 2 );
|
2010-07-29 09:43:18 +00:00
|
|
|
if ( $n == 1 ) {
|
2013-04-17 19:10:02 +00:00
|
|
|
$d = "1î d' " . $this->getMonthName( $m ) .
|
|
|
|
|
" " . substr( $ts, 0, 4 );
|
2011-06-17 16:05:35 +00:00
|
|
|
} elseif ( $n == 2 || $n == 3 || $n == 20 || $n == 22 || $n == 23 ) {
|
2022-03-05 20:05:01 +00:00
|
|
|
$d = $n . " d' " . $this->getMonthName( $m ) .
|
2013-04-17 19:10:02 +00:00
|
|
|
" " . substr( $ts, 0, 4 );
|
2011-06-17 16:05:35 +00:00
|
|
|
} elseif ( $m == 4 || $m == 8 || $m == 10 ) {
|
2022-03-05 20:05:01 +00:00
|
|
|
$d = $n . " d' " . $this->getMonthName( $m ) .
|
2013-04-17 19:10:02 +00:00
|
|
|
" " . substr( $ts, 0, 4 );
|
2004-05-29 00:34:03 +00:00
|
|
|
} else {
|
2022-03-05 20:05:01 +00:00
|
|
|
$d = $n . " di " . $this->getMonthName( $m ) .
|
2013-04-17 19:10:02 +00:00
|
|
|
" " . substr( $ts, 0, 4 );
|
2004-05-29 00:34:03 +00:00
|
|
|
}
|
|
|
|
|
return $d;
|
|
|
|
|
}
|
|
|
|
|
|
2011-05-29 16:32:05 +00:00
|
|
|
/**
|
2014-04-17 13:31:28 +00:00
|
|
|
* @param string $ts
|
|
|
|
|
* @param bool $adj
|
|
|
|
|
* @param bool $format
|
|
|
|
|
* @param bool $tc
|
2011-05-29 16:32:05 +00:00
|
|
|
* @return string
|
|
|
|
|
*/
|
2016-03-26 12:54:48 +00:00
|
|
|
public function timeanddate( $ts, $adj = false, $format = true, $tc = false ) {
|
2013-04-17 19:10:02 +00:00
|
|
|
if ( $adj ) {
|
|
|
|
|
$ts = $this->userAdjust( $ts, $tc );
|
|
|
|
|
}
|
2006-07-26 07:15:39 +00:00
|
|
|
$datePreference = $this->dateFormat( $format );
|
|
|
|
|
if ( $datePreference == 'ISO 8601' ) {
|
|
|
|
|
return parent::timeanddate( $ts, $adj, $format, $tc );
|
|
|
|
|
} else {
|
2008-05-17 17:10:18 +00:00
|
|
|
return $this->date( $ts, $adj, $format, $tc ) . ' a ' .
|
2006-07-26 07:15:39 +00:00
|
|
|
$this->time( $ts, $adj, $format, $tc );
|
|
|
|
|
}
|
2004-05-29 00:34:03 +00:00
|
|
|
}
|
|
|
|
|
}
|