Localization
Quark Commerce supports multi-language content for all customer-facing entities. Translations are managed via a centralized localization system.
How It Works
The localization system stores translations as key-value pairs keyed by (EntityId, EntityType, PropertyName, LanguageId). When you set X-Language-Code: tr, the API returns Turkish translations for product names, descriptions, category names, etc.
What Gets Localized
| Entity | Localized Properties |
|---|---|
| Product | Name, Description |
| ProductVariant | Name |
| Category | Name, Description |
| Brand | Name, Description |
| Attribute | Name |
| AttributeValue | Name |
| Specification | Name |
| SpecificationValue | Value |
| Navigation Menu | Name |
| Navigation Item | Label |
| Legal Document | Title, Content |
Fallback Behavior
If a translation is not available for the requested language, the API returns the default language value (typically English). This ensures content is always returned, even if translations are incomplete.
Language Selection in Your App
- Fetch available languages from
/api/storefront/store-config - Let users choose their preferred language (or detect from browser locale)
- Send
X-Language-Codewith every request
// Example: Setting language header in an HTTP client interceptor
intercept(req, next) {
const lang = this.languageService.currentLanguage(); // 'en' | 'tr'
return next.handle(req.clone({
setHeaders: { 'X-Language-Code': lang }
}));
}
Slug Localization
Slugs are also language-aware. The same product can have different slugs per language:
| Language | Slug |
|---|---|
| English | classic-t-shirt-white |
| Turkish | klasik-tisort-beyaz |
The slug resolution endpoint (/api/storefront/slugs/{slug}) resolves any language slug to the correct entity. See Slugs & SEO.