Patterns · i18n · RTL

i18n & RTL

TR-tabanlı sipariş yönetimi v2'de Arapça (Suudi/MENA franchise), Almanca (DE/AT döneri), İngilizce (uluslararası operasyon) hedefleniyor. Kuruluş günden itibaren logical CSS properties, Intl API, locale-aware copy.

01 · LTR ↔ RTL · sipariş kartı

LTR · Türkçedir="ltr"
Mehmet Özkan
Sipariş #1247 · 2 dk önce
Hazırlanıyor
2× Köfte Pide89,00 ₺
1× Ayran15,00 ₺
Toplam112,05 ₺
RTL · العربيةdir="rtl"
مع
محمد أوزكان
طلب رقم ١٢٤٧ · قبل دقيقتين
قيد التحضير
كفتة بيدا × ٢٨٩٫٠٠ ر.س
عيران × ١١٥٫٠٠ ر.س
المجموع١١٢٫٠٥ ر.س
/* RTL-safe CSS · logical properties zorunlu */
.btn      { padding-inline: 14px; padding-block: 8px; }   /* ❌ padding-left: 14px */
.icon     { margin-inline-end: 8px; }                     /* ❌ margin-right: 8px */
.card     { border-inline-start: 3px solid var(--primary); }
.list li  { padding-inline-start: 24px; }                 /* bullet space */
.toast    { inset-inline-end: 16px; inset-block-start: 16px; }
.chevron  { transform: scaleX(var(--dir-x, 1)); }         /* RTL'de -1 ile mirror */
[dir="rtl"]{ --dir-x: -1; }

02 · Locale-aware sayı, para, tarih · Intl API

TürLocaleÇıktıKod
Paratr-TR1.250,75 ₺Intl.NumberFormat('tr-TR', { style:'currency', currency:'TRY' })
Parade-DE1.250,75 €Intl.NumberFormat('de-DE', { style:'currency', currency:'EUR' })
Paraen-US$1,250.75Intl.NumberFormat('en-US', { style:'currency', currency:'USD' })
Paraar-SA١٬٢٥٠٫٧٥ ر.س.‏Intl.NumberFormat('ar-SA', { style:'currency', currency:'SAR' })
Tarihtr-TR14 May 2024 14:32Intl.DateTimeFormat('tr-TR', { dateStyle:'medium', timeStyle:'short' })
Tarihen-USMay 14, 2024, 2:32 PMIntl.DateTimeFormat('en-US', { dateStyle:'medium', timeStyle:'short' })
Görecelitr-TR2 dakika önceIntl.RelativeTimeFormat('tr-TR').format(-2, 'minute')
Görecelide-DEvor 2 MinutenIntl.RelativeTimeFormat('de-DE').format(-2, 'minute')
Çoğultr-TR3 sipariş (plural=other, eklenmez)Intl.PluralRules('tr-TR').select(3) → "other"
Çoğulen-US3 ordersIntl.PluralRules('en-US').select(3) → "other"

03 · Türkçe lokalizasyon kuralları (sık hatalar)

KonuYanlışDoğru
KapitalizasyonYeni Sipariş Oluştur (TitleCase)Yeni sipariş oluştur (sentence case)
Tarih sırası05/14/2024 (US)14/05/2024 ya da 14 May 2024
Ondalık112.05 ₺ (US notasyonu)112,05 ₺ (virgül ondalık, nokta binlik)
Para sembolü₺125 (önde)125 ₺ (sonda, NBSP ile)
Saat2:32 PM14:32 (24 saat)
Çoğul3 siparişler3 sipariş (TR'de sayıdan sonra çoğul eki yok)
Buyurgan tonTıklayınız!Tıkla / Devam et (samimi, ünlemsiz)
Türkçe karakterSiparis · #1247Sipariş · #1247 (ş, ç, ğ, ı, İ, ö, ü zorunlu)
Boşluk & sayı15₺ (yapışık)15 ₺ (NBSP)

Kurallar

· Asla left/right/margin-left/padding-right yazma — hep start/end + inline/block. RTL'de bedava döner.
· İkonlar genelde mirror'lanır (chevron, arrow, undo). İçerik-bağımsız (kalp, çöp kutusu, kullanıcı) mirror'lanmaz.
· Sayı/para/tarih asla string concatenation ile değil Intl.* ile. "$" + amount yazan yere kod review'da geri dön.
· Mixed dir: RTL satır içinde TR isim ya da Latin marka adı (nexberry) bidi-control gerektirir; <bdi> tag'i ile sarmala.
· Çoğul: Intl.PluralRules + ICU MessageFormat. TR'de plural-suffix yok; AR'da 6 plural form var (zero/one/two/few/many/other).
· Logical layout: drawer her zaman inset-inline-end:0 (RTL'de otomatik solda açılır), tooltip arrow logical position'la.
· Erişilebilirlik: <html lang dir> doğru atomik dil; karışık metinde lang="ar" attribute'u ekran okuyucu seçimi için kritik.
· Yasak: kod içinde hard-coded "TL", "Bugün", "08:00"; hep token + Intl. Çeviri tablolarında "string interpolation" + sayı (plural'i bozar).