29 parent::__construct( $langobj,
'en', [
'en',
'en-x-piglatin' ] );
51 if ( $toVariant !==
'en-x-piglatin' ) {
58 return preg_replace_callback(
'/[A-Za-z][a-z\']+/',
function (
$matches ) {
60 if ( preg_match(
'/^[aeiou]/i', $word ) ) {
64 return preg_replace_callback(
'/^(s?qu|[^aeiou][^aeiouy]*)(.*)$/i',
function ( $m ) {
65 $ucfirst = strtoupper( $m[1][0] ) === $m[1][0];
67 return ucfirst( $m[2] ) . lcfirst( $m[1] ) .
'ay';
70 return $m[2] . $m[1] .
'ay';
translate( $text, $toVariant)
Translates text into Pig Latin.
loadDefaultTables()
Dummy methods required by base class.
Base class for multi-variant language conversion.
Wrapper around strtr() that holds replacements.