/opt/mawid/packages/shared/src/i18n
Edit: /opt/mawid/packages/shared/src/i18n/index.ts (5820B)
/**
* All patient-facing strings live here (working rule §7.4).
* Keys are added per feature phase; Phase 0 ships only the echo-mode string
* used to verify the WhatsApp pipe.
*/
export type LocalizedString = { ar: string; tr: string; en: string };
export const messages = {
echoReceived: {
ar: 'تم الاستلام: {text}',
tr: 'Alındı: {text}',
en: 'Received: {text}',
},
handoffNotice: {
ar: 'رح يتواصل معك حدا من فريق العيادة قريباً، شكراً لصبرك 🙏',
tr: 'Klinik ekibimizden biri kısa süre içinde sizinle iletişime geçecek, sabrınız için teşekkürler 🙏',
en: 'Someone from the clinic team will get back to you shortly, thank you for your patience 🙏',
},
agentError: {
ar: 'صار خطأ بسيط عنا، جرب تبعت رسالتك مرة تانية بعد شوي.',
tr: 'Kısa bir teknik sorun yaşadık, lütfen mesajınızı birazdan tekrar gönderin.',
en: 'We hit a small technical issue — please send your message again in a moment.',
},
reminderFirst: {
ar: 'تذكير بموعدك: {service} يوم {time}. بتأكد الحضور؟',
tr: 'Randevu hatırlatması: {service}, {time}. Katılımınızı onaylıyor musunuz?',
en: 'Appointment reminder: {service} on {time}. Can you confirm you are coming?',
},
reminderFinal: {
ar: 'منشوفك قريباً! موعدك {service} الساعة {time}.',
tr: 'Görüşmek üzere! {service} randevunuz {time}.',
en: 'See you soon! Your {service} appointment is at {time}.',
},
reminderNudge: {
ar: 'ما وصلنا تأكيدك بعد — موعدك {service} يوم {time}. إذا ما بتقدر تحضر خبرنا حتى نعطي الموعد لمريض تاني 🙏',
tr: 'Henüz onayınızı alamadık — {service} randevunuz {time}. Gelemeyecekseniz lütfen haber verin, yerinizi başka bir hastaya verebilelim 🙏',
en: "We haven't heard from you — your {service} appointment is on {time}. If you can't make it, please let us know so we can offer the slot to someone else 🙏",
},
confirmedThanks: {
ar: 'تم تأكيد موعدك، منشوفك! 👍',
tr: 'Randevunuz onaylandı, görüşmek üzere! 👍',
en: 'Your appointment is confirmed, see you then! 👍',
},
cancelledOk: {
ar: 'تم إلغاء موعدك. إذا حابب تحجز موعد جديد، خبرني.',
tr: 'Randevunuz iptal edildi. Yeni bir randevu isterseniz yazmanız yeterli.',
en: 'Your appointment has been cancelled. Message me anytime to book a new one.',
},
reschedulePrompt: {
ar: 'أكيد، إيمتى بيناسبك الموعد الجديد؟',
tr: 'Tabii, yeni randevu için hangi gün ve saat size uygun?',
en: 'Of course — what day and time would suit you for the new appointment?',
},
waitlistOffer: {
ar: 'فضي موعد لـ {service} يوم {time}! بدك ياه؟ العرض محجوز إلك لمدة {minutes} دقيقة.',
tr: '{service} için {time} tarihinde bir yer boşaldı! İster misiniz? Bu teklif {minutes} dakika boyunca sizin için ayrıldı.',
en: 'A slot just opened for {service} on {time}! Would you like it? It is held for you for {minutes} minutes.',
},
waitlistAccept: {
ar: 'بدي ياه ✅',
tr: 'Evet, alıyorum ✅',
en: 'Yes, take it ✅',
},
waitlistDecline: {
ar: 'لا شكراً ❌',
tr: 'Hayır, teşekkürler ❌',
en: 'No thanks ❌',
},
waitlistBooked: {
ar: 'تمام! تم حجز موعدك يوم {time}. منشوفك! 🎉',
tr: 'Harika! Randevunuz {time} için onaylandı. Görüşmek üzere! 🎉',
en: 'Great! Your appointment is booked for {time}. See you then! 🎉',
},
waitlistGone: {
ar: 'للأسف انحجز الموعد، بس بعدك على لائحة الانتظار وأول ما يفضى موعد تاني منخبرك.',
tr: 'Maalesef bu saat az önce doldu, ancak bekleme listemizdesiniz — yeni bir yer açılınca haber vereceğiz.',
en: "Sorry, that slot was just taken — you're still on the waitlist and we'll message you when another opens.",
},
waitlistDeclineAck: {
ar: 'ولا يهمك، بعدك على لائحة الانتظار للمواعيد الجاية.',
tr: 'Sorun değil, sonraki boşluklar için bekleme listesinde kalıyorsunuz.',
en: "No problem — you'll stay on the waitlist for future openings.",
},
slotRecoveredOwner: {
ar: 'تم تعبئة الموعد الفاضي: {patient}، {service}، {time}',
tr: 'Boşalan randevu dolduruldu: {patient}, {service}, {time}',
en: 'Slot recovered: {patient}, {service}, {time}',
},
weeklySummaryOwner: {
ar: 'ملخص الأسبوع 📊\nالمواعيد: {appointments}\nالإلغاءات: {cancellations}\nحالات عدم الحضور: {noShows}\nمواعيد مأكدة بعد التذكير: {confirmedAfterReminder}\nمواعيد اتعبت من لائحة الانتظار: {refilledSlots}',
tr: 'Haftalık özet 📊\nRandevular: {appointments}\nİptaller: {cancellations}\nGelmeyenler: {noShows}\nHatırlatma sonrası onaylanan: {confirmedAfterReminder}\nBekleme listesinden doldurulan: {refilledSlots}',
en: 'Weekly summary 📊\nAppointments: {appointments}\nCancellations: {cancellations}\nNo-shows: {noShows}\nConfirmed after reminder: {confirmedAfterReminder}\nSlots refilled from waitlist: {refilledSlots}',
},
} satisfies Record
;
export type MessageKey = keyof typeof messages;
export function t(key: MessageKey, lang: 'ar' | 'tr' | 'en', vars: Record = {}) {
let out: string = messages[key][lang];
for (const [k, v] of Object.entries(vars)) {
out = out.replaceAll(`{${k}}`, v);
}
return out;
}