Skip to content

Commit

Permalink
docs: add i18n for hero sponsors banner
Browse files Browse the repository at this point in the history
  • Loading branch information
kabrunko-dev committed Apr 13, 2024
1 parent 991795b commit 2b6d1af
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 8 deletions.
9 changes: 6 additions & 3 deletions docs/src/components/Hero.astro
Original file line number Diff line number Diff line change
@@ -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);
---

<div class="sponsor-header button-hover">
<p>Big thanks to the people supporting this project:
<p>{data['sponsors.description']}
{sponsors.past.map(({username, avatar}) => (
<a href=`https://github.com/${username}`>
<img
Expand All @@ -23,7 +26,7 @@ const { sponsors } = await sponsorFetch.json();
))}
</p>
<a class="action-button" href="https://github.com/sponsors/tomalaforge">
<div>Join the list</div>
<div>{data['sponsors.joinButton']}</div>
<MyIcon name="heart" fill="none" stroke="currentColor" color="white" />
</a>
</div>
Expand Down
2 changes: 2 additions & 0 deletions docs/src/content/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}),
Expand Down
4 changes: 3 additions & 1 deletion docs/src/content/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
4 changes: 3 additions & 1 deletion docs/src/content/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
4 changes: 3 additions & 1 deletion docs/src/content/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
4 changes: 3 additions & 1 deletion docs/src/content/i18n/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
4 changes: 3 additions & 1 deletion docs/src/content/i18n/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

0 comments on commit 2b6d1af

Please sign in to comment.