query('locale', $settingService->get('default_locale', config('app.locale'))); // Fetch all translations for the given locale $overrides = Translation::where('locale', $locale)->get(); return view('admin.translations.index', [ 'locale' => $locale, 'overrides' => $overrides, 'availableLocales' => $settingService->getSupportedLocales(), ]); } /** * Update or create a translation override. */ public function update(Request $request, TranslationManager $manager) { $validated = $request->validate([ 'locale' => 'required|string', 'group' => 'required|string', 'key' => 'required|string', 'value' => 'required|string', ]); $manager->updateOverride( $validated['locale'], $validated['group'], $validated['key'], $validated['value'] ); return response()->json(['success' => true]); } /** * Sync translations from files (placeholder for future implementation). */ public function sync() { // This would scan lang files and ensure keys are available for override return response()->json(['message' => 'Sync not yet implemented. Use manual entry for now.']); } }