From 2b6d1af73bea2bc0ed979e633efc319d617363eb Mon Sep 17 00:00:00 2001 From: kabrunko-dev Date: Sat, 13 Apr 2024 00:36:06 -0300 Subject: [PATCH] docs: add i18n for hero sponsors banner --- docs/src/components/Hero.astro | 9 ++++++--- docs/src/content/config.ts | 2 ++ docs/src/content/i18n/en.json | 4 +++- docs/src/content/i18n/es.json | 4 +++- docs/src/content/i18n/fr.json | 4 +++- docs/src/content/i18n/pt.json | 4 +++- docs/src/content/i18n/ru.json | 4 +++- 7 files changed, 23 insertions(+), 8 deletions(-) diff --git a/docs/src/components/Hero.astro b/docs/src/components/Hero.astro index 618b3b80a..53d43a41c 100644 --- a/docs/src/components/Hero.astro +++ b/docs/src/components/Hero.astro @@ -1,14 +1,17 @@ --- import Default from '@astrojs/starlight/components/Hero.astro'; import MyIcon from './MyIcon.astro'; - +import { getEntry } from 'astro:content'; const sponsorFetch = await fetch('https://ghs.vercel.app/v2/sponsors/tomalaforge'); const { sponsors } = await sponsorFetch.json(); + +const { lang } = Astro.props; +const { data } = await getEntry('i18n', lang); --- diff --git a/docs/src/content/config.ts b/docs/src/content/config.ts index 22cf7b701..011bd3ef5 100644 --- a/docs/src/content/config.ts +++ b/docs/src/content/config.ts @@ -60,6 +60,8 @@ const i18n = defineCollection({ 'subscription.note.description': z.string(), 'contributor.title': z.string(), 'contributor.subtitle': z.string(), + 'sponsors.description': z.string(), + 'sponsors.joinButton': z.string(), }) .partial(), }), diff --git a/docs/src/content/i18n/en.json b/docs/src/content/i18n/en.json index 8a5a7670e..86d43a40c 100644 --- a/docs/src/content/i18n/en.json +++ b/docs/src/content/i18n/en.json @@ -21,5 +21,7 @@ "subscription.note.title": "Notes", "subscription.note.description": "This email will only be used for sending new challenges updates", "contributor.title": "Contributors", - "contributor.subtitle": "Thanks to all the contributors who have helped make this documentation better!" + "contributor.subtitle": "Thanks to all the contributors who have helped make this documentation better!", + "sponsors.description": "Big thanks to the people supporting this project: ", + "sponsors.joinButton": "Join the list" } diff --git a/docs/src/content/i18n/es.json b/docs/src/content/i18n/es.json index 43dbadf1c..e015e338a 100644 --- a/docs/src/content/i18n/es.json +++ b/docs/src/content/i18n/es.json @@ -61,5 +61,7 @@ "subscription.note.title": "Notas", "subscription.note.description": "Este correo se utilizará para informar acerca de nuevos retos", "contributor.title": "Contributors", - "contributor.subtitle": "Thanks to all the contributors who have helped make this documentation better!" + "contributor.subtitle": "Thanks to all the contributors who have helped make this documentation better!", + "sponsors.description": "Big thanks to the people supporting this project: ", + "sponsors.joinButton": "Join the list" } diff --git a/docs/src/content/i18n/fr.json b/docs/src/content/i18n/fr.json index 0a08cab7f..a1c704639 100644 --- a/docs/src/content/i18n/fr.json +++ b/docs/src/content/i18n/fr.json @@ -21,5 +21,7 @@ "subscription.note.title": "Notes", "subscription.note.description": "This email will only be used for sending new challenges updates", "contributor.title": "Contributors", - "contributor.subtitle": "Thanks to all the contributors who have helped make this documentation better!" + "contributor.subtitle": "Thanks to all the contributors who have helped make this documentation better!", + "sponsors.description": "Big thanks to the people supporting this project: ", + "sponsors.joinButton": "Join the list" } diff --git a/docs/src/content/i18n/pt.json b/docs/src/content/i18n/pt.json index 12cd9431a..e2d2253d4 100644 --- a/docs/src/content/i18n/pt.json +++ b/docs/src/content/i18n/pt.json @@ -22,5 +22,7 @@ "subscription.note.title": "Notas", "subscription.note.description": "Este email será apenas usado para enviar atualizações de novos desafios", "contributor.title": "Contributors", - "contributor.subtitle": "Thanks to all the contributors who have helped make this documentation better!" + "contributor.subtitle": "Thanks to all the contributors who have helped make this documentation better!", + "sponsors.description": "Muito obrigado as pessoas que apoiam este projeto: ", + "sponsors.joinButton": "Juntar-se à lista" } diff --git a/docs/src/content/i18n/ru.json b/docs/src/content/i18n/ru.json index 6ef15d788..6c841cab8 100644 --- a/docs/src/content/i18n/ru.json +++ b/docs/src/content/i18n/ru.json @@ -22,5 +22,7 @@ "subscription.note.title": "Примечание", "subscription.note.description": "Этот email будет использоваться только для сообщений о новых испытаниях", "contributor.title": "Контрибьюторы", - "contributor.subtitle": "Спасибо всем контрибьюторам которые помогли сделать эту документацию лучше!" + "contributor.subtitle": "Спасибо всем контрибьюторам которые помогли сделать эту документацию лучше!", + "sponsors.description": "Big thanks to the people supporting this project: ", + "sponsors.joinButton": "Join the list" }