package_factory = $package_factory; $this->records = $records; $this->active_langs = $active_langs; } /** @param int $package_id */ public function process( $package_id ) { $package = $this->package_factory->create( $package_id ); $word_counts = new WPML_TM_Count(); foreach ( $this->active_langs as $lang ) { if ( $package->get_package_language() === $lang ) { $word_counts->set_total_words( $this->records->get_string_words_to_translate_per_lang( null, $package_id ) ); } else { $word_counts->set_words_to_translate( $lang, $this->records->get_string_words_to_translate_per_lang( $lang, $package_id ) ); } } $this->records->set_package_word_count( $package_id, $word_counts ); } }