Skip to content

Commit 7558a64

Browse files
committed
Update TranslationController.php
1 parent 8790dc8 commit 7558a64

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Http/Controllers/TranslationController.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ public function getTranslations(): LengthAwarePaginator
3232
});
3333
});
3434
})
35+
// with get Translation Progress Percentage
36+
->withCount(['phrases as translated' => function ($query) {
37+
$query->whereNotNull('value');
38+
}])
39+
->withCount(['phrases as untranslated' => function ($query) {
40+
$query->whereNull('value');
41+
}])
42+
->withCount('phrases')
43+
3544
->with('language')->paginate(12)->onEachSide(0);
3645
}
3746
public function getTranslationProgressPercentage(Translation $translation): JsonResponse

0 commit comments

Comments
 (0)