From 3e9c56646fb043a5888fc04a5d5d8f864a262c67 Mon Sep 17 00:00:00 2001
From: kabrunko-dev
Date: Wed, 31 Jan 2024 14:24:23 -0300
Subject: [PATCH] docs: update subscription form component
Update all i18n to get translated texts for each part of subscription form card
---
docs/src/components/SubscriptionForm.astro | 13 ++++++++-----
docs/src/content/config.ts | 3 +++
docs/src/content/docs/es/index.mdx | 2 +-
docs/src/content/docs/fr/index.mdx | 2 +-
docs/src/content/docs/pt/index.mdx | 4 ++--
docs/src/content/docs/ru/index.mdx | 2 +-
docs/src/content/i18n/en.json | 6 +++++-
docs/src/content/i18n/es.json | 6 +++++-
docs/src/content/i18n/fr.json | 6 +++++-
docs/src/content/i18n/pt.json | 6 +++++-
docs/src/content/i18n/ru.json | 6 +++++-
11 files changed, 41 insertions(+), 15 deletions(-)
diff --git a/docs/src/components/SubscriptionForm.astro b/docs/src/components/SubscriptionForm.astro
index 42e006f..fc6ec59 100644
--- a/docs/src/components/SubscriptionForm.astro
+++ b/docs/src/components/SubscriptionForm.astro
@@ -1,5 +1,8 @@
---
-const { isNote } = Astro.props;
+import { getEntry } from 'astro:content';
+
+const { isNote, lang } = Astro.props;
+const { data } = await getEntry('i18n', lang ?? 'en');
---
@@ -13,7 +16,7 @@ const { isNote } = Astro.props;
sp-tips="%7B%22required%22%3A%22Required%20field%22%2C%22wrong%22%3A%22Wrong%20email%22%7D" autocomplete="on"
required="required">
-
+
@@ -28,12 +31,12 @@ const { isNote } = Astro.props;
- Notes
+ {data['subscription.note.title']}
- This email will only be used for sending new challenges updates.
+ {data['subscription.note.description']}.
:
-*This email will only be used for sending new challenges updates.
+*{data['subscription.note.description']}.
}