Çeviri Güncelle
Çeviri bilgilerini günceller (Admin - tek veya toplu).
Endpoint
PUT /api/v1/admin/translations/\{id\}
PATCH /api/v1/admin/translations/\{id\}
Authentication
Bu endpoint authentication gerektirir.
Header: Authorization: Bearer \{token\}
Permission
translations.update- Çeviri güncelleme
Request
Headers
| Header | Değer | Zorunlu |
|---|---|---|
Authorization | Bearer \{token\} | Evet |
Content-Type | application/json | Evet |
Path Parameters
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
id | integer | Evet | Çeviri ID'si (route model binding, ancak kullanılmıyor - key ile çalışır) |
Request Body (Key + Values Formatı)
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
key | string | Evet | Çeviri anahtarı |
values | object | Evet | Dil kodları ve çeviri metinleri (örn: {"tr": "Ana Sayfa", "en": "Home"}) |
group | string | Hayır | Grup adı |
description | string | Hayır | Açıklama |
is_active | boolean | Hayır | Aktif durumu |
Example Request
{
"key": "pages.home",
"values": {
"tr": "Ana Sayfa (Güncellendi)",
"en": "Home Page (Updated)"
},
"group": "pages",
"is_active": true
}
Response
Success Response (200 OK)
{
"message": "Translation update completed",
"updated": [
{
"id": 1,
"key": "pages.home",
"locale": "tr",
"value": "Ana Sayfa (Güncellendi)"
}
],
"created": [],
"errors": []
}
Code Examples
cURL
curl -X PATCH https://api.example.com/api/v1/admin/translations/1 \
-H "Authorization: Bearer \{token\}" \
-H "Content-Type: application/json" \
-d '{
"key": "pages.home",
"values": {
"tr": "Ana Sayfa (Güncellendi)",
"en": "Home Page (Updated)"
}
}'
Notes
PUTtüm alanları günceller,PATCHsadece gönderilen alanları günceller- Key + locale kombinasyonu ile çeviri bulunur veya oluşturulur (upsert)
- Çeviriler güncellendikten sonra cache otomatik temizlenir
- Route model binding kullanılır ancak
keyparametresi ile çalışır
Related Endpoints
- Çeviri Detayı - Çeviri detayını getir
- Toplu Çeviri Güncelleme - Toplu çeviri güncelleme