blob: 56592578f39fc14cbb74df9626bbb37bae709ae6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
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];
}
|