46 if ( $toVariant ===
'en-x-piglatin' ) {
50 return preg_replace_callback(
'/[A-Za-z][a-z\']+/',
function (
$matches ) {
52 if ( preg_match(
'/^[aeiou]/i', $word ) ) {
55 return preg_replace_callback(
'/^(s?qu|[^aeiou][^aeiouy]*)(.*)$/i',
function ( $m ) {
56 $ucfirst = strtoupper( $m[1][0] ) === $m[1][0];
58 return ucfirst( $m[2] ) . lcfirst( $m[1] ) .
'ay';
60 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.
LanguageConverter $mConverter
Wrapper around strtr() that holds replacements.
$wgHooks['ArticleShow'][]