46 if ( $toVariant !==
'en-x-piglatin' ) {
53 return preg_replace_callback(
'/[A-Za-z][a-z\']+/',
function (
$matches ) {
55 if ( preg_match(
'/^[aeiou]/i', $word ) ) {
59 return preg_replace_callback(
'/^(s?qu|[^aeiou][^aeiouy]*)(.*)$/i',
function ( $m ) {
60 $ucfirst = strtoupper( $m[1][0] ) === $m[1][0];
62 return ucfirst( $m[2] ) . lcfirst( $m[1] ) .
'ay';
65 return $m[2] . $m[1] .
'ay';
80 parent::__construct();
83 $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.
Wrapper around strtr() that holds replacements.