docs: update subscription form component

Update all i18n to get translated texts for each part of subscription form card
This commit is contained in:
kabrunko-dev
2024-01-31 14:24:23 -03:00
parent aab419f18c
commit 3e9c56646f
11 changed files with 41 additions and 15 deletions

View File

@@ -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');
--- ---
<div class="sp-form-outer sp-force-hide"> <div class="sp-form-outer sp-force-hide">
@@ -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" sp-tips="%7B%22required%22%3A%22Required%20field%22%2C%22wrong%22%3A%22Wrong%20email%22%7D" autocomplete="on"
required="required"></div> required="required"></div>
<div class="sp-field sp-button-container " sp-id="sp-82642eda-e68f-4b7a-a2b8-69e9d9bb5c99"> <div class="sp-field sp-button-container " sp-id="sp-82642eda-e68f-4b7a-a2b8-69e9d9bb5c99">
<button id="sp-82642eda-e68f-4b7a-a2b8-69e9d9bb5c99" class="sp-button">Subscribe</button> <button id="sp-82642eda-e68f-4b7a-a2b8-69e9d9bb5c99" class="sp-button">{data['subscription.button']}</button>
</div> </div>
</form> </form>
</div> </div>
@@ -28,12 +31,12 @@ const { isNote } = Astro.props;
<path <path
d="M12 11C11.7348 11 11.4804 11.1054 11.2929 11.2929C11.1054 11.4804 11 11.7348 11 12V16C11 16.2652 11.1054 16.5196 11.2929 16.7071C11.4804 16.8946 11.7348 17 12 17C12.2652 17 12.5196 16.8946 12.7071 16.7071C12.8946 16.5196 13 16.2652 13 16V12C13 11.7348 12.8946 11.4804 12.7071 11.2929C12.5196 11.1054 12.2652 11 12 11ZM12.38 7.08C12.1365 6.97998 11.8635 6.97998 11.62 7.08C11.4973 7.12759 11.3851 7.19896 11.29 7.29C11.2017 7.3872 11.1306 7.49882 11.08 7.62C11.024 7.73868 10.9966 7.86882 11 8C10.9992 8.13161 11.0245 8.26207 11.0742 8.38391C11.124 8.50574 11.1973 8.61656 11.29 8.71C11.3872 8.79833 11.4988 8.86936 11.62 8.92C11.7715 8.98224 11.936 9.00632 12.099 8.99011C12.2619 8.97391 12.4184 8.91792 12.5547 8.82707C12.691 8.73622 12.8029 8.61328 12.8805 8.46907C12.9582 8.32486 12.9992 8.16378 13 8C12.9963 7.73523 12.8927 7.48163 12.71 7.29C12.6149 7.19896 12.5028 7.12759 12.38 7.08ZM12 2C10.0222 2 8.08879 2.58649 6.4443 3.6853C4.79981 4.78412 3.51809 6.3459 2.76121 8.17317C2.00433 10.0004 1.8063 12.0111 2.19215 13.9509C2.578 15.8907 3.53041 17.6725 4.92894 19.0711C6.32746 20.4696 8.10929 21.422 10.0491 21.8079C11.9889 22.1937 13.9996 21.9957 15.8268 21.2388C17.6541 20.4819 19.2159 19.2002 20.3147 17.5557C21.4135 15.9112 22 13.9778 22 12C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7363 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2ZM12 20C10.4178 20 8.87104 19.5308 7.55544 18.6518C6.23985 17.7727 5.21447 16.5233 4.60897 15.0615C4.00347 13.5997 3.84504 11.9911 4.15372 10.4393C4.4624 8.88743 5.22433 7.46197 6.34315 6.34315C7.46197 5.22433 8.88743 4.4624 10.4393 4.15372C11.9911 3.84504 13.5997 4.00346 15.0615 4.60896C16.5233 5.21447 17.7727 6.23984 18.6518 7.55544C19.5308 8.87103 20 10.4177 20 12C20 14.1217 19.1572 16.1566 17.6569 17.6569C16.1566 19.1571 14.1217 20 12 20Z"></path> d="M12 11C11.7348 11 11.4804 11.1054 11.2929 11.2929C11.1054 11.4804 11 11.7348 11 12V16C11 16.2652 11.1054 16.5196 11.2929 16.7071C11.4804 16.8946 11.7348 17 12 17C12.2652 17 12.5196 16.8946 12.7071 16.7071C12.8946 16.5196 13 16.2652 13 16V12C13 11.7348 12.8946 11.4804 12.7071 11.2929C12.5196 11.1054 12.2652 11 12 11ZM12.38 7.08C12.1365 6.97998 11.8635 6.97998 11.62 7.08C11.4973 7.12759 11.3851 7.19896 11.29 7.29C11.2017 7.3872 11.1306 7.49882 11.08 7.62C11.024 7.73868 10.9966 7.86882 11 8C10.9992 8.13161 11.0245 8.26207 11.0742 8.38391C11.124 8.50574 11.1973 8.61656 11.29 8.71C11.3872 8.79833 11.4988 8.86936 11.62 8.92C11.7715 8.98224 11.936 9.00632 12.099 8.99011C12.2619 8.97391 12.4184 8.91792 12.5547 8.82707C12.691 8.73622 12.8029 8.61328 12.8805 8.46907C12.9582 8.32486 12.9992 8.16378 13 8C12.9963 7.73523 12.8927 7.48163 12.71 7.29C12.6149 7.19896 12.5028 7.12759 12.38 7.08ZM12 2C10.0222 2 8.08879 2.58649 6.4443 3.6853C4.79981 4.78412 3.51809 6.3459 2.76121 8.17317C2.00433 10.0004 1.8063 12.0111 2.19215 13.9509C2.578 15.8907 3.53041 17.6725 4.92894 19.0711C6.32746 20.4696 8.10929 21.422 10.0491 21.8079C11.9889 22.1937 13.9996 21.9957 15.8268 21.2388C17.6541 20.4819 19.2159 19.2002 20.3147 17.5557C21.4135 15.9112 22 13.9778 22 12C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7363 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2ZM12 20C10.4178 20 8.87104 19.5308 7.55544 18.6518C6.23985 17.7727 5.21447 16.5233 4.60897 15.0615C4.00347 13.5997 3.84504 11.9911 4.15372 10.4393C4.4624 8.88743 5.22433 7.46197 6.34315 6.34315C7.46197 5.22433 8.88743 4.4624 10.4393 4.15372C11.9911 3.84504 13.5997 4.00346 15.0615 4.60896C16.5233 5.21447 17.7727 6.23984 18.6518 7.55544C19.5308 8.87103 20 10.4177 20 12C20 14.1217 19.1572 16.1566 17.6569 17.6569C16.1566 19.1571 14.1217 20 12 20Z"></path>
</svg> </svg>
Notes {data['subscription.note.title']}
</p> </p>
<p>This email will only be used for sending new challenges updates.</p> <p>{data['subscription.note.description']}.</p>
</aside> </aside>
: :
<span class="subnote">*This email will only be used for sending new challenges updates.</span> <span class="subnote">*{data['subscription.note.description']}.</span>
} }
<style> <style>

