export const translations = { en: { viewOriginalPost: "View original post on Pleroma →", backToTop: "Back to top", updated: "Updated:", viewMoreWithTag: "View more blogs with the tag", webmentionsTitle: "Webmentions for this post", responsesPoweredBy: "Responses powered by", mention: "Mention", mentions: "Mentions", visitWebmentionSource: "Visit the source of this webmention", personLiked: "Person liked this", peopleLiked: "People liked this", }, pl: { viewOriginalPost: "Zobacz oryginalny wpis na Pleroma →", backToTop: "Powrót na górę", updated: "Zaktualizowano:", viewMoreWithTag: "Zobacz więcej wpisów z tagiem", webmentionsTitle: "Webmentions dla tego wpisu", responsesPoweredBy: "Odpowiedzi dzięki", mention: "Wzmianka", mentions: "Wzmianki", visitWebmentionSource: "Odwiedź źródło tej wzmianki", personLiked: "osoba polubiła", peopleLiked: "osób polubiło", }, } 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]; }