Translations & Localization
Translate store content into 15 languages using the Admin Translations API with optional AI-powered auto-translate.
Overview
Cartly uses two complementary translation layers:
- DB Entity Translations — per-entity, per-locale strings stored in the
translationtable. Covers products, collections, pages, articles, menus, and metafields. - Static Locale Files — storefront UI strings compiled into
locales/*.jsonand rendered via the{{ 'key' | t }}Liquid filter. Managed per-theme.
Entity Translations API
All endpoints require admin JWT authentication via Authorization: Bearer TOKEN.
| Method | Path | Description |
|---|---|---|
GET | /admin/translations/:type/:entityId | Get all locales for an entity |
GET | /admin/translations/:type/:entityId/:locale | Get translations for one locale |
PUT | /admin/translations/:type/:entityId/:locale | Save specific field translations |
DELETE | /admin/translations/:type/:entityId/:locale | Delete a locale translation |
POST | /admin/translations/auto-translate | AI-translate fields of one entity into one or more locales |
Supported entity types: product, variant, collection, page, article, menu, metafield
curl -X GET "https://cartly.pro/admin/translations/product/PRODUCT_ID/de" \
-H "Authorization: Bearer ADMIN_JWT"
# Response
# {
# "locale": "de",
# "fields": {
# "title": "Klassisches T-Shirt",
# "description": "Ein bequemes Baumwoll-T-Shirt"
# }
# }curl -X PUT "https://cartly.pro/admin/translations/product/PRODUCT_ID/de" \
-H "Authorization: Bearer ADMIN_JWT" \
-H "Content-Type: application/json" \
-d '{
"title": "Klassisches T-Shirt",
"description": "Ein bequemes Baumwoll-T-Shirt in mehreren Farben"
}'AI Auto-Translate
The POST /admin/translations/auto-translate endpoint uses the platform AI to translate or generate content for the chosen fields into each target locale, and saves the result.
| Field | Type | Description |
|---|---|---|
entity_type | string | product, collection, page or article |
entity_id | UUID | Target entity ID |
target_locales | string[] | Target locales (e.g. ["de", "fr"]); the source locale is skipped |
fields | string[] | title, description, meta_title, meta_description, body_html |
source_locale | string | Optional; defaults to the primary market's locale |
mode | string | translate (preserve meaning) or generate (SEO-optimized) |
curl -X POST "https://cartly.pro/admin/translations/auto-translate" \
-H "Authorization: Bearer ADMIN_JWT" \
-H "Content-Type: application/json" \
-d '{
"entity_type": "product",
"entity_id": "PRODUCT_UUID",
"target_locales": ["de"],
"fields": ["title"],
"mode": "translate"
}'
# Response — translations are saved; a locale that failed carries "error"
# { "data": [{ "locale": "de", "translations": { "title": "Klassisches T-Shirt" } }], "credits_milli": 120 }Billing
AI translation uses the plan's AI credits, charged per locale by the AI's actual usage. Refusals return 402:
ai_plan_required— AI features require a paid planai_credits_exhausted— this month's AI credits are used up; the body hasresets_atandtopup_url
503 means AI translation is temporarily unavailable.
Audit Logging
Every call to auto-translate is recorded in ai_audit_logs with entity type, entity ID, locale, field, token count, and latency.
Integration Workflow
- Fetch the existing product:
GET /admin/products/:id - Translate a field:
POST /admin/translations/auto-translatewithmode: translate - Save the result:
PUT /admin/translations/product/:id/:localewith translated field value - Storefront automatically serves translated content when the visitor locale or market matches
Supported Locales
Built-in storefront locales: en, ru, de, fr, es, uk
Additional AI-translation targets: zh, ja, ko, ar, pt, it, nl, pl, tr