Skip to main content

Dil Güncelle

Dil bilgilerini günceller (Admin).

Endpoint

PUT /api/v1/admin/locales/\{code\}
PATCH /api/v1/admin/locales/\{code\}

Authentication

Bu endpoint authentication gerektirir.

Header: Authorization: Bearer \{token\}

Permission

  • locales.update - Dil güncelleme

Request

Headers

HeaderDeğerZorunlu
AuthorizationBearer \{token\}Evet
Content-Typeapplication/jsonEvet

Path Parameters

ParametreTipZorunluAçıklama
codestringEvetDil kodu (route model binding)

Request Body

ParametreTipZorunluAçıklama
codestringHayırDil kodu (unique olmalı)
namestringHayırDil adı (İngilizce)
native_namestringHayırYerel dil adı
sort_orderintegerHayırSıralama sırası (min: 0)
is_activebooleanHayırAktif durumu

Example Request

{
"name": "Turkish (Updated)",
"native_name": "Türkçe (Güncellendi)",
"sort_order": 2,
"is_active": true
}

Response

Success Response (200 OK)

{
"id": 1,
"code": "tr",
"name": "Turkish (Updated)",
"native_name": "Türkçe (Güncellendi)",
"sort_order": 2,
"is_active": true,
"updated_at": "2025-11-20T12:00:00.000000Z"
}

Error Responses

404 Not Found

{
"message": "Not Found"
}

403 Forbidden

{
"message": "Forbidden"
}

Code Examples

cURL

curl -X PATCH https://api.example.com/api/v1/admin/locales/tr \
-H "Authorization: Bearer \{token\}" \
-H "Content-Type: application/json" \
-d '{
"name": "Turkish (Updated)",
"native_name": "Türkçe (Güncellendi)",
"is_active": true
}'

Notes

  • PUT tüm alanları günceller, PATCH sadece gönderilen alanları günceller
  • code alanı güncellenirse unique olmalıdır
  • Route model binding kullanılır, code alanına göre dil bulunur