--- import { getRelativeLocaleUrl } from "astro:i18n"; import LanguageSwitcher from "../components/LanguageSwitcher.astro"; import Starfield from "../components/Starfield.astro"; import Analytics from "../components/Analytics.astro"; import { useT } from "../i18n/translations"; import type { Lang } from "../i18n/translations"; interface Props { title?: string; description?: string; } const lang = (Astro.currentLocale as Lang) || "en"; const T = useT(lang); const { title = T.defaultTitle, description = T.defaultDesc } = Astro.props; const pathWithoutLocale = Astro.url.pathname.replace(/^\/ru/, "") || "/"; const enUrl = `https://randify.pro${getRelativeLocaleUrl("en", pathWithoutLocale)}`; const ruUrl = `https://randify.pro${getRelativeLocaleUrl("ru", pathWithoutLocale)}`; const canonicalUrl = `https://randify.pro${Astro.url.pathname}`; const webPageSchema = { "@context": "https://schema.org", "@type": "WebPage", name: title, description: description, url: canonicalUrl, inLanguage: lang, }; ---