44 if ( $toVariant ===
'en-x-piglatin' ) {
48 return preg_replace_callback(
'/[A-Za-z][a-z]+/',
function (
$matches ) {
50 if ( preg_match(
'/^[aeiou]/i', $word ) ) {
53 return preg_replace_callback(
'/^(qu|[^aeiou][^aeiouy]*)(.*)$/i',
function ( $m ) {
54 $ucfirst = strtoupper( $m[1][0] ) === $m[1][0];
56 return ucfirst( $m[2] ) . lcfirst( $m[1] ) .
'ay';
58 return $m[2] . $m[1] .
'ay';
78 parent::__construct();
81 $this->mConverter =
new EnConverter( $this,
'en', [
'en',
'en-x-piglatin' ] );
$wgUsePigLatinVariant
Whether to enable the pig latin variant of English (en-x-piglatin), used to ease variant development ...
translate( $text, $toVariant)
Translates text into Pig Latin.
loadDefaultTables()
Dummy methods required by base class.
Base class for language conversion.
Internationalisation code.
LanguageConverter $mConverter
Wrapper around strtr() that holds replacements.
$wgHooks['ArticleShow'][]