Use $lang->hasVariants() instead of count( $lang->getVariants() ) > 1