@@ -62,6 +62,12 @@ public function index(Translation $translation, Request $request): Response|Redi
6262 ->paginate ($ request ->input ('perPage ' ) ?? 12 )
6363 ->withQueryString ();
6464
65+ $ translation = $ translation
66+ ->withCount ('phrases ' )
67+ ->withProgress ()
68+ ->where ('id ' , $ translation ->id )
69+ ->first ();
70+
6571 return Inertia::render ('phrases/index ' , [
6672 'phrases ' => PhraseResource::collection ($ phrases ),
6773 'translation ' => TranslationResource::make ($ translation ),
@@ -81,10 +87,18 @@ public function edit(Translation $translation, Phrase $phrase): RedirectResponse
8187 return redirect ()->route ('ltu.source_translation.edit ' , $ phrase ->uuid );
8288 }
8389
90+ $ translation = $ translation
91+ ->withCount ('phrases ' )
92+ ->withProgress ()
93+ ->where ('id ' , $ translation ->id )
94+ ->first ();
95+
8496 return Inertia::render ('phrases/edit ' , [
8597 'phrase ' => PhraseResource::make ($ phrase ),
8698 'translation ' => TranslationResource::make ($ translation ),
87- 'source ' => TranslationResource::make (Translation::where ('source ' , true )?->first()),
99+ 'source ' => TranslationResource::make (Translation::isSource ()
100+ ->withCount ('phrases ' )
101+ ->withProgress ()?->first()),
88102 'similarPhrases ' => PhraseResource::collection ($ phrase ->similarPhrases ()),
89103 'suggestedTranslations ' => [
90104 'google ' => [
0 commit comments