diff options
| author | Dawid Rycerz <dawid@rycerz.xyz> | 2026-01-13 18:42:05 +0100 |
|---|---|---|
| committer | Dawid Rycerz <dawid@rycerz.xyz> | 2026-01-13 18:42:05 +0100 |
| commit | a1d3fb8df0e00faa3920d7f5085a52002e58574e (patch) | |
| tree | 288c0a6003e7069338035a0a0e3864414b3e071b /src/i18n/translations.ts | |
| parent | 9fe4480c3981c38ae8e24d0495df957039864a5d (diff) | |
Add polish language support
Diffstat (limited to 'src/i18n/translations.ts')
| -rw-r--r-- | src/i18n/translations.ts | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/i18n/translations.ts b/src/i18n/translations.ts new file mode 100644 index 0000000..7631ad7 --- /dev/null +++ b/src/i18n/translations.ts @@ -0,0 +1,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]; +} |
