/** * @return array */ public function getStats() { $stats = array(); $countByDomains = $this->storage->getCountTransUnitByDomains(); foreach ($countByDomains as $domain => $total) { $stats[$domain] = array(); $byLocale = $this->storage->getCountTranslationByLocales($domain); foreach ($this->localeManager->getLocales() as $locale) { $localeCount = isset($byLocale[$locale]) ? $byLocale[$locale] : 0; $stats[$domain][$locale] = array('keys' => $total, 'translated' => $localeCount, 'completed' => $total > 0 ? floor($localeCount / $total * 100) : 0); } } return $stats; }