View File

@@ -49,6 +49,9 @@ const i18n = defineCollection({
'challenge.footer.blogPost': z.string(), 'challenge.footer.blogPost': z.string(),
'challenge.footer.gettingStarted.title': z.string(), 'challenge.footer.gettingStarted.title': z.string(),
'challenge.footer.gettingStarted.link': z.string(), 'challenge.footer.gettingStarted.link': z.string(),
'subscription.button': z.string(),
'subscription.note.title': z.string(),
'subscription.note.description': z.string(),
}) })
.partial(), .partial(),
}), }),

View File

@@ -32,7 +32,7 @@ import SubscriptionForm from '../../../components/SubscriptionForm.astro'
</Card> </Card>
<Card title="Subscribe to get notify of latest challenges"> <Card title="Subscribe to get notify of latest challenges">
<SubscriptionForm isNote={false}/> <SubscriptionForm isNote={false} lang="es"/>
</Card> </Card>
<Card title="Conviértete en un Contribuidor de OSS"> <Card title="Conviértete en un Contribuidor de OSS">

View File

@@ -33,7 +33,7 @@ import SubscriptionForm from '../../../components/SubscriptionForm.astro'
</Card> </Card>
<Card title="Subscribe to get notify of latest challenges"> <Card title="Subscribe to get notify of latest challenges">
<SubscriptionForm isNote={false}/> <SubscriptionForm isNote={false} lang="fr"/>
</Card> </Card>
<Card title="Devenir un Mainteneur OSS"> <Card title="Devenir un Mainteneur OSS">

View File

@@ -33,8 +33,8 @@ import SubscriptionForm from '../../../components/SubscriptionForm.astro'
melhorar suas habilidades. melhorar suas habilidades.
</Card> </Card>
<Card title="Subscribe to get notify of latest challenges"> <Card title="Inscreva-se para ser notificado do desafio mais recente">
<SubscriptionForm isNote={false}/> <SubscriptionForm isNote={false} lang="pt"/>
</Card> </Card>
{' '} {' '}

