2004-05-29 00:34:03 +00:00
|
|
|
<?php
|
2005-04-05 11:00:27 +00:00
|
|
|
/**
|
2006-06-03 20:51:41 +00:00
|
|
|
* Walloon (Walon)
|
|
|
|
|
*
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
* @ingroup Language
|
2006-06-03 20:51:41 +00:00
|
|
|
*/
|
2004-05-29 00:34:03 +00:00
|
|
|
|
2006-06-03 20:51:41 +00:00
|
|
|
# NOTE: cweri après "NOTE:" po des racsegnes so des ratournaedjes
|
|
|
|
|
# k' i gn a.
|
2004-05-29 00:34:03 +00:00
|
|
|
|
2006-07-26 07:15:39 +00:00
|
|
|
class LanguageWa extends Language {
|
2009-09-28 08:40:09 +00:00
|
|
|
/**
|
|
|
|
|
* Use singular form for zero
|
2011-05-29 15:03:33 +00:00
|
|
|
*
|
|
|
|
|
* @param $count int
|
|
|
|
|
* @param $forms array
|
|
|
|
|
*
|
|
|
|
|
* @return string
|
2009-09-28 08:40:09 +00:00
|
|
|
*/
|
|
|
|
|
function convertPlural( $count, $forms ) {
|
2010-07-29 09:43:18 +00:00
|
|
|
if ( !count( $forms ) ) { return ''; }
|
2009-09-28 08:40:09 +00:00
|
|
|
$forms = $this->preConvertPlural( $forms, 2 );
|
|
|
|
|
|
2010-07-29 09:43:18 +00:00
|
|
|
return ( $count <= 1 ) ? $forms[0] : $forms[1];
|
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
|
|
|
|
|
*
|
|
|
|
|
* @param $ts string
|
|
|
|
|
* @param $adj bool
|
|
|
|
|
* @param $format bool
|
|
|
|
|
* @param $tc bool
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2006-06-03 20:51:41 +00:00
|
|
|
function date( $ts, $adj = false, $format = true, $tc = false ) {
|
2011-02-19 20:06:50 +00:00
|
|
|
$ts = wfTimestamp( TS_MW, $ts );
|
2006-06-03 20:51:41 +00:00
|
|
|
if ( $adj ) { $ts = $this->userAdjust( $ts, $tc ); }
|
|
|
|
|
$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' ) {
|
2010-07-29 09:43:18 +00:00
|
|
|
$d = substr( $ts, 0, 4 ) . '-' . substr( $ts, 4, 2 ) . '-' . substr( $ts, 6, 2 );
|
2006-06-03 20:51:41 +00:00
|
|
|
return $d;
|
|
|
|
|
}
|
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' ) {
|
2010-07-29 09:43:18 +00:00
|
|
|
$d = substr( $ts, 6, 2 ) . '/' . substr( $ts, 4, 2 ) . '/' . substr( $ts, 0, 4 );
|
2006-06-03 20:51:41 +00:00
|
|
|
return $d;
|
|
|
|
|
}
|
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
|
2004-05-29 00:34:03 +00:00
|
|
|
$m = substr( $ts, 4, 2 );
|
|
|
|
|
$n = substr( $ts, 6, 2 );
|
2010-07-29 09:43:18 +00:00
|
|
|
if ( $n == 1 ) {
|
2005-11-16 19:33:45 +00:00
|
|
|
$d = "1î d' " . $this->getMonthName( $m ) .
|
2004-05-29 00:34:03 +00:00
|
|
|
" " . substr( $ts, 0, 4 );
|
2011-06-17 16:05:35 +00:00
|
|
|
} elseif ( $n == 2 || $n == 3 || $n == 20 || $n == 22 || $n == 23 ) {
|
2010-07-29 09:43:18 +00:00
|
|
|
$d = ( 0 + $n ) . " d' " . $this->getMonthName( $m ) .
|
2004-05-29 00:34:03 +00:00
|
|
|
" " . substr( $ts, 0, 4 );
|
2011-06-17 16:05:35 +00:00
|
|
|
} elseif ( $m == 4 || $m == 8 || $m == 10 ) {
|
2010-07-29 09:43:18 +00:00
|
|
|
$d = ( 0 + $n ) . " d' " . $this->getMonthName( $m ) .
|
2004-05-29 00:34:03 +00:00
|
|
|
" " . substr( $ts, 0, 4 );
|
|
|
|
|
} else {
|
2010-07-29 09:43:18 +00:00
|
|
|
$d = ( 0 + $n ) . " di " . $this->getMonthName( $m ) .
|
2004-05-29 00:34:03 +00:00
|
|
|
" " . substr( $ts, 0, 4 );
|
|
|
|
|
}
|
|
|
|
|
return $d;
|
|
|
|
|
}
|
|
|
|
|
|
2011-05-29 16:32:05 +00:00
|
|
|
/**
|
|
|
|
|
* @param $ts string
|
|
|
|
|
* @param $adj bool
|
|
|
|
|
* @param $format bool
|
|
|
|
|
* @param $tc bool
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
2006-07-26 07:15:39 +00:00
|
|
|
function timeanddate( $ts, $adj = false, $format = true, $tc = false ) {
|
|
|
|
|
if ( $adj ) { $ts = $this->userAdjust( $ts, $tc ); }
|
|
|
|
|
$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
|
|
|
}
|
|
|
|
|
}
|