getGroup( $group ); $collection = $g->initCollection( 'en' ); foreach ( $languages as $code ) { $collection->resetForNewLanguage( $code ); // Initialise messages $collection->filter( 'ignored' ); $collection->filter( 'optional' ); // Store the count of real messages for later calculation. $total = count( $collection ); $collection->filter( 'translated', false ); $translated = count( $collection ); $translatedPercentage = ( $translated * 100 ) / $total; if ( $translatedPercentage >= $threshold ) { if ( $simple ) { $stats[] = $code; } else { $stats[$code] = $translatedPercentage; } } } return $stats; } }