src/Repositories/LanguageRepository.php
public function percentTranslated($locale)
    {
        $lang          = $this->findByLocale($locale);
        $referenceLang = $this->findByLocale($this->defaultLocale);

        $langEntries      = $lang->translations()->count();
        $referenceEntries = $referenceLang->translations()->count();

        return $referenceEntries > 0 ? (int) round($langEntries * 100 / $referenceEntries) : 0;
    }
public function percentTranslated($locale)
    {
        $lang          = $this->findByLocale($locale);
        $referenceLang = $this->findByLocale($this->defaultLocale);

        $langEntries      = $lang->translations()->count();
        $referenceEntries = $referenceLang->translations()->count();

        return $referenceEntries > 0 ? (int) round($langEntries * 100 / $referenceEntries) : 0;
    }
public function percentTranslated ( $ locale ) { $ lang = $ this -> findByLocale ( $ locale ) ; $ referenceLang = $ this -> findByLocale ( $ this -> defaultLocale ) ; $ langEntries = $ lang -> translations ( ) -> count ( ) ; $ referenceEntries = $ referenceLang -> translations ( ) -> count ( ) ; return $ referenceEntries > 0 ? ( int ) round ( $ langEntries * 100 / $ referenceEntries ) : 0 ; }
Compute percentage translate of the given language.

@param  string   $locale
@param  string   $referenceLocale
@return int
Compute percentage translate of the given language .