package cuisine import ( "encoding/json" "net/http" "github.com/food-ai/backend/internal/locale" ) type cuisineItem struct { Slug string `json:"slug"` Name string `json:"name"` } // List handles GET /cuisines — returns cuisines with names in the requested language. func List(w http.ResponseWriter, r *http.Request) { lang := locale.FromContext(r.Context()) items := make([]cuisineItem, 0, len(Records)) for _, c := range Records { name, ok := c.Translations[lang] if !ok { name = c.Name } items = append(items, cuisineItem{Slug: c.Slug, Name: name}) } w.Header().Set("Content-Type", "application/json") _ = json.NewEncoder(w).Encode(map[string]any{"cuisines": items}) }