View File

@@ -32,7 +32,7 @@ import SubscriptionForm from '../../../components/SubscriptionForm.astro'
</Card> </Card>
<Card title="Subscribe to get notify of latest challenges"> <Card title="Subscribe to get notify of latest challenges">
<SubscriptionForm isNote={false}/> <SubscriptionForm isNote={false} lang="ru"/>
</Card> </Card>
<Card title="Станьте мейнтейнером открытого программного обеспечения (OSS)"> <Card title="Станьте мейнтейнером открытого программного обеспечения (OSS)">

View File

@@ -11,5 +11,9 @@
"challenge.footer.authorAnswer": "Solution de l'auteur", "challenge.footer.authorAnswer": "Solution de l'auteur",
"challenge.footer.blogPost": "Article", "challenge.footer.blogPost": "Article",
"challenge.footer.gettingStarted.title": "Pour faire ce challenge, commencer par lire: ", "challenge.footer.gettingStarted.title": "Pour faire ce challenge, commencer par lire: ",
"challenge.footer.gettingStarted.link": "Comment Démarrer" "challenge.footer.gettingStarted.link": "Comment Démarrer",
"subscription.button": "Subscribe",
"subscription.email": "username@gmail.com",
"subscription.note.title": "Notes",
"subscription.note.description": "This email will only be used for sending new challenges updates"
} }

View File

@@ -51,5 +51,9 @@
"challenge.footer.authorAnswer": "Respuesta del Autor del Reto", "challenge.footer.authorAnswer": "Respuesta del Autor del Reto",
"challenge.footer.blogPost": "Blog Post", "challenge.footer.blogPost": "Blog Post",
"challenge.footer.gettingStarted.title": "Para realizar este desafío, comienza por leer: ", "challenge.footer.gettingStarted.title": "Para realizar este desafío, comienza por leer: ",
"challenge.footer.gettingStarted.link": "Inicio" "challenge.footer.gettingStarted.link": "Inicio",
"subscription.button": "Subscribe",
"subscription.email": "username@gmail.com",
"subscription.note.title": "Notes",
"subscription.note.description": "This email will only be used for sending new challenges updates"
} }

View File

@@ -11,5 +11,9 @@
"challenge.footer.authorAnswer": "Author Answer", "challenge.footer.authorAnswer": "Author Answer",
"challenge.footer.blogPost": "Blog Post", "challenge.footer.blogPost": "Blog Post",
"challenge.footer.gettingStarted.title": "To do this challenge, start by reading: ", "challenge.footer.gettingStarted.title": "To do this challenge, start by reading: ",
"challenge.footer.gettingStarted.link": "Getting Started" "challenge.footer.gettingStarted.link": "Getting Started",
"subscription.button": "Subscribe",
"subscription.email": "username@gmail.com",
"subscription.note.title": "Notes",
"subscription.note.description": "This email will only be used for sending new challenges updates"
} }

View File

@@ -12,5 +12,9 @@
"challenge.footer.authorAnswer": "Solução do Autor do Desafio", "challenge.footer.authorAnswer": "Solução do Autor do Desafio",
"challenge.footer.blogPost": "Artigo", "challenge.footer.blogPost": "Artigo",
"challenge.footer.gettingStarted.title": "Para realizar este desafio, comece lendo: ", "challenge.footer.gettingStarted.title": "Para realizar este desafio, comece lendo: ",
"challenge.footer.gettingStarted.link": "Começando" "challenge.footer.gettingStarted.link": "Começando",
"subscription.button": "Inscrever-se",
"subscription.email": "usuario@gmail.com",
"subscription.note.title": "Notas",
"subscription.note.description": "Este email será apenas usado para enviar atualizações de novos desafios"
} }

View File

@@ -12,5 +12,9 @@
"challenge.footer.authorAnswer": "Решение автора", "challenge.footer.authorAnswer": "Решение автора",
"challenge.footer.blogPost": "Статья", "challenge.footer.blogPost": "Статья",
"challenge.footer.gettingStarted.title": "Чтобы пройти это испытание, прочитайте:", "challenge.footer.gettingStarted.title": "Чтобы пройти это испытание, прочитайте:",
"challenge.footer.gettingStarted.link": "Первые шаги" "challenge.footer.gettingStarted.link": "Первые шаги",
"subscription.button": "Subscribe",
"subscription.email": "username@gmail.com",
"subscription.note.title": "Notes",
"subscription.note.description": "This email will only be used for sending new challenges updates"
} }