MediaWiki
master
Toggle main menu visibility
LanguageWa.php
Go to the documentation of this file.
1
<?php
6
7
namespace
MediaWiki\Languages;
8
9
use MediaWiki\Language\Language;
10
use Wikimedia\Timestamp\TimestampFormat as TS;
11
20
class
LanguageWa
extends
Language
{
21
29
public
function
date
( $ts, $adj =
false
, $format =
true
, $timecorrection =
false
) {
30
$datePreference = $this->
dateFormat
( $format );
31
if
( $datePreference ==
'ISO 8601'
|| $datePreference ==
'walloon short'
) {
32
return
parent::date( $ts, $adj, $format, $timecorrection );
33
}
34
35
$ts =
wfTimestamp
( TS::MW, $ts );
36
if
( $adj ) {
37
$ts = $this->
userAdjust
( $ts, $timecorrection );
38
}
39
40
# Walloon 'dmy' format
41
$m = (int)substr( $ts, 4, 2 );
42
$n = (int)substr( $ts, 6, 2 );
43
if
( $n == 1 ) {
44
$d =
"1î d' "
. $this->
getMonthName
( $m ) .
45
" "
. substr( $ts, 0, 4 );
46
} elseif ( $n == 2 || $n == 3 || $n == 20 || $n == 22 || $n == 23 ) {
47
$d = $n .
" d' "
. $this->
getMonthName
( $m ) .
48
" "
. substr( $ts, 0, 4 );
49
} elseif ( $m == 4 || $m == 8 || $m == 10 ) {
50
$d = $n .
" d' "
. $this->
getMonthName
( $m ) .
51
" "
. substr( $ts, 0, 4 );
52
}
else
{
53
$d = $n .
" di "
. $this->
getMonthName
( $m ) .
54
" "
. substr( $ts, 0, 4 );
55
}
56
return
$d;
57
}
58
60
public
function
timeanddate
( $ts, $adj =
false
, $format =
true
, $tc =
false
) {
61
$datePreference = $this->
dateFormat
( $format );
62
if
( $datePreference ==
'ISO 8601'
|| $datePreference ==
'walloon short'
) {
63
return
parent::timeanddate( $ts, $adj, $format, $tc );
64
}
65
66
# Walloon 'dmy' format
67
return
$this->
date
( $ts, $adj, $format, $tc ) .
' a '
.
68
$this->
time
( $ts, $adj, $format, $tc );
69
}
70
}
71
73
class_alias( LanguageWa::class,
'LanguageWa'
);
wfTimestamp
wfTimestamp( $outputtype=TS::UNIX, $ts=0)
Get a timestamp string in one of various formats.
Definition
GlobalFunctions.php:1025
MediaWiki\Language\Language
Base class for language-specific code.
Definition
Language.php:65
MediaWiki\Language\Language\userAdjust
userAdjust( $ts, $tz=false)
Used by date() and time() to adjust the time output.
Definition
Language.php:1949
MediaWiki\Language\Language\dateFormat
dateFormat( $usePrefs=true)
This is meant to be used by time(), date(), and timeanddate() to get the date preference they're supp...
Definition
Language.php:2401
MediaWiki\Language\Language\getMonthName
getMonthName( $key)
Definition
Language.php:684
MediaWiki\Language\Language\time
time( $ts, $adj=false, $format=true, $timecorrection=false)
Definition
Language.php:2488
MediaWiki\Languages\LanguageWa
Walloon (Walon).
Definition
LanguageWa.php:20
MediaWiki\Languages\LanguageWa\date
date( $ts, $adj=false, $format=true, $timecorrection=false)
Dates in Walloon are "1î d' <monthname>" for 1st of the month, "<day> di <monthname>" for months star...
Definition
LanguageWa.php:29
MediaWiki\Languages\LanguageWa\timeanddate
timeanddate( $ts, $adj=false, $format=true, $tc=false)
string
Definition
LanguageWa.php:60
includes
Languages
LanguageWa.php
Generated on
for MediaWiki by
1.18.0