summaryrefslogtreecommitdiff
path: root/src/components/blog/Masthead.astro
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/blog/Masthead.astro')
-rw-r--r--src/components/blog/Masthead.astro18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/components/blog/Masthead.astro b/src/components/blog/Masthead.astro
index 1f52383..e7b3ea9 100644
--- a/src/components/blog/Masthead.astro
+++ b/src/components/blog/Masthead.astro
@@ -2,15 +2,18 @@
import { Image } from "astro:assets";
import type { CollectionEntry } from "astro:content";
import FormattedDate from "@/components/FormattedDate.astro";
+import { t } from "@/i18n/translations";
interface Props {
content: CollectionEntry<"post">;
readingTime: string;
+ language?: string | undefined;
}
const {
content: { data },
readingTime,
+ language,
} = Astro.props;
const dateTimeOptions: Intl.DateTimeFormatOptions = {
@@ -38,14 +41,21 @@ const dateTimeOptions: Intl.DateTimeFormatOptions = {
</h1>
<div class="flex flex-wrap items-center gap-x-3 gap-y-2">
<p class="font-semibold">
- <FormattedDate date={data.publishDate} dateTimeOptions={dateTimeOptions} /> /{" "}
+ <FormattedDate date={data.publishDate} dateTimeOptions={dateTimeOptions} locale={language} /> /{
+ " "
+ }
{readingTime}
</p>
{
data.updatedDate && (
<span class="bg-quote/5 text-quote rounded-lg px-2 py-1">
- Updated:
- <FormattedDate class="ms-1" date={data.updatedDate} dateTimeOptions={dateTimeOptions} />
+ {t(language, "updated")}
+ <FormattedDate
+ class="ms-1"
+ date={data.updatedDate}
+ dateTimeOptions={dateTimeOptions}
+ locale={language}
+ />
</span>
)
}
@@ -74,7 +84,7 @@ const dateTimeOptions: Intl.DateTimeFormatOptions = {
<>
{/* prettier-ignore */}
<span class="contents">
- <a class="cactus-link inline-block before:content-['#']" data-pagefind-filter={`tag:${tag}`} href={`/tags/${tag}/`}><span class="sr-only">View more blogs with the tag&nbsp;</span>{tag}
+ <a class="cactus-link inline-block before:content-['#']" data-pagefind-filter={`tag:${tag}`} href={`/tags/${tag}/`}><span class="sr-only">{t(language, "viewMoreWithTag")}&nbsp;</span>{tag}
</a>{i < data.tags.length - 1 && ", "}
</span>
</>