Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add i18n for hero sponsors banner #768

Merged
merged 1 commit into from
Apr 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}
Loading