[
'not_found' => 'Recipe not found',
'not_found_sub' => 'Try searching for something else.',
'back_home' => '← Back to all recipes',
'nutrition' => 'Nutrition',
'calories' => 'Calories',
'protein' => 'Protein',
'carbs' => 'Carbs',
'fat' => 'Fat',
'ingredients' => 'Ingredients',
'utensils' => 'Utensils',
'steps' => 'Steps',
'also_tasty' => 'Also tasty',
'more_dishes' => 'More dishes to keep you cooking.',
'prep' => 'Prep',
'cook' => 'Cook',
'total' => 'Total',
'serves' => 'Serves',
'level' => 'Level',
],
'de' => [
'not_found' => 'Rezept nicht gefunden',
'not_found_sub' => 'Versuche eine andere Suche.',
'back_home' => '← Zurück zu allen Rezepten',
'nutrition' => 'Nährwerte',
'calories' => 'Kalorien',
'protein' => 'Protein',
'carbs' => 'Kohlenhydrate',
'fat' => 'Fett',
'ingredients' => 'Zutaten',
'utensils' => 'Küchenwerkzeug',
'steps' => 'Schritte',
'also_tasty' => 'Auch lecker',
'more_dishes' => 'Noch mehr zum Nachkochen.',
'prep' => 'Vorbereitung',
'cook' => 'Garen',
'total' => 'Gesamt',
'serves' => 'Portionen',
'level' => 'Level',
],
];
$t = $copy[$lang];
$allRecipes = load_recipes();
$slug = isset($_GET['slug']) ? trim($_GET['slug']) : '';
$recipeRaw = $slug ? find_recipe_by_slug($allRecipes, $slug) : null;
$recipe = $recipeRaw ? localize_recipe($recipeRaw, $lang) : null;
$allRecipesLocal = localize_recipes($allRecipes, $lang);
$langSwitchLabel = $lang === 'de' ? 'EN' : 'DE';
$langSwitchHref = lang_url($lang === 'de' ? 'en' : 'de');
if (!$recipe) {
http_response_code(404);
$pageTitle = $t['not_found'] . ' | FlixCooks';
$description = $t['not_found_sub'];
include __DIR__ . '/partials/head.php';
include __DIR__ . '/partials/header.php';
?>