summaryrefslogtreecommitdiff
path: root/src/components/NewsPreviewLink.astro
diff options
context:
space:
mode:
authorJoe Carstairs <jcarstairs@scottlogic.com>2023-08-15 18:00:09 +0100
committerJoe Carstairs <jcarstairs@scottlogic.com>2023-08-15 18:00:09 +0100
commit8b009f0ea6ea9d181ba8d0e6549c25645aa697c4 (patch)
treede2230462370cf3daad38b7e2692763b949bac20 /src/components/NewsPreviewLink.astro
parentabbacb6f7d6b4d93760f8f84ac5c9ec5857fad08 (diff)
NewsPreviewLink finds out its own locale
Diffstat (limited to 'src/components/NewsPreviewLink.astro')
-rw-r--r--src/components/NewsPreviewLink.astro6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/NewsPreviewLink.astro b/src/components/NewsPreviewLink.astro
index 99ecb60..566f136 100644
--- a/src/components/NewsPreviewLink.astro
+++ b/src/components/NewsPreviewLink.astro
@@ -1,15 +1,15 @@
---
import translate from '$i18n/translate';
import tNewsPreviewLink from '$i18n/translations/components/newsPreviewLink';
-import type Locale from '$types/Locale';
+import getLocaleFromPath from '$lib/getLocaleFromPath';
import type { CollectionEntry } from 'astro:content';
interface Props {
- locale: Locale;
newsItem: CollectionEntry<'news'>;
}
-const { locale, newsItem } = Astro.props;
+const { newsItem } = Astro.props;
+const locale = getLocaleFromPath(Astro.url.pathname);
const t = translate(locale);
---