From f9935cee3241fb9e846a1f3e7aee42272b5803e0 Mon Sep 17 00:00:00 2001 From: Xylight Date: Mon, 3 Jun 2024 16:06:08 -0700 Subject: [PATCH] i18n: localize post badges --- src/lib/components/lemmy/post/PostMeta.svelte | 35 +++++++++++++------ src/lib/components/util/RelativeDate.svelte | 4 ++- src/lib/i18n/en.json | 10 +++++- src/lib/i18n/fr.json | 8 +++++ 4 files changed, 44 insertions(+), 13 deletions(-) diff --git a/src/lib/components/lemmy/post/PostMeta.svelte b/src/lib/components/lemmy/post/PostMeta.svelte index fa1ff4ab..843c6eba 100644 --- a/src/lib/components/lemmy/post/PostMeta.svelte +++ b/src/lib/components/lemmy/post/PostMeta.svelte @@ -20,6 +20,7 @@ import ShieldIcon from '../moderation/ShieldIcon.svelte' import { userSettings } from '$lib/settings' import Markdown from '$lib/components/markdown/Markdown.svelte' + import { t } from '$lib/translations' export let community: Community | undefined = undefined export let subscribed: SubscribedType | undefined = undefined @@ -113,36 +114,48 @@ style="grid-area: badges;" > {#if badges.nsfw} - NSFW + {$t('post.badges.nsfw')} {/if} {#if badges.saved} - + - Saved + {$t('post.badges.saved')} {/if} {#if badges.locked} - + - Locked + {$t('post.badges.locked')} {/if} {#if badges.removed} - + - Removed + {$t('post.badges.removed')} {/if} {#if badges.deleted} - + - Deleted + {$t('post.badges.deleted')} {/if} {#if badges.featured} - + - Featured + {$t('post.badges.featured')} {/if} diff --git a/src/lib/components/util/RelativeDate.svelte b/src/lib/components/util/RelativeDate.svelte index f2c6aa42..89a1e6db 100644 --- a/src/lib/components/util/RelativeDate.svelte +++ b/src/lib/components/util/RelativeDate.svelte @@ -1,4 +1,6 @@