export const translations = { en: { viewOriginalPost: "View original post on Fediverse →", backToTop: "Back to top", updated: "Updated:", viewMoreWithTag: "View more blogs with the tag", }, pl: { viewOriginalPost: "Zobacz oryginalny wpis na Fediversum →", backToTop: "Powrót na górę", updated: "Zaktualizowano:", viewMoreWithTag: "Zobacz więcej wpisów z tagiem", }, } as const; export type Language = keyof typeof translations; export type TranslationKey = keyof typeof translations.en; export function t(lang: string | undefined, key: TranslationKey): string { const language = (lang === "pl" ? "pl" : "en") as Language; return translations[language][key]; }