// Pure helpers for the public landing page (Stage 17), kept out of the Svelte component so // the per-language Telegram-bot link selection is unit-testable. import type { Locale } from './i18n/index.svelte'; /** * telegramBotLink returns the t.me link for the locale's game bot, or null when it is not * configured. The two links are build-time vars (VITE_TELEGRAM_LINK_EN / VITE_TELEGRAM_LINK_RU) * because the test and prod contours run different bots (different usernames), so the link * cannot be hardcoded. */ export function telegramBotLink(locale: Locale): string | null { const raw = locale === 'ru' ? import.meta.env.VITE_TELEGRAM_LINK_RU : import.meta.env.VITE_TELEGRAM_LINK_EN; const link = (raw as string | undefined)?.trim(); return link ? link : null; }