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
31
32
33
34
35
36
|
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];
}
|