From 70f3ee9116f6f7525eea705e01c3da9514b4b854 Mon Sep 17 00:00:00 2001 From: arsam Date: Fri, 18 Sep 2026 23:20:20 +0330 Subject: [PATCH] Import source: web/src/lib/i18n Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality. --- web/src/lib/i18n.ts | 97 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 web/src/lib/i18n.ts diff --git a/web/src/lib/i18n.ts b/web/src/lib/i18n.ts new file mode 100644 index 0000000..e62e75b --- /dev/null +++ b/web/src/lib/i18n.ts @@ -0,0 +1,97 @@ +export type Lang = "en" | "fa"; + +const en = { + tagline: "uptime observatory", + allOperational: "All systems operational", + someDegraded: "Degraded performance", + outage: "Active outage", + pending: "Awaiting first checks", + targets: "Targets", + incidents: "Incidents", + ongoing: "ongoing", + resolved: "resolved", + uptime: "uptime", + latency: "latency", + lastCheck: "last check", + interval: "every", + live: "live", + connecting: "connecting", + systemDay: "last 24 hours", + noIncidents: "No incidents in this window", + noData: "no data", + checks: "checks", + failed: "failed", + certExpiry: "cert expires in", + daysShort: "d", + internalMode: "Console", + publicMode: "Status", + overall: "overall", + endpoint: "endpoint", + recentIncidents: "recent incidents", + close: "Close", + now: "now", + duration: "duration", + state: { + up: "operational", + degraded: "degraded", + down: "down", + unknown: "pending", + } as Record, + orbit: "system orbit", + dial: "day dial", + all: "all", + themeLight: "Switch to light theme", + themeDark: "Switch to dark theme", + openEndpoint: "Open endpoint", + uptime30: "uptime 30d", +}; + +const fa: typeof en = { + tagline: "رصدخانهٔ پایداری", + allOperational: "همهٔ سامانه‌ها پایدارند", + someDegraded: "افت کارایی", + outage: "قطعی فعال", + pending: "در انتظار نخستین بررسی", + targets: "هدف‌ها", + incidents: "رخدادها", + ongoing: "در جریان", + resolved: "برطرف‌شده", + uptime: "دسترس‌پذیری", + latency: "تأخیر", + lastCheck: "آخرین بررسی", + interval: "هر", + live: "زنده", + connecting: "در حال اتصال", + systemDay: "۲۴ ساعت گذشته", + noIncidents: "رخدادی در این بازه نیست", + noData: "بدون داده", + checks: "بررسی", + failed: "ناموفق", + certExpiry: "اعتبار گواهی", + daysShort: " روز", + internalMode: "کنسول", + publicMode: "وضعیت", + overall: "کلی", + endpoint: "نشانی", + recentIncidents: "رخدادهای اخیر", + close: "بستن", + now: "اکنون", + duration: "مدت", + state: { + up: "پایدار", + degraded: "افت‌کرده", + down: "قطع", + unknown: "در انتظار", + }, + orbit: "مدار سامانه", + dial: "صفحهٔ شبانه‌روز", + all: "همه", + themeLight: "پوستهٔ روشن", + themeDark: "پوستهٔ تیره", + openEndpoint: "باز کردن نشانی", + uptime30: "دسترس‌پذیری ۳۰ روزه", +}; + +export const STRINGS: Record = { en, fa }; + +export const localeOf = (lang: Lang) => (lang === "fa" ? "fa-IR" : "en-US");