Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1427942
LanguageZh_hans.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
LanguageZh_hans.php
View Options
<?php
/**
* @license GPL-2.0-or-later
* @file
*/
// phpcs:ignoreFile Squiz.Classes.ValidClassName.NotCamelCaps
use
MediaWiki\Language\Language
;
/**
* Simplified Chinese
*
* @ingroup Languages
*/
class
LanguageZh_hans
extends
Language
{
private
const
WORD_SEGMENTATION_REGEX
=
'/([
\x
c0-
\x
ff][
\x
80-
\x
bf]*)/'
;
/** @inheritDoc */
public
function
hasWordBreaks
()
{
return
false
;
}
/**
* @todo FIXME: Only do this for Han characters...
*
* @inheritDoc
*/
public
function
segmentByWord
(
$string
)
{
return
self
::
insertSpace
(
$string
,
self
::
WORD_SEGMENTATION_REGEX
);
}
public
function
normalizeForSearch
(
$s
)
{
// Double-width roman characters
$s
=
parent
::
normalizeForSearch
(
$s
);
$s
=
trim
(
$s
);
return
$this
->
segmentByWord
(
$s
);
}
public
function
formatDuration
(
$seconds
,
array
$chosenIntervals
=
[]
)
{
if
(
!
$chosenIntervals
)
{
$chosenIntervals
=
[
'centuries'
,
'years'
,
'days'
,
'hours'
,
'minutes'
,
'seconds'
];
}
$intervals
=
$this
->
getDurationIntervals
(
$seconds
,
$chosenIntervals
);
$segments
=
[];
foreach
(
$intervals
as
$intervalName
=>
$intervalValue
)
{
// Messages: duration-seconds, duration-minutes, duration-hours, duration-days, duration-weeks,
// duration-years, duration-decades, duration-centuries, duration-millennia
$message
=
wfMessage
(
'duration-'
.
$intervalName
)->
numParams
(
$intervalValue
);
$segments
[]
=
$message
->
inLanguage
(
$this
)->
escaped
();
}
return
implode
(
''
,
$segments
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 15:23 (14 h, 23 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
75/30/57e120712a87590c185f3f0eef37
Default Alt Text
LanguageZh_hans.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment