summaryrefslogtreecommitdiff
path: root/src/i18n/translations.ts
blob: 0cead2358b7f2661ece2467ce999899e4a0539d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
export const translations = {
	en: {
		viewOriginalPost: "View original post on Fediverse →",
		backToTop: "Back to top",
		updated: "Updated:",
		viewMoreWithTag: "View more blogs with the tag",
		newerPost: "← Newer post",
		olderPost: "Older post →",
		newerPostSr: "Go to newer post:",
		olderPostSr: "Go to older post:",
	},
	pl: {
		viewOriginalPost: "Zobacz oryginalny wpis na Fediversum →",
		backToTop: "Powrót na górę",
		updated: "Zaktualizowano:",
		viewMoreWithTag: "Zobacz więcej wpisów z tagiem",
		newerPost: "← Następny wpis",
		olderPost: "Poprzedni wpis →",
		newerPostSr: "Przejdź do następnego wpisu:",
		olderPostSr: "Przejdź do poprzedniego wpisu:",
	},
} 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];
}