+ function translate( $text, $toVariant ) {
+ if ( $toVariant == 'uz-cyrl' ) {
+ $text = str_replace( 'ye', 'е', $text );
+ $text = str_replace( 'Ye', 'Е', $text );
+ $text = str_replace( 'YE', 'Е', $text );
+ // "е" after consonants, otherwise "э" (see above)
+ $text = preg_replace( '/([BVGDJZYKLMNPRSTFXCWQʻ‘H])E/u', '$1Е', $text );
+ $text = preg_replace( '/([bvgdjzyklmnprstfxcwqʻ‘h])e/ui', '$1е', $text );
+ }
+ return parent::translate( $text, $toVariant );
+ }
+