first commit

This commit is contained in:
2023-09-12 21:41:04 +02:00
commit 3361a7f053
13284 changed files with 2116755 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
<?php
class WPML_TM_Count_Composite implements IWPML_TM_Count {
/** @var IWPML_TM_Count[] $counts */
private $counts = array();
public function add_count( IWPML_TM_Count $count ) {
$this->counts[] = $count;
}
/** @var IWPML_TM_Count[] $counts */
public function add_counts( $counts ) {
foreach ( $counts as $count ) {
$this->add_count( $count );
}
}
/**
* @param string $lang
*
* @return int
*/
public function get_words_to_translate( $lang ) {
$words = 0;
foreach ( $this->counts as $count ) {
$words += $count->get_words_to_translate( $lang );
}
return $words;
}
/** @return int */
public function get_total_words() {
$words = 0;
foreach ( $this->counts as $count ) {
$words += $count->get_total_words();
}
return $words;
}